Skip to content

TypeScript topic hubs

Each hub explains one family of TypeScript features: the problem they solve, the version that introduced each one, a sample compiled with TypeScript 7.0.2 for every feature, the compiler errors you will meet, the pitfalls, and how to choose between related features. Together the hubs cover every TypeScript feature on this site. If you are new to TypeScript, work through the four TypeScript basics tutorials first; the hubs assume you can already type variables, functions, objects and classes.

TypeScript features that are really JavaScript features, such as classes, async functions, modules, optional chaining and spread, are explained once in the JavaScript section. The hubs link there and cover only what TypeScript adds.

Read the hubs in this order. The first three are about everyday type modeling; the later ones build on them or matter mainly in libraries, large codebases and project setup.

  1. Core type system: interfaces, union and intersection types, tuples, index signatures and as const: the building blocks for describing data.
  2. Type narrowing: strictNullChecks, type guards, discriminated unions with exhaustiveness checks, and when as, ! and satisfies are safe.
  3. Generics and functions: generic functions and classes, constraints and defaults, overloads, and typing async code.
  4. Classes and decorators: what TypeScript adds to JavaScript classes: access modifiers, abstract classes, override, this parameters and standard decorators.
  5. Advanced types: deriving types from types with keyof, typeof, indexed access, conditional types, mapped types and template literal types.
  6. Utility types: the built-in helpers such as Partial, Omit, Record, Exclude, NonNullable and ReturnType, with their definitions.
  7. Declarations and modules: .d.ts files and @types, declaration merging, module augmentation and namespaces.
  8. Tooling and project structure: strict options, module settings, type stripping, project references and the move to TypeScript 7.