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#

FundamentalsCore ConceptsAdvanced
Getting StartedUnion & Intersection TypesUtility Types
Type BasicsType NarrowingAdvanced Types
Arrays & TuplesGenericsType Assertions
Objects & InterfacesClassesModules & Type Imports
FunctionsEnumsAsync Programming