Course · self-paced

Reading TypeScript's Type Language

From “type-level code feels like magic” to reading any TypeScript type with confidence — generic inference, mapped / conditional / template-literal types, and the library-grade patterns behind useQuery, Zustand, and friends. 32 short lessons, each with a worked example and three recall quizzes.

Start here

New to the course? Begin with Lesson 01 — Reading the : and =>, then work down. Each lesson links to the next idea. Keep the matching module reference sheet open beside you — they’re built to print.

Module 0 — Reading TS syntax

cheat sheets: 0001 syntax decoder · 0002 annotations & assertions
  1. 1 0.1 Type position vs value position — the : / => decoder
  2. 2 0.2 Annotation vs inference vs definition
  3. 3 0.3 as vs satisfies vs annotation
  4. 4 0.4 Structural typing & excess-property checks
  5. 5 0.5 Call & construct signatures — the object-type form of a function

Module 1 — Core type vocabulary

cheat sheet: 0003 core vocabulary
  1. 6 1.1 type vs interface; object vs {} vs Object
  2. 7 1.2 Literal types, unions, and why not enum
  3. 8 1.3 keyof, typeof, keyof typeof, indexed access
  4. 9 1.4 Utility types: Partial / Record / Pick / Omit / Exclude / Extract
  5. 10 1.5 Tuples vs arrays
  6. 11 1.6 The never type — exhaustiveness + key-dropping
  7. 12 1.7 Union, intersection & variance — wider vs narrower types, and how substitution flows

Module 2 — Generics

cheat sheet: 0004 generics
  1. 13 2.1 Declaring generics; type parameter vs type variable
  2. 14 2.2 Constraints (extends), widening vs literals, as const
  3. 15 2.3 How TypeScript infers T
  4. 16 2.4 Multi-source inference & priority
  5. 17 2.5 Rest/tuple params — ...args: TArgs extends any[]

Module 3 — Type-level programming

cheat sheet: 0005 type-level programming
  1. 18 3.1 Mapped types + indexed access
  2. 19 3.2 Key remapping with as; template-literal keys
  3. 20 3.3 Conditional types & infer
  4. 21 3.4 Distributive conditional types
  5. 22 3.5 Template-literal types & recursion
  6. 23 3.6 Record → discriminated union

Module 4 — Library-grade patterns

cheat sheet: 0006 library patterns
  1. 24 4.1 Reading useQuery's nested generics
  2. 25 4.2 Builder pattern with phantom types
  3. 26 4.3 Branded / nominal types
  4. 27 4.4 React types: ReactNode vs ReactElement vs JSX.Element; ComponentProps
  5. 28 4.5 Zustand generic with type transformation
  6. 29 4.6 Capstone — “Types are the new RegEx”

Module 5 — Tooling & ecosystem

cheat sheet: 0007 tooling
  1. 30 5.1 declare & .d.ts declaration files
  2. 31 5.2 tsconfig: module vs moduleResolution
  3. 32 5.3 Where TS is going — TS 7.0 / Go port