TypeScript 7 · Utility types and narrowing
Type a dictionary
Describe an object with known key and value types.
type Scores = Record<string, number>;
Official TypeScript 7 documentation
More utility types and narrowing commands
- Make all properties optional
- Pick or omit properties
- 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