01
Type System Fundamentals
The guarantee the static type layer provides, basic types, escape hatches, type inference, union and intersection types, and const types.
- 01 The Purpose of TypeScript The error class the static type layer catches, the erasure of types at compile time, and the distinction between type checking and runtime validation.
- 02 Basic Types The first typed version of the measurement record, using primitive types, array and readonly array notations, tuples, enums, and object types.
- 03 any, unknown, and never The assignability rules and use sites of any, which turns off checking, unknown, which forces it, and never, which has no values.
- 04 Type Inference The compiler's rules for inferring types from an initial value, context, and return expressions; widening behavior and where a type annotation is still required.
- 05 Union and Intersection Types The shared-member rule in a union type, the discriminated union pattern, combining types with intersection, and the collapse of conflicting fields to the empty type.
- 06 Const Types and as const Single-value literal types, stopping widening with as const, deriving a union type from a fixed list, and how the satisfies operator differs from a type annotation.