TypeScript 7 · Utility types and narrowing
Require or freeze properties
Make every property required, or read-only.
type Complete = Required<User>;
type Frozen = Readonly<User>;
Official TypeScript 7 documentation
More utility types and narrowing commands
- Make all properties optional
- Pick or omit properties
- Type a dictionary
- Remove null and undefined
- Write a type guard
- Narrow an unknown value
All utility types and narrowing commands · TypeScript 7 cheatsheet