Advanced TypeScript

55‑70 hours · 18 modules · 72 lessons · Project: Typed toolkit

Part A · Type-level mastery

M1 · 5 lessonsHow the Type System Works
  1. 1.1Structural typing and assignability
  2. 1.2Top and bottom types: unknown and never
  3. 1.3Widening, literal freshness, and the limits of control-flow analysis
  4. 1.4Variance: covariance, contravariance, and in / out annotations
  5. 1.5Where TypeScript is unsound, and why
  6. Project stepStart the toolkit: sketch its public types and predict which assignments must fail.
M2 · 3 lessonsTesting and Debugging Types
  1. 2.1@ts-expect-error as a test
  2. 2.2Writing your own Equal and Expect helpers
  3. 2.3Debugging complex types: hover tricks and Prettify
  4. Project stepSet up type tests with Equal and Expect; every later feature ships with them.
M3 · 4 lessonsConditional Types
  1. 3.1Conditional type syntax
  2. 3.2Distributive conditional types
  3. 3.3infer: extracting types
  4. 3.4Filtering and transforming unions
  5. Project stepAdd Infer<Schema>, which extracts the value type from a schema.
M4 · 3 lessonsMapped Types
  1. 4.1Homomorphic mapped types
  2. 4.2+ / - modifiers
  3. 4.3Key remapping with as
  4. Project stepTurn object schemas into types with optional and read-only fields.
M5 · 3 lessonsTemplate Literal Types
  1. 5.1Template literal type syntax
  2. 5.2Uppercase, Capitalize, and other intrinsic string types
  3. 5.3Extracting parts of strings: from "/users/:id" to { id: string }
  4. Project stepAdd a typed route helper that extracts params from "/users/:id".
M6 · 4 lessonsRecursive Types
  1. 6.1Recursive type aliases: JSON and trees
  2. 6.2DeepPartial and DeepReadonly
  3. 6.3Path types ("user.address.city")
  4. 6.4Recursion depth limits
  5. Project stepSupport nested schemas and deep paths like "user.address.city".
M7 · 4 lessonsBuilding Your Own Type Utilities
  1. 7.1Pick, Omit, and ReturnType from scratch
  2. 7.2UnionToIntersection, IsEqual, and IsAny
  3. 7.3Readable type errors for the people who use your types
  4. 7.4OptionalPractice set: type-level challenges
  5. Project stepWrite the toolkit's own helpers and give common misuse a readable error.
M8 · 6 lessonsAdvanced Generics
  1. 8.1How inference picks T
  2. 8.2const type parameters
  3. 8.3NoInfer and controlling inference sites
  4. 8.4Variadic tuple types: typing functions like pipe and concat
  5. 8.5Higher-order generic functions
  6. 8.6OptionalEmulating higher-kinded types
  7. Project stepMake the API keep literal types with const parameters and NoInfer.
M9 · 6 lessonsPopular Libraries, Step Three: Reading Their Types
  1. 9.1How to read a .d.ts file you didn't write
  2. 9.2Case study: how TypeScript types its own standard library (Array.map, Object.entries, Promise.all)
  3. 9.3type-fest: ready-made utility types, compared with the ones you wrote
  4. 9.4Inside zod: how z.infer turns a schema into a type
  5. 9.5Inside a query builder (Drizzle or Kysely): result types inferred from queries
  6. 9.6Inside tRPC: sharing types between server and client without code generation
  7. Project stepCompare your schema design with Zod's and record three decisions you would change.
M10 · 4 lessonsType-Safe API Design
  1. 10.1Builder and fluent APIs, and the polymorphic this type
  2. 10.2A type-safe event emitter
  3. 10.3Type-level state machines
  4. 10.4The cost of cleverness: when type-level magic hurts
  5. Project stepAdd a fluent schema builder and a typed event emitter for validation events.
M11 · 4 lessonsExtension and Metaprogramming
  1. 11.1Declaration merging
  2. 11.2Module augmentation
  3. 11.3Decorators (TC39 standard), and why they need a build step today
  4. 11.4using and explicit resource management
  5. Project stepLet users register custom validators through declaration merging.

Part B · TypeScript at scale

M12 · 4 lessonsArchitecture with Types
  1. 12.1Module boundaries: designing a module's public types
  2. 12.2Dependency injection with plain functions and interfaces
  3. 12.3Extensible registries: letting users add types to your library (the Register interface pattern)
  4. 12.4Typed errors across layers: domain, application, and transport
  5. Project stepSplit the toolkit into a core and plugins with clear public types.
M13 · 3 lessonsTypes from Outside
  1. 13.1Generating types from OpenAPI and JSON Schema
  2. 13.2Types from database schemas
  3. 13.3Keeping generated and hand-written types in sync
  4. Project stepGenerate schemas from an OpenAPI description and keep them in sync.
M14 · 5 lessonsSharing Types
  1. 14.1Declaration files: generating them and writing them by hand
  2. 14.2How TypeScript finds a package's types (types, exports)
  3. 14.3isolatedDeclarations
  4. 14.4Semantic versioning for types: what counts as a breaking change
  5. 14.5Supporting several TypeScript versions
  6. Project stepEmit declaration files, set up exports, and write a compatibility policy.
M15 · 4 lessonsType-Checker Performance
  1. 15.1How the checker spends its time: instantiation, caching, and depth limits
  2. 15.2Measuring with --extendedDiagnostics and --generateTrace
  3. 15.3Faster patterns: interfaces over intersections, annotated return types, smaller unions
  4. 15.4Performance budgets in CI
  5. Project stepMeasure the toolkit's type-check cost and fix its slowest type.
M16 · 4 lessonsLarge Codebases
  1. 16.1Project references and monorepos
  2. 16.2Incremental adoption: moving a loose codebase to strict, file by file
  3. 16.3Measuring type coverage and tracking any
  4. 16.4OptionalCodemods: changing thousands of files safely
  5. Project stepTurn the repo into a monorepo with project references for the core and plugins.
M17 · 4 lessonsLeading TypeScript in a Team
  1. 17.1A shared tsconfig.json strategy
  2. 17.2Type-safety lint rules worth enforcing
  3. 17.3Review standards and an any budget
  4. 17.4Upgrading TypeScript across a codebase: the 6.0 to 7.0 move as a case study
  5. Project stepWrite the toolkit's contributor guide: shared config, lint rules, and a review checklist.
M18 · 2 lessonsFinal Project
  1. 18.1Option A: publish the toolkit with type tests, declaration files, and a compatibility policy
  2. 18.2Option B: migrate a real open-source project to strict TypeScript and write up the results
  3. Project stepChoose your finale: publish the toolkit, or migrate an open-source project and publish a write-up.
  4. TipBonus lesson A.10 shows how to publish a package to npm.
Curriculum v6 · September 2026Tested with TypeScript 7.x · Node.js LTS