9 parts · 18 chapters

TypeScript at Staff Level

TypeScript's types are a second language that runs at compile time over the first: it has values (types), operations (unions, intersections, conditionals, mapped types), functions (generics), recursion, and a runtime (the checker) with its own performance characteristics. Most engineers use it as annotations; a staff engineer uses it as a language, to make the compiler reject the states the product must never be in, and knows what the checker is doing when a build takes a minute.

Nine parts: the type system as a lattice with assignability as its ordering; inference and narrowing as control-flow analysis; generics and variance and how parameters are checked; conditional, mapped and template types with their limits; declaration merging and the module systems; the compiler's scanner, parser, binder, checker and emitter with the performance levers; typing a library versus an app; domain modelling with branded types, discriminated unions and parsing instead of validating; and the tooling that holds it together.

the type system as a language · the compiler · domain modellingsenior → staff · engineers who want the compiler to enforce the domain
the latticeStructural typing, assignability as an ordering, unknown at the top and never at the bottom, where any breaks the lattice.
narrowingControl-flow analysis, guards, predicates, assertion functions, discriminants, satisfies, and what the checker cannot see.
generics and varianceConstraints and defaults, covariance and contravariance, method versus property bivariance, and inference from arguments.
type-level programmingConditional types and distribution, infer, mapped types with key remapping, template literals, recursion and the depth limits.
modules and declarationsInterfaces and merging, namespaces, ambient declarations, .d.ts authoring and publishing for libraries.
the compilerScanner, parser, binder, checker, emitter; why a check is slow; incremental, project references, isolatedModules.
library versus appA public surface with overloads, branded types, discriminated unions, Result types, exhaustive checks.
domain modellingIllegal states unrepresentable, money types, state machines in types, parse at the boundary.
Paired with the JS courseThe JS course covered the engine that runs the emitted code. This course covers the language that runs before it: what the checker computes, what it cannot, and how to make it work for the product rather than against the deadline.