Utility Types and Type-Level Patterns
The built-in utility types and how each is built, your own utilities, branded types, illegal states that cannot be written, and knowing when types get too clever.
TypeScript ships a toolbox of small helper types: Partial, Pick, Omit, Record, ReturnType, Awaited and more. They look like magic until you see that each is only a few lines of the mapped and conditional types you met in Phases 8 and 9. In this phase you'll read the real definition of every one, then build it yourself and check each step with // ^?.
Then you'll go past the built-ins: your own utilities such as DeepPartial and RequireAtLeastOne, branded types so a UserId can never be passed where an OrderId is expected, and designs where an impossible state simply cannot be written down.
The last topic is about judgement. Clever types can make code harder to read, slow the compiler and produce unreadable errors. You'll learn how to test your types, when to use @ts-expect-error, and when to stop.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.