Chapter 12. Type Development Strategies

All recipes up until now have dealt with specific aspects of the TypeScript programming language and its type system. You have learned about effectively using basic types in Chapters 2 and 3, making your code more reusable through generics in Chapter 4, and crafting advanced types for very delicate situations using conditional types in Chapter 5, string template literal types in Chapter 6, and variadic tuple types in Chapter 7.

We established a collection of helper types in Chapter 8 and worked around standard library limitations in Chapter 9. We learned how to work with JSX as a language extension in Chapter 10 and how and when to use classes in Chapter 11. Every recipe discussed in detail the pros and cons of each approach, giving you better tools to decide correctly for every situation, creating better types, more robust programs, and a stable development flow.

That’s a lot! One thing is still missing, though, the final piece that brings everything together: how do we approach new type challenges? Where do we start? What do we need to look out for?

The answers to these questions make up the contents of this chapter. Here you will learn about the concept of low maintenance types. We will explore a process on how you can start with simple types first and gradually get more refined and stronger. You will learn about the secret features of the TypeScript playground and how to deal with libraries that make validation easier. You will find ...

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