Chapter 5. Decorators and advanced types

This chapter covers

  • What the TypeScript decorators are for
  • How to create a new type based on an existing one using mapped types
  • How conditional types work
  • Combining mapped and conditional types

In previous chapters, we covered the main types, which should be sufficient for most of your coding activities. But TypeScript goes further and offers you additional derivative types that can be quite handy in certain scenarios.

We used the word “advanced” in this chapter’s title for a couple of reasons. First, you don’t have to know these types to be a productive member of your team. Second, their syntax may not be immediately obvious to a software developer who’s familiar with other programming languages. ...

Get TypeScript Quickly 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.