Lessons
Conditional types and infer
T extends U ? X : Y, the infer keyword, distributive behaviour, and built-in conditional utility types.
Prerequisite: Practitioner track complete
What to look for:
- Conditional types vs generic constraints — same syntax, different meaning
- infer R inside a conditional — extracting a type
- Awaited
and ReturnType are conditional types - Distributive: Union becomes Union | Union
Mapped types and template literal types
[K in keyof T], re-mapping keys with as, adding/removing modifiers with + and -, template literal string types.
Prerequisite: Lesson 1 of Advanced
What to look for:
- Mapped type = transform every property
- + and - to add/remove readonly and optional
- Key remapping with as: rename property keys
- Template literal: `on${Capitalize
}`
satisfies, as const, and const type parameters
The satisfies operator, as const for literal inference, and const type parameters (TS 5.0).
Prerequisite: Lesson 2 of Advanced
What to look for:
- satisfies: validate shape without widening
- as const: string becomes "north" not string
- Direction const object as enum alternative
- const T in function
: precise literal inference
Module augmentation and global types
declare module, declare global, ambient declarations, and adding properties to third-party library types.
Prerequisite: Lesson 3 of Advanced
What to look for:
- The Express Request augmentation pattern — you will use this in every Node app
- declare global for adding to Window or globalThis
- Ambient declarations: declare const: never overrides actual values
- When to use .d.ts files vs inline declarations
Variance and the limits of the type system
Covariance, contravariance, bivariance, intentional unsoundness, and known holes in TypeScript's type system.
Prerequisite: Lessons 1-4 of Advanced
What to look for:
- The Deep Dive tab — TypeScript soundness and unsoundness
- Covariant: readable positions (output)
- Contravariant: writable positions (input)
- as T assertions are a hole in the type system — use them sparingly
How to use this track: Each lesson links to the Codex reference page. Use reading level tabs. Check "What to look for". Come back here for the quiz.
Track quiz
4 questions on the Advanced track.
What does infer do in a conditional type?
What does [K in keyof T]: T[K] do?
What is the difference between satisfies and as?
Why is TypeScript intentionally unsound?