Type index
One page per type. The definition is quoted from the compiler you are running, the examples are compiled and their resolved types compared, and every entry says what it does not do.
27 entries · definitions and examples checked against TypeScript 5.9.3 at build time
Object shapes
- Partial
Partial<T>Makes every property of an object optional, one level deep. - Required
Required<T>Removes `?` from every property, one level deep. - Pick
Pick<T, K extends keyof T>Keeps only the named keys, and checks that they exist. - Omit
Omit<T, K extends keyof any>Drops the named keys — and, unlike `Pick`, does not care whether they were ever there. - Record
Record<K extends keyof any, T>Builds an object type from a key set and one value type.
Unions
Functions
- ReturnType
ReturnType<T extends (...args: any) => any>The type a function gives back. - Parameters
Parameters<T extends (...args: any) => any>A function’s parameter list, as a tuple. - InstanceType
InstanceType<T extends abstract new (...args: any) => any>What a constructor produces when you call it with `new`.
Strings
- Uppercase
Uppercase<S extends string>Upper-cases a string literal type. - Lowercase
Lowercase<S extends string>Lower-cases a string literal type. - Capitalize
Capitalize<S extends string>Upper-cases the first character and leaves the rest alone. - Uncapitalize
Uncapitalize<S extends string>Lower-cases the first character and leaves the rest alone.
Async
Operators
- keyof
keyof TThe union of a type’s keys. - typeof
typeof valueThe bridge from a value to its type. - T[K]
T[K]Reads a property type back out of an object type. - infer
T extends Pattern<infer U> ? U : neverDeclares a variable the compiler fills in by pattern-matching. - satisfies
value satisfies ConstraintChecks a value against a type without widening it to that type. - as const
value as constStops the compiler widening a literal to its general type.
Constructs
- Mapped types
{ [K in Keys]: Value }A loop over a union of keys that builds an object type. - Conditional types
T extends U ? X : YThe type-level `if`. The question it asks is always assignability. - Template literal types
`prefix${T}suffix`String interpolation at the type level — and, read backwards, pattern matching on strings. - Variadic tuples
[Head, ...Rest]Spreading and matching tuples by position, which is how the type level does lists. - Variance annotations
interface Box<in out T>`in` and `out` state how a generic behaves when its parameter changes — which TypeScript otherwise works out for itself.