May 2019
Intermediate to advanced
322 pages
7h 6m
English
Content preview from Programming TypeScript
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
Start your free trial



Appendix A. Type Operators
TypeScript supports a rich set of type operators for working with types. Use Table A-1 as a handy reference for when you want to learn more about an operator.
| Type operator | Syntax | Use it on | Learn more |
|---|---|---|---|
Type query |
|
Any type |
|
Keys |
|
Object types |
|
Property lookup |
|
Object types |
|
Mapped type |
|
Object types |
|
Modifier addition |
|
Object types |
|
Modifier subtraction |
|
Object types |
|
Read-only modifier |
|
Object types, array types, tuple types |
“Objects”, “Classes and Inheritance”, “Read-only arrays and tuples” |
Optional modifier |
|
Object types, tuple types, function parameter types |
|
Conditional type |
|
Generic types, type aliases, function parameter types |
|
Non |
|
Nullable types |
|
Generic type parameter default |
|
Generic types |
|
Type assertion |
|
Any type |
|
Type guard |
|
Function return types |