Partial<T>
The utility type that makes every property of T optional, used for update or patch payloads.
In more detail
Partial<Omit<UserEntity, "id">> accepts any subset of the editable fields. It is shallow: nested objects keep their own required properties.
Related terms
- Required<T> — The utility type that removes the question mark from every property of T, making all of them required.
- Omit<T, K> — The utility type that copies type T without the listed keys K, like a denylist of fields.
- optional property — An object property marked with a question mark, such as bio?: string, which may be left out.
- utility types — Generic types built into TypeScript, such as Partial, Pick and ReturnType, that compute a new type from an existing one.
Taught in
- void, undefined And null: Exact Optional Property Types — Production TypeScript
- Discriminated Unions: Tagged Variants And Pattern Matching — Production TypeScript
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript