Advanced Types for TypeScripts
Advanced types are TypeScript features for computing new types from old ones. Mapped types transform each property of a type, conditional types choose a type with extends and infer, and template literal types build string types from parts. Library authors use them to give precise types to flexible APIs, and they appear inside many utility types.
Stage: Reusable Types · Part of the TypeScript roadmap · Last reviewed 19 November 2026
What to learn in Advanced Types
- Write a mapped type that makes every property of an object nullable
- Use a conditional type with infer to extract a function's return type
- Build a template literal type for event names like on${Capitalize<K>}
- Use keyof and indexed access types to read property types
- Recognise when a complex type is harming readability and simplify it
Advanced Types interview questions
What does the infer keyword do?
Inside a conditional type, infer declares a type variable that TypeScript fills in by matching a pattern. For example, T extends Promise<infer U> ? U : T extracts the resolved type of a promise. It is how ReturnType and Awaited are implemented.
What is a mapped type?
A mapped type creates a new type by iterating over the keys of another with syntax like { [K in keyof T]: ... }. It can change modifiers or value types for each property. Partial and Readonly are mapped types in the standard library.
Where Advanced Types fits in the TypeScript roadmap
Advanced Types belongs to the Reusable Types stage (intermediate level), which takes about 17 hours. Write flexible code.
Other units in this stage
Back to the full TypeScript roadmap