Type alias Not<Negated, Type>

Not<Negated, Type>: Type extends Negated ? never : Type

Negates a type.

Example

type NotNumber<Type> = Not<number, Type>;
const notNumber: NotNumber<string | number> = "🟢";

Type Parameters

  • Negated

  • Type