Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Cheat sheet · Foundations

TypeScript cheat sheet

Opens with credits

A working reference for developers who already write JavaScript and want TypeScript to catch real bugs, not just add annotations. It moves from everyday types through narrowing and generics to type-level tools, configuration and the boundary with untyped data.

Curated by Tauseef Fayyaz9 chapters60 concepts88 glossary terms

Chapters

9 chapters · 60 concepts

  1. 1Types and the compilerWhat TypeScript is, what the compiler does with your code and the handful of types everything else is built from.7 concepts
  2. 2Inference and assignabilityHow TypeScript works out types you did not write, and the rules that decide whether one type fits where another is expected.7 concepts
  3. Unions and narrowingUnions describe values that can be one of several types; narrowing is how the compiler follows your checks to know which one you have.7 conceptsOpens with credits
  4. GenericsGenerics are type parameters: they let one function or type work over many types while keeping the link between input and output.6 conceptsOpens with credits
  5. Built-in utility typesGeneric types shipped with TypeScript that transform other types. Learn these before writing your own type-level code.6 conceptsOpens with credits
  6. Type-level toolsThe operators behind the utility types. They let you compute new types from existing ones, so one source of truth drives the rest.8 conceptsOpens with credits
  7. Interfaces, classes and enumsHow TypeScript describes object-oriented code, and the few features that are TypeScript syntax with a runtime cost.6 conceptsOpens with credits
  8. Modules, tsconfig and strictnessHow TypeScript files import each other, how the compiler is configured and which flags are worth turning on in every project.7 conceptsOpens with credits
  9. JavaScript libraries and runtime dataWhere the type system meets code and data it cannot see: untyped packages, declaration files and values that arrive at runtime.6 conceptsOpens with credits
  10. 10Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.88 terms

About this sheet

Types, inference, narrowing, generics, type-level tools and strict configuration for real TypeScript codebases.

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com