Type alias Nominal<K, T>

Nominal<K, T>: T & Readonly<{
    __flavor?: K;
}>

Creates a flexible nominal type.

Type Parameters

  • K

  • T

Example

type Foo = Nominal<'Foo', number>;
type Bar = Nominal<'Bar', number>;

Foo === Bar
// => false

Generated using TypeDoc