On this page
  1. Omit
  2. Syntax & Overview
  3. Notes & Pitfalls
  4. Example

Omit

Prev: `Pick` | Up: object_transforms | Next: union_and_nullability
Rel: object_transforms, Conditional & Mapped Types
Ref: TypeScript Docs — Utility Types
Tags: #public #web #typescript #utility-types #object_transforms #tier/core


Syntax & Overview

Omit<T, Keys>

Constructs a type with all properties of T except Keys.

Notes & Pitfalls

Example

interface User { id: number; name: string; passwordHash: string }
type PublicUser = Omit<User, "passwordHash">;

const pub: PublicUser = { id: 1, name: "Ada" };

Linked from

Related notes