-
basic types:
- basic type
boolean: 1
number: 6
string: 15
array: 22
tuple: 27
enum: 37
any: 63
void: 71
never: 81
object: 93
- basic type
-
variable declaring:
- variable declaring
var: 1
var scoping: 16
let: 25
const: 39
destructing: 56
spreading: 75
- variable declaring
-
types:
- class
class: 1
extending: 13
ES private keyword: 25
public, private and protected: 38
constructor parameter property readonly: 58
accessors: 70
static: 89
abstract 101
interfaces-implements class: 121 - enum
number enum: 1
string enum: 6
mixed enum: 18
use enums as types: 30
silly bugs finding: 37
get enum keys: 46
amient enum: 52 - function
simple function: 1
type function: 7
arrow function: 13
arrow type function: 17
optional, default and rest parameters: 22
'this' and arrow function: 37
overloads: 61 - generic function
converting: 1
step 1: 3
step 2: 9
step 3: 15
generic type extends: 21
generic type class: 28 - interface
required member: 1
optional member: 15
readonly member: 30
>>ReadonlyArray: 47
assertion: 51
function interface: 57
indexer: 66
type indexer: 72
class interface: 78
- class
-
type operations:
- compatibilities
type compatibilities: 1
function type compatibilities: 15
rest and optional parameters: 31
enum type compatibilities: 38
generics type cmopatibilities: 43 - inference
type inference: 1
basic inference: 3
best common type: 7 - intersection
intersection type: 1
- compatibilities
-
advanced types:
- advanced types
intersection type: 1
union type: 7
type guard: 11
type perdict: 19
'in' keyword: 26
'typeof' keyword: 32
'instanceof' keyword: 37
nullable types: 44
value types: 50
enum member type: 59
this type: 69
indexer type: 75
>>example: 76
>>answer: 82
mapped type: 88
conditional type: 94
'infer' keyword: 117
multiple type inference: 122
predefined types in lib.d.ts: 142
>>1. Partial: 144
>>2. Required: 150
>>3. Readonly: 157
>>4. Pick: 163
>>5. Record: 171
>>6. Exclude: 175
>>7. Omit: 179
>>8. NonNullable: 187
>>9. Parameters 191
>>10. ConstructorParameters: 195
>>11. Retrun Type: 199
>>12. InstanceType: 206
>>13. ThisParameterType: 210
>>14. OmitThisParameter: 214 - iterator and generator
iterator: 1
generators: 3 runners: 33
>>1. '...': 35
>>2. for in: 41
>>3. for of: 47
>>4. custom '.next': 53 - symbol
symbols: 1
with description: 5
Symbol.for: 14
Symbol.keyFor: 20
well-known symbols: 24
>>1. hasInstance: 26
>>2. inConcatSpreadable: 38
>>3. iterator: 47
>>4. match: 49
>>5. replace: 57
>>6. search: 65
>>7. species: 73
>>8. split: 75
>>9. primitive: 84
>>10. toStringTag: 98
>>11. unscopables: 105 - decorator:
- decorator
basic decorator: 4
meta data: 22
- decorator
- triple-slash:
///<reference path="..."/>
///<reference path="..."/>
: 1///<reference lib="..."/>
///<reference path="..."/>
: 1///<reference types="..."/>
///<reference types="...">
: 1///<amd-module name="..."/>
///<amd-module name="..">
: 1///<amd-dependency path="..." name="..."/>
///<amd-dependency path="..." name="...">
: 1
- advanced types
-
Namespaces and modules
-
simple import and exports
- export statement
export while declaring: 1
export statement: 41
export alias: 43 - namespace import and default export
import statement: 1
import as namespace: 2
export default: 6 - re-export and namespace import with default
re-export: 1
import as namespace with default: 7 - side effect and type import
type import: 1
side effect import: 4 - default export literal
import default alias: 1
export default literal: 3
- export statement
-
CommonJS module
export = ...
export = ...
: 1import ... = require("...")
import ... = require("...")
: 1
-
Ambient module
-
Universal Module Definition
- declaring using
export as ...
declare using
export as ...
: 2 - use import in module
use import: 3
- use UMD global in script
use UMD global: 3
- declaring using
-
Namespacing
-
Namespace Merging
-
-
Others
- declaration merging
- Namespace: 14
- Class: 26
- Interface 38
- Enum: 49
- Type: 61
- Function: 68
- Variable: 81
- TSX
- module JSX and intrinsic elements
module JSX: 1
interface IntrinsicElements: 2
intrinsic elements: 6 - function and class component
module Element: 5
function component: 15
class component: 21 - attribute type
module ElementAttributesProperty: 2
attribute types: 18 - children type
module ElementChildrenAttribute: 2
descriptor of children: 10
- module JSX and intrinsic elements
- declaration merging
- the codes with jsdoc are suggested to be copied or downloaded to real ts files in order to view them. (download link: FelixYu2021202.github.io/ts-tutorial)