TypeScript
roadmap.sh: https://roadmap.sh/typescript
Suggested path through the TypeScript nodes. Each node links to its lesson when written.
Nodes
Introduction
- What is TypeScript
- TypeScript vs JavaScript
- TS / JS interoperability
- Installing TypeScript (tsc, ts-node)
TypeScript Setup
- tsconfig.json
- Compiler options & strict mode
- Running the TypeScript compiler
TypeScript Types
- Primitive types (string, number, boolean)
- Object types
- Arrays
- Tuples
- Enums
- any
- unknown
- never
- void
- null & undefined
Type Inference
- Inference basics
- Contextual typing
- const assertions
Type Compatibility
- Structural typing
- Type widening & narrowing
Combining Types
- Union types
- Intersection types
- Type aliases
- Type guards / narrowing
- keyof operator
- typeof operator
- Indexed access types
- Conditional types
- Literal types
- Template literal types
Functions
- Typing function parameters & return values
- Optional & default parameters
- Rest parameters
- Function overloads
- this parameter
Interfaces
- Defining interfaces
- Extending interfaces
- Interfaces vs type aliases
- Index signatures
Classes
- Class members & constructors
- Access modifiers (public, private, protected)
- readonly
- Inheritance & implements
- Abstract classes
- Parameter properties
- Getters & setters
Generics
- Generic functions
- Generic classes & interfaces
- Generic constraints
- Default type parameters
Decorators
- Class decorators
- Method & property decorators
- Decorator metadata
Utility Types
- Partial & Required
- Readonly
- Pick & Omit
- Record
- Exclude & Extract
- ReturnType & Parameters
- Awaited
- NonNullable
Advanced Types
- Mapped types
- Recursive types
- Discriminated unions
- satisfies operator
Modules
- ES Modules
- Namespaces
- Module resolution
- Declaration files (.d.ts)
- DefinitelyTyped (@types)
Ecosystem & Tooling
- ESLint with TypeScript
- Prettier
- Type-aware bundlers (tsup, esbuild, swc)
- Migrating a JS project to TS
Resources
See resources.md.
Project ideas
- Convert an existing small JavaScript library to strict-mode TypeScript and publish typings.
- Build a fully-typed REST API client using generics and discriminated unions for responses.
- Implement a type-safe form validation utility using mapped and conditional types.