object-transforms

Omit<T, K>

Constructs a type by removing the properties in K from T. Unlike Pick, its K is not constrained to keyof T, so extra keys are silently ignored.

type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>

Usage patterns

Pattern Purpose
Omit<T, 'password'> Strip sensitive or internal fields
Omit<T, keyof U> Remove keys that belong to another type
Omit<Props, 'ref'> Common React pattern for wrapper components
Omit<T, never> Identity — returns T unchanged

Examples

interface User { id: number; name: string; password: string }
type SafeUser = Omit<User, 'password'>;

Result: { id: number; name: string }

type ExtendedProps<P> = Omit<P, 'className'> & { className: string };

Overrides a property by omitting then re-declaring it

type A = Omit<{ a: 1; b: 2 }, 'c'>;

A is { a: 1; b: 2 } — non-existent keys are allowed without error

type Complement<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;

Definition of Omit expressed directly with Pick + Exclude

Gotcha

Omit does not error on keys missing from T, so typos silently do nothing — prefer `a StrictOmit helper (`type StrictOmit = Omit` — the `extends keyof T` constraint actually errors on typos)` for strict variants. Omit on unions distributes poorly; use a distributive helper when narrowing discriminated unions.

Related utility types

← All TS utility types · TypeScript vs JavaScript · any vs unknown vs never