Type Alias UnionPartialBy<T, K>

UnionPartialBy: T extends any ? PartialBy<T, K> : never

Type Parameters

  • T
  • K extends keyof T

Creates a type that is a partial of T, but with the required keys K.

PartialBy<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>
=> { a?: string, b: number } | { a?: string, b: undefined, c: number }