Appendix B. TypeScript cheat sheet
This cheat sheet is not exhaustive. It covers the TypeScript syntax subset used in this book. For a full TypeScript reference, see http://www.typescriptlang.org/docs.
Table B.1. Primitive types
Type |
Description |
---|---|
boolean | Can be true or false. |
number | 64-bit floating-point number. |
string | UTF-16 Unicode string. |
void | Type used as return type for functions that don’t return meaningful values. |
undefined | Can be only undefined. Represents, for example, a variable that was declared but not initialized. |
null | Can be only null. |
object | Represents an object or nonprimitive type. |
unknown | Can represent any value. Type-safe, so it isn’t implicitly converted to another type. |
Any | Bypasses type checking. ... |
Get Programming with Types now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.