LEVEL 6 · TYPESCRIPT
Course Advanced
Advanced TypeScript
The type system in depth: type operators, utility, mapped, conditional and template literal types, inference, variance and branded types, then type-safe events, CQRS and dependency injection, decorators, declaration files, packages, monorepos, type-level tests and compiler performance.
0 of 22 lessons done
When you finish, you can
- Derive types from values and other types with keyof, typeof and indexed access
- Write mapped, conditional and template literal types, using infer
- Choose between as, satisfies and as const
- Model a domain with branded types and discriminated unions
- Build type-safe event, command and dependency injection infrastructure
- Write declaration files and publish a typed package
- Test types, and keep a large project fast to compile
You build: A typed event bus, a typed dependency injection container and a typed command bus
MODULE 1
Type operators
- 1Type operatorsDerive types from values and from other types with keyof, typeof and indexed access, learn their edge cases, and build an order workflow from one table.50 min
- 2Utility typesUse and rebuild TypeScript's utility types, from Partial, Pick and Omit to Exclude, ReturnType, Awaited and ThisType, and learn where each one bites.55 min
- 3Mapped typesLoop over keys at the type level: change modifiers, remap keys with as, filter and recurse into nested objects, then build a type-safe config system.55 min
- 4Conditional typesWrite types that choose a result from their input with extends, infer and recursion, control distribution over unions, and build a retrying payments client.55 min
- 5Template literal typesBuild and take apart string types with template literal types, Uppercase and infer, then type routes, permissions and a compile-time safe event name system.50 min
- 6Advanced inferenceLearn how TypeScript infers type arguments, contextual types and return types, use const type parameters, and choose satisfies, as or as const.55 min
MODULE 2
Functions and design styles
- 7Advanced functionsType overloads, call and construct signatures, this parameters, callable objects and variadic tuples, then build a type-safe command router.55 min
- 8Object-oriented TypeScriptUse encapsulation, abstraction, inheritance, polymorphism, composition and dependency inversion, then compare OOP and functional designs honestly.60 min
- 9Functional TypeScriptMake signatures tell the truth with readonly data, typed composition, Option, Result and algebraic data types, then build a typed pricing and checkout core.55 min
MODULE 3
The type system in depth
- 10The type system in depthLearn when one type fits another: structural typing, excess property checks, variance with in and out, computed types, and when a clever type costs too much.60 min
- 11Branded typesStop swapped ids and naira-for-kobo bugs at compile time with branded types, validating smart constructors, money units and the ids in @zudojs/constants.50 min
- 12Type-safe domain modellingModel a shop's users, roles, products, orders, payments, events and ledger so illegal states cannot be written: no double payment, no refund before capture.60 min
MODULE 4
Type-safe infrastructure
- 13A type-safe event systemBuild an event bus where emit("order.placed", payload) only accepts the right payload: typed listeners, unsubscribe, wildcards and their limits.55 min
- 14Type-safe CQRSBuild a command bus and a query bus whose requests, handlers and results are checked from one spec, so a missing handler or a wrong result will not compile.55 min
- 15A type-safe dependency injection containerBuild a DI container with typed tokens, factories and singleton, scoped and transient lifetimes, and learn exactly which wiring errors types cannot catch.55 min
- 16DecoratorsWrite TC39 standard decorators for classes, methods, fields and accessors, see the JavaScript tsc emits, and compare them with experimentalDecorators.60 min
MODULE 5
Libraries and large projects
- 17Declaration filesType an untyped JavaScript naira formatter with a .d.ts file, declare modules and globals, augment interfaces, install @types and generate declarations.55 min
- 18Publishing TypeScript packagesBuild a TypeScript library into JavaScript plus declarations, write package.json exports, check the tarball, handle ESM and CommonJS, and version types.55 min
- 19TypeScript monoreposSplit a shop backend into core, logger, database, auth and http packages, link with workspaces, build with project references, enforce dependency direction.60 min
- 20Testing TypeScriptTest TypeScript code with Vitest, including generics, error paths and typed mocks, then test types themselves with expectTypeOf and vitest --typecheck.55 min
- 21Debugging TypeScriptRead long type errors from the bottom up, make the compiler show inferred types, fix generic inference and module resolution, and tell type from runtime bugs.50 min
- 22Compiler performanceMeasure what tsc spends its work on with --extendedDiagnostics, then keep a large project fast with skipLibCheck, incremental builds and bounded types.50 min
Course checkpoint
Prove you can move on. The checkpoint picks 20 questions at random from every lesson in this course. Get 16 right to pass. Your result is saved in this browser only.