Skip to content

Course

Advanced TypeScript Types

TypeScript's type system as a design tool — generics, conditional types, mapped types, template literals, variance, and interfaces that make broken states impossible to represent.

9 lessons

Course Q&A

Reviews

Enrolled members can rate this course.

No reviews yet.

Types as Design

Generics, inference, and constraints — the model that turns types from decoration into architecture.

  1. 01Generics Are Type Parameters, Not Syntax NoiseThe mental model behind generics: types as inputs and outputs, inference as a solver, and why good generic APIs disappear at the call site.22mOpen
  2. 02Constraints and Inference: Let the Compiler Do the WorkHow extends narrows type parameters, why inference breaks at object boundaries, and the patterns that keep precise types without making call sites miserable.24mOpen
  3. 03Type-Safe Boundaries: APIs, Events, and StorageUsing generics and discriminated unions at system boundaries so malformed payloads, mismatched event names, and stale stored data fail early and loudly.25mOpen

Type-Level Programming

Conditional types, infer, mapped types, and template literals for precise domain models.

  1. 01Conditional Types and infer: Pattern Matching at the Type LevelHow conditional types distribute over unions, what infer really binds, and where type-level branching is worth the complexity.24mOpen
  2. 02Mapped Types: Transforming Shapes Without Copy-PasteKey remapping, modifiers, and selective transformation — the machinery behind Pick, Omit, Partial, and precise domain-specific object types.23mOpen
  3. 03Template Literal Types: Make Strings Carry MeaningUsing literal string patterns for routes, CSS units, event names, and command vocabularies — with honest limits around runtime validation.21mOpen

Sound Systems

Variance, exhaustiveness, branded types, and API design that prevents production bugs.

  1. 01Variance: Why Types That Look Compatible Sometimes Are NotCovariance, contravariance, invariance, and TypeScript's pragmatic unsoundness — explained through the bugs variance prevents and the ones it permits.26mOpen
  2. 02Make Illegal States UnrepresentableDiscriminated unions, exhaustive checks, mutually exclusive fields, and state machines encoded so invalid transitions become compile errors.25mOpen
  3. 03Branded Types and API Design That Prevents BugsOpaque IDs, validated strings, careful escape hatches, and library API types that guide users toward correct usage without constant annotations.27mOpen