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.
- Chapter 1How TypeScript runs your codeTypeScript is a checker bolted onto a translator β and every type you write is deleted before anything runs.
- Chapter 2Structural typing & assignabilityTypeScript compares shapes, not names β plus the top and bottom types, excess property checks, and when the rules are deliberately unsound.
- 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.
- Chapter 4Objects, interfaces & type aliasesOptional and readonly members, index signatures, when to reach for `interface` over `type`, and how declaration merging works.
- 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.
- Chapter 6FunctionsParameter and return typing, optional and rest parameters, overloads, `this`, and how contextual typing saves you from annotating callbacks.
- Chapter 7GenericsType parameters, constraints, inference, defaults β and the rule for when a generic is actually earning its complexity.
- Chapter 8Type-level programming`keyof`, `typeof`, indexed access, mapped types, conditional types, `infer` and template literal types β the language inside the language.
- Chapter 9ClassesFields, the four visibility levels, `implements` versus `extends`, abstract classes, and why `private` is not private at run time.
- 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.
- Chapter 11tsconfig & strictnessWhat `strict` actually turns on, the flags worth adding beyond it, and how `target`, `lib` and `module` decide what your code becomes.
- 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.