Type-level Programming ƒun in TypeScript
summary
Type-level programming in TypeScript shows how to turn URL strings into exact response types and make fetch return Promise<CorrectType> instead of any, using string literal unions, keyof and indexed access types, conditional types and generic type aliases. Examples include a typed fetch mapping URLs to response types, a type-level finite state machine that yields editor autocomplete, boolean-logic gates and Peano-style type numerals with recursive type-level loops. Everything emits zero JavaScript, it improves compile-time errors and IDE suggestions, but it remains brittle across TypeScript version changes.
AI-written summary · about
chapters (7)
- 0:00The role of types
- 3:57Compilation vs. runtime
- 7:18Refining type safety
- 11:53Introduction to type-level
- 17:12Advanced type mapping
- 25:26Type-level state machines
- 29:52Logic and recursion at types
related talks
01h 05mBusy TypeScript Developer’s Guide to Advanced TypeScript
24mTypeScript for JavaScripties
31mTypeScript for JavaScripties
01h 01mDeconstructing TypeScript’s Type System
35mTypeScript Gymnastics: Why Are They So Powerful for You?
52mTypescript Deep Dive
44mA Deep Dive Into Advanced TypeScript - A Live Coding Expedition
51mTypeScript - Beyond the Basics
