TypeScript
TS Type Playground
Write TypeScript type definitions and see them explained. Explore utility types, generics, and conditional types interactively.
Record<K, V>
Constructs an object type whose property keys are K and values are T.
Partial<T>
Makes all properties in T optional.
Required<T>
Makes all properties in T required (removes optionality).
Omit<T, K>
Constructs a type by picking all properties from T and then removing K.
Pick<T, K>
Constructs a type by picking the set of properties K from T.
Extract<T, U>
Extracts from T those types that are assignable to U.
Exclude<T, U>
Excludes from T those types that are assignable to U.
ReturnType<T>
Extracts the return type of a function type.
Parameters<T>
Extracts the parameter types of a function type as a tuple.
Awaited<T>
Recursively unwraps the "awaited type" of a Promise.
NonNullable<T>
Excludes null and undefined from T.