TypeScript 7 · Utility types and narrowing
Make all properties optional
Create a type where every property of User is optional, handy for update payloads.
type UserUpdate = Partial<User>;
Official TypeScript 7 documentation
More utility types and narrowing commands
- Pick or omit properties
- Type a dictionary
- Require or freeze properties
- Remove null and undefined
- Write a type guard
- Narrow an unknown value
All utility types and narrowing commands · TypeScript 7 cheatsheet