Omit<T, K>
The utility type that copies type T without the listed keys K, like a denylist of fields.
In more detail
Omit<UserEntity, "id" | "createdAt"> is the shape a client sends when creating a user. Use it when you want everything except a few server-managed fields.
Related terms
- Pick<T, K> — The utility type that keeps only the listed keys K of type T, like an allowlist of fields.
- Exclude<T, U> — The utility type that removes from union T every member assignable to U, such as Exclude<HttpMethod, "GET">.
- DTO — A plain object whose only job is to carry data across a boundary, such as the body of an API request or response.
Taught in
- void, undefined And null: Exact Optional Property Types — Production TypeScript
- Default Generic Arguments And Multi-Type Parameters — Production TypeScript
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript
- Union Utilities: Exclude, Extract, NonNullable And Awaited — Production TypeScript
- The satisfies Operator: Safe Validation Without Widening — Production TypeScript