Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 450 Bytes

Omit.md

File metadata and controls

19 lines (15 loc) · 450 Bytes

Omit<Type, Keys>

Constructs a type by picking all properties from Type and then removing Keys (string literal or union of string literals). The opposite of Pick.

interface Todo {
  title: string
  description: string
  completed: boolean
  createdAt: number
}

type TodoInfo = Omit<Todo, 'completed' | 'createdAt'>

const todoInfo: TodoInfo = {
  title: 'Pick up kids',
  description: 'Kindergarten closes at 5pm',
}