Flagship
ts
TypeScript
The type system, generics and migrating real codebases
15 topics 5 sections TypeScript 6 beginner → advanced
All beginner intermediate advanced
show All Unread Read
01 · Basics
1 topic02 · Type system
7 topics Enums Enums bring named constants into both the type system and runtime; learn their output, validation boundaries, and alternatives. intermediate 17 min Literal types Model closed states with exact values, and understand widening, as const, satisfies, discriminated unions, and runtime validation. intermediate 16 min satisfies operator Check that expressions meet TypeScript contracts without discarding useful inference, and avoid mistaking the check for runtime validation. intermediate 17 min Type guards Narrow unions and unknown values with runtime evidence, then write trustworthy custom predicates and assertion functions. intermediate 17 min Type inference Understand how TypeScript infers types from initializers, context, and generic arguments, and where explicit contracts keep that inference honest. intermediate 18 min Type narrowing How TypeScript narrows unions and unknown through control flow, with exhaustive branches, honest predicates, and stable local bindings. intermediate 15 min Union and intersection types Model alternatives with unions, combine constraints with intersections, and keep compositions safe through narrowing, discriminants, and never checks. intermediate 15 min
03 · Generics and advanced types
4 topics Advanced types Compose conditional, mapped, indexed-access, template-literal, and recursive types without confusing compile-time guarantees with runtime checks. advanced 14 min Branded types Distinguish structurally identical values and connect runtime validation, assertions, and trust boundaries in an auditable contract. advanced 15 min Generics Use type parameters to preserve relationships across inputs, outputs, and containers without claiming more than runtime code proves. intermediate 14 min Utility types Derive contracts with Partial, Pick, Omit, Record, and function utilities without confusing shallow types for runtime behavior. intermediate 16 min
04 · Config and migration
3 topics Declaration files Declaration files give existing JavaScript APIs static types; learn module boundaries, resolution, declaration emit, and tests that keep types honest. intermediate 14 min Strict mode Strict mode exposes unsafe assumptions about nulls, callbacks, class fields, iterators, and untyped code before JavaScript runs. intermediate 13 min Type coverage Type coverage measures identifiers that escape to any; learn its limits, strict counting, boundary validation, and stable CI gates. intermediate 13 min