How do I omit a value in typescript union type [duplicate]

You’re looking for Exclude rather than Omit:

Exclude<UnionType, ExcludedMembers>

Constructs a type by excluding from UnionType all union members that are assignable to ExcludedMembers.

(And you don’t want the quotes.)

So:

export type ExampleX = Exclude<Example, ExampleThree>;

Playground link

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)