How do you type a pipe() function that takes an infinite number of functions, where the output of function A must perfectly match the input of function B? Welcome to the final boss of TypeScript.
Learn how to build chainable APIs that accumulate type knowledge at every step. This Generic Accumulator pattern is the secret engine powering libraries like tRPC, Zod, and Prisma, providing unparalleled autocomplete.
TypeScript doesn’t care if two types have different names; if they share the same shape, they are equivalent. Learn how to use Branding and Flavoring to force the compiler to differentiate between an OrderID string and a UserID string, powering Domain-Driven Design.
Why is it safe to return a subclass instead of a superclass, but dangerous to accept a superclass parameter instead of a subclass? Welcome to Variance: the computer science underpinning of TypeScript’s assignability engine.
An advanced masterclass in TypeScript type-level metaprogramming. Master conditional types (T extends U ? X : Y), distributive behavior, infer keyword pattern matching for unwrapping types, template literal types (${T}_${U}), and deep recursive object transformations.
Use mapped types and generics to enforce finite state transitions in the compiler. A type-level state machine makes impossible states impossible to represent, eliminating entire classes of runtime bugs.
The built-in Partial and Readonly utilities are shallow. Learn how to write your own DeepReadonly and DeepPartial utilities that penetrate every layer of nested objects by combining Generics, Conditionals, infer, Mapped Types, and Recursion simultaneously.
How do you type a JSON object? A JSON object can contain arrays of objects, which can contain arrays of objects, infinitely down. You cannot hardcode this depth. You need a Recursive Type.
TypeScript provides four built-in Intrinsic utilities that manipulate the casing of string literal types at compile time. Learn how to pair them with template literals and mapped types to dynamically generate robust event handler mappings.
Template literal types allow you to use JavaScript-style template strings (${...}) inside Type Space. Learn how to generate combinations of string literals automatically via Union Permutation, and parse delimited strings (like emails or URLs) using the infer keyword.