Skip to main content

Utility Types

Built-in type helpers for common transformations.

Common Utilities

TypePurpose
Partial<T>All properties optional
Required<T>All properties required
Pick<T, K>Select subset of keys
Omit<T, K>Exclude keys
Record<K, V>Object with key type K and value type V

Example

interface User {
id: number;
name: string;
email: string;
}

type UserPreview = Pick<User, 'id' | 'name'>;
type UserUpdate = Partial<Omit<User, 'id'>>;