RequiredBy<T, K>: Omit<T, K> & ExactRequired<Pick<T, K>>

Type Parameters

  • T
  • K extends keyof T

Creates a type that is T with the required keys K.

RequiredBy<{ a?: string, b: number }, 'a'>
=> { a: string, b: number }