knowledge icon indicating copy to clipboard operation
knowledge copied to clipboard

Advanced TypeScript types

Open vmasek opened this issue 4 years ago • 0 comments

Proposal

  • Differences between classes, interfaces and type aliases.
  • Literal and enum-member types.
  • Intersection and union types.
  • Type guards based on type discriminants, duck typing, typeof and instanceof.
  • Index signatures and mapped types.
  • Type-generic interfaces, type aliases and functions.

Take away

Developers should be aware of Typescript's more advanced typing capabilities, understand the basics of how they work and in which cases they can be utilized for improved type-safety and IDE intellisense.

In particular, they should understand:

  • generic types and functions,
  • type guards (particularly when combined with strict null checks),
  • unions and discriminated union pattern,
  • mapped types and keyof type.

vmasek avatar Feb 26 '20 13:02 vmasek