UnionOmit<T, K>: T extends any
    ? Omit<T, K>
    : never

Type Parameters

  • T

  • K extends keyof any

Description

Construct a type with the properties of union type T except for those in type K.

Example

type Result = UnionOmit<{ a: string, b: number } | { a: string, b: undefined, c: number }, 'a'>
=> { b: number } | { b: undefined, c: number }

Generated using TypeDoc