This chapter covers:
- What the TypeScript decorators are for
- How to create a new type based on the existing one using mapped types
- How conditional types work
- Combining mapped and conditional types
In the previous chapters, we’ve covered the main types that should be sufficient for the most of your coding activities. But TypeScript goes further and offers you additional derivative types that can become 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 them to be a productive member of your team. Second, their syntax may not be immediately obvious for a software developer who’s familiar with other programming languages.
The materials described in this chapter are not required for understanding the rest of the book and may be skipped if you are short on time. You may want to read this chapter if:
- It’s time to prepare for the next technical interview, where rarely used knowledge is expected.
- You look at a specific code and have a gut feeling that there should be a more elegant solution.
- You’re just curious to learn what else is available as if dealing with interfaces, generics, and enums is not enough.