Skip to content

TypeScript Deep Dive

A standalone, intermediate→advanced course on TypeScript's type system, written for TypeScript 7 (the native compiler) and the 6.0 defaults. From structural typing and inference to generics, conditional & mapped types, template literals, recursive types, decorators, the compiler, and typing real APIs — every topic taught through annotated code that shows exactly what the compiler infers.

Foundations & Mental Model

Why TypeScript, types as sets of values, structural typing, and how inference really works. Start →

Everyday Types, Deep

Literals & widening, unions & intersections, objects/arrays/tuples, functions, and narrowing. Sharpen →

Generics

Type parameters, constraints, conditional types, and how inference and infer work. Generalize →

Type-Level Programming

Mapped types, template literal types, keyof & indexed access, the utility types, and recursion. Compute →

Classes & Advanced OOP

Fields & access, this types, stage-3 decorators, and mixins. Model →

The Compiler & Tooling

The TypeScript 6/7 defaults, the native compiler, module resolution, declaration files, and emit. Configure →

Practical Mastery

Typing APIs & boundaries, nullability & never, performance pitfalls, and migration strategy. Apply →

How the Checker Thinks

Assignability, inference, and control-flow analysis as real algorithms — plus erasure/emit and the checker’s performance model. Go deeper →

Reading & Reviewing TypeScript

A 24-pattern AI bug catalog, a review checklist, verification tools, and four worked reviews of real-looking code. Review →

Types as the star

This is a course about the type system, not JavaScript syntax. Examples are annotated to show exactly what the compiler infers and where it errors — the way you actually read TypeScript.

Mental models first

Every topic starts from a model — types as sets of values, structural compatibility, inference sites — so advanced features stop feeling like magic and start feeling inevitable.

Depth, not just usage

Not “here’s Partial<T>” but “here’s how Partial is built, and how to build your own.” You’ll read and write type-level code with confidence.

Diagrams that explain

Type widening, narrowing flow, conditional-type distribution, and module resolution as theme-aware Mermaid diagrams. Current as of TypeScript 7.0 (July 2026), with older behaviour labelled. Bilingual (English / ไทย) with saved quiz progress.