Advanced TypeScript
The type system as a programmable language. Conditional and mapped types, template literals, inference, variance, declaration files, library authoring, branded types, the compiler API, type-checking performance, and knowing when a clever type has become a liability.
Start courseWhat you will cover
- Conditional TypesTypes that branch on other types: the extends check, distribution over unions and how to stop it, and the recursion that makes them genuinely powerful.35 min
- Mapped Types and Key RemappingTransforming every property of a type at once: modifiers, adding and removing optionality, and remapping keys with as to build derived shapes.35 min
- Template Literal TypesTypes built from string patterns: parsing and constructing strings at the type level, and the APIs this makes safe that were previously just documented.35 min
- Inference Deep DiveHow the compiler decides a type: infer, contextual typing, inference sites and priority, widening and literal types, and diagnosing why inference produced something too wide.35 min
- Variance, Assignability, and Structural TypingWhat makes one type assignable to another, co- and contravariance in function types, method bivariance and the unsoundness it permits.35 min
- Function Overloads and Call SignaturesDescribing a function with several legitimate shapes, ordering overloads so the right one wins, and when a union or generic beats overloading entirely.35 min
- Type-Level Programming and Its LimitsRecursion depth, instantiation limits and compile-time cost. What can be computed in types, what should be, and the error message a colleague will have to read.35 min
- Declaration Files and Ambient TypesWriting .d.ts by hand, declaring modules and globals, augmenting types you do not own, and keeping ambient declarations from leaking everywhere.35 min
- Authoring a Typed LibraryDesigning a public type surface, exports maps, shipping declarations for multiple module formats, and treating a type change as a breaking change when it is one.35 min
- Generics That ScaleTyping higher-order functions, preserving parameter types through wrappers, fluent builders that stay inferable, and generics that read well at the call site rather than the definition.35 min
- Branded and Nominal TypesMaking two structurally identical types incompatible on purpose — validated input, identifiers, units — and the ergonomics of constructing and unwrapping them.35 min
- The Compiler API and Custom ToolingReading your codebase as an AST: writing a codemod, a custom lint rule or a generator, and the maintenance cost of tooling that knows about your syntax.35 min
- Type Checking PerformanceWhy an editor becomes slow: measuring with compiler diagnostics, finding the type that costs seconds, and the rewrites that give the time back.35 min
- Decorators and MetadataThe standardised decorator model, what each decorator kind can do, metadata, and the narrow cases where a decorator beats a plain function call.35 min
- Assertion Functions and satisfiesasserts signatures that narrow for the rest of a scope, satisfies for checking without widening, and const type parameters that preserve literals.35 min
- Interop with Untyped CodeMigrating incrementally, containing any at a boundary, typing a legacy module from the outside, and measuring progress so a migration actually finishes.35 min