Guide Book

Guide Book

A reference you can read front to back or dip into. Every chapter explains the syntax, and most topics have a πŸ” Behind the scenes section you can open to see what Python is actually doing, the details classes usually skip. Look for 🧭 Scenario cards for real-world uses, and press Try it on any example, then open the Inspect tab to look inside.

  1. Chapter 1How TypeScript runs your codeTypeScript is a checker bolted onto a translator β€” and every type you write is deleted before anything runs.
  2. Chapter 2Structural typing & assignabilityTypeScript compares shapes, not names β€” plus the top and bottom types, excess property checks, and when the rules are deliberately unsound.
  3. Chapter 3Primitives, literals & unionsThe seven primitives, how literal types are born and widened, and why a union is only as useful as the way you narrow it.
  4. Chapter 4Objects, interfaces & type aliasesOptional and readonly members, index signatures, when to reach for `interface` over `type`, and how declaration merging works.
  5. Chapter 5Narrowing & control-flow analysisHow the compiler follows your `if`s to work out what a value is β€” every narrowing tool, and the places the analysis gives up.
  6. Chapter 6FunctionsParameter and return typing, optional and rest parameters, overloads, `this`, and how contextual typing saves you from annotating callbacks.
  7. Chapter 7GenericsType parameters, constraints, inference, defaults β€” and the rule for when a generic is actually earning its complexity.
  8. Chapter 8Type-level programming`keyof`, `typeof`, indexed access, mapped types, conditional types, `infer` and template literal types β€” the language inside the language.
  9. Chapter 9ClassesFields, the four visibility levels, `implements` versus `extends`, abstract classes, and why `private` is not private at run time.
  10. Chapter 10Modules & declaration filesWhat makes a file a module, type-only imports, how `.d.ts` files describe untyped JavaScript, and why module resolution goes wrong.
  11. Chapter 11tsconfig & strictnessWhat `strict` actually turns on, the flags worth adding beyond it, and how `target`, `lib` and `module` decide what your code becomes.
  12. Chapter 12Escape hatches & JavaScript interop`any`, assertions, non-null `!`, `satisfies` and branded types β€” when each is the right tool, and how to keep the unsafe part small.
main.ts
Loading editor…
No output yet
Press Run or βŒ˜β†΅ to compile and run your code.

Search

Jump to a lesson or a past run