01Chapter 1: Union types: a value that is one of several typesA union type describes a value that may belong to one of several types. TypeScript writes a union with the vertical bar (|). For example, string | number means “a string or a number.”2 min read
02Chapter 2: Literal unions for a fixed set of valuesAssume you know basic TypeScript syntax, type annotations, object types, type aliases, and function parameter and return types. This chapter uses those ideas to model values that must come from a small, known set.2 min read
04Chapter 4: Narrowing a union with typeof, in, and equality checksAssume you know basic TypeScript syntax, type annotations, object types, type aliases, and function parameter and return types. This chapter focuses on the working model for narrowing unions and the mistakes that commonly prevent safe access to union members.2 min read
05Chapter 5: Discriminated unions with a shared tag propertyAssume you know basic TypeScript type aliases, object types, and typed function parameters. This chapter uses a discriminated union to model values that have different shapes but share one identifying property.2 min read
06Chapter 6: Exhaustiveness checking with neverAssume you know basic TypeScript unions, object types, functions, and discriminated unions. This chapter focuses on proving that code handles every member of a union.2 min read
07Chapter 7: Intersection types: a value that satisfies several typesAssume you know basic TypeScript syntax, type aliases, object types, and function annotations. This chapter uses those features to explain how the intersection operator (&) combines requirements.2 min read
08Chapter 8: Conflicting members and intersections that become neverAssume you know basic TypeScript type aliases, object types, unions, intersections, and function annotations. This chapter focuses on what happens when an intersection asks one value to satisfy incompatible requirements.2 min read
09Chapter 9: Intersections or interface extendsAssume you know basic TypeScript type aliases, interfaces, object types, and function annotations. This chapter compares two ways to build a larger object type from smaller object types: intersection types with &, and interface inheritance with extends.2 min read
10Chapter 10: How intersections distribute over unionsThis chapter assumes you know basic TypeScript syntax, type aliases, object types, and function types. You should also understand that TypeScript checks the shape of a value rather than its class name.2 min read
11Chapter 11: Distributive conditional types and how to turn distribution offThis chapter assumes you know type aliases, unions, intersections, generic type parameters, and basic conditional types. A conditional type chooses one type or another by checking whether one type extends another.2 min read
12Chapter 12: Unions and intersections of function typesAssume you know basic TypeScript type aliases, function types, and union and intersection types. This chapter focuses on what happens when the types being combined are functions. The rules differ from object types, so function unions and intersections often cause surprising errors.2 min read