Utility types help you reshape and remix existing types without rewriting them:
type User = { id: number; name: string; email: string };
type UserPreview = Pick<User, 'id' | 'name'>; // { id, name }
type PartialUser = Partial<User>; // All properties optional
type ReadonlyUser = Readonly<User>; // Can't modify propertiesThey're building blocks for safer refactors and clearer intent.
Essential utility types:
Slicing objects:
Pick<T, Keys> – Keep only specific propertiesOmit<T, Keys> – Remove specific propertiesAdjusting optionality:
Partial<T> – Make all properties optionalRequired<T> – Make all properties requiredOther patterns:
Readonly<T> – Make properties read-onlyRecord<Keys, Type> – Build dictionary from keys and value typeReturnType<F> – Extract function return typeParameters<F> – Extract function parameter types as tupleIn this category, you'll:
Pick and Omit to create focused types from larger onesPartial and Required to adjust optionalityReadonly to communicate immutabilityRecord<K, V>ReturnType and ParametersThese patterns help you connect APIs without duplicating type declarations, making refactoring safer and code more maintainable.