Working with Types

In the preceding chapter, we learned some basic concepts about the TypeScript type system, including the basics about the type inference system and the optional static type annotations.

In this chapter, you will learn about the main features of the TypeScript type system, including the following concepts:

  • The line between TypeScript and JavaScript
  • The features of the type system
  • Union types, intersection types, and discriminated unions
  • Type aliases and local types
  • The typeof and keyof operators
  • Control flow analysis and type guards
  • Non-nullable types
  • Generic types
  • Mapped types, lookup types, and conditional types

Get Learning TypeScript 2.x - Second Edition 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.