TypeScript Reference for JS developers
Glossary of keywords, operators, statements and directives
- TypeScript Reference for JS developers
Glossary of keywords, operators, statements and directives
Statements
Built-in Type Primitives
boolean
, string
, number
, undefined
, null
Complex Types
Type and Interface Properties
{
}
Functions
Arguments
Type Guards and Assertion Functions
is
, asserts condition
, asserts value is Type
Overloads
Type Manipulation
Basic
extends Type ? IfTrue : IfFalse
Extension
Mapped Types
{
[Property in keyof Type]: Type;
-readonly [Property in keyof Type]: Type[Property];
readonly [Property in keyof Type]: Type[Property];
[Property in keyof Type]-?: Type[Property];
[Property in keyof Type]?: Type[Property];
[Properties in keyof Type as NewKeyType]: Type[Properties]
}
Generics
Constrains
Classes
Properties
{
}
Properties present in JS
{
}
Constructor Parameter Properties
{
constructor(parameter arg: Type)
}
Extension
Decorators
@decorator method(...args) {...}
method(@decorator arg: Type) {...}
@decorator get accessor() {...}
@decorator set accessor(value) {...}
}
Utility Types
Exclude<UnionType, ExcludedMembers>