Skip to main content

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

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.

Back to the full TypeScript roadmap