Type alias Nominal<K, T>

Nominal<K, T>: T & {
    [FLAVOR]?: Readonly<K>;
}

Creates a flexible nominal type.

Type Parameters

  • K

  • T

Type declaration

  • Optional [FLAVOR]?: Readonly<K>

Example

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

Foo === Bar
// => false

Generated using TypeDoc