TypeScript

From basic types to advanced generics and utility types.

Beginner

  1. What is TypeScript?: JavaScript with an extra layer that checks the *shape* of your data before your code ever runs.
  2. Basic Types: The built-in labels TypeScript uses for strings, numbers, booleans, arrays and fixed-shape lists.
  3. Interfaces: A named description of the properties an object must have and the type of each.
  4. Type Aliases: Give any type, not just an object shape, a reusable name.
  5. Functions with Types: Annotate a function's parameters and return value so TypeScript can check every call.

Intermediate

  1. Union & Intersection Types: Combine types with `|` for "one of these" and with `&` for "all of these, merged."
  2. Generics: Write a function or type once so it works with any type, while keeping that type checked.
  3. Enums: A named set of related constants under one type, so you refer to them by name instead of a raw value.
  4. Type Narrowing: How TypeScript works out which branch of a union you're holding at each point in the code.
  5. Utility Types: Built-in generic types that turn an existing type into a new one, so you don't redefine similar shapes by hand.
  6. Classes & Access Modifiers: Mark class properties and methods `public`, `private` or `protected` to control what outside code can touch.

Advanced

  1. Mapped Types: Build a new type by looping over every property of an existing type and transforming each one the same way.
  2. Conditional Types: A type that resolves to one of two types, chosen by a check done at compile time.
  3. Declaration Files (.d.ts): A file that describes the shape of existing JavaScript code, with no implementation, so TypeScript can check code that uses it.
  4. tsconfig & Strict Mode: The file that configures the TypeScript compiler, and the one setting that turns on its strongest safety checks.