Where the type of opaque is stored
Where the variation is stored.
Where the private value is stored
Mapped type to store Opaques by name and variation
Helper type to add a prop _tag
on T
Usefull for ISO
This will extract all opaque types of a union API. This is more robust to change than creating the union of types yourself.
The union api
Merge two union APIs.
First union private types
Second union private types
The new union api definition
Same as ofVariations with a unique "default" variation
Use of
to create your opaque entities API.
The collection of private types for the union
The map of names and results of {@link "type" | type
}
function
A union api
Create a new union omiting the given union's types
Union initial private types
Keys of types to omit
The new union api definition
Create a new union omiting the given union's variances
Union initial private types
The new union api definition
Create a new union comprising only of the picked union's members
Union initial private types
Keys of types to keep
The new union api definition
To be used only in the context of Union.of to attach private type to the corresponding name in the union.
The private type to assign to the corresponding name
Something. Do not rely on it. Used internaly only.
Generated using TypeDoc
All opaque variables you create with the library will have the type of
Opaque<'SomeName', 'SomeVariation>
.You can't really do anything with it. So, don't try to use them directly! Use the library functions instead.
The name of the opaque
The variation of the opaque