TypeScript utility types are incredible time savers.
My most used:
Partial<T>— Make all properties optionalRequired<T>— Make all properties requiredPick<T, K>— Pick specific propertiesOmit<T, K>— Omit specific propertiesRecord<K, T>— Create an object type with specific keys
Example:
interface User {
id: string;
name: string;
email: string;
password: string;
}
// Use all properties except password
type UserRegistration = Omit<User, 'password'>;
// Use only name and email
type UserContact = Pick<User, 'name' | 'email'>;
Custom conditional types unlock even more power:
type Nullable<T> = T | null;
type Async<T> = Promise<T>;
The TypeScript handbook has great docs on utility types.
