TypeScript Cheatsheet
A practical reference for TypeScript's type system from basics to advanced patterns. Each section includes runnable examples, common variants, typical mistakes to avoid, and AI prompts to explore further.
How to Use This Cheatsheet#
- Quick lookup: Use the sidebar to jump to any topic of interest
- Learn concepts: Each card has multiple tabs — explore Examples, Variants, and Mistakes
- Practice: Copy examples into the playground on the right to experiment
- Go deeper: Use the AI prompts in each card to ask follow-up questions
Suggested Path#
If you're new to TypeScript, work through topics in order: Type Basics → Objects & Interfaces → Functions → Union & Intersection Types → Generics. For intermediate developers, jump directly to Utility Types, Advanced Types, or Async Programming.
What's Covered#
| Fundamentals | Core Concepts | Advanced |
|---|---|---|
| Getting Started | Union & Intersection Types | Utility Types |
| Type Basics | Type Narrowing | Advanced Types |
| Arrays & Tuples | Generics | Type Assertions |
| Objects & Interfaces | Classes | Modules & Type Imports |
| Functions | Enums | Async Programming |