- variant<T, E>(tag, ...members): $.Variant<T, $.InputObject<E>, $.OutputObject<E>>
Parameters
- tag: T
Rest
...members: [...(never extends E
? {
[K in string | number | symbol]: $.AnyShape extends E[K<K>]
? E[K<K>] & $.AnyShape
: (UnionKeys<$.Input<E[K<K>]>> & {
[L in string | number | symbol]: K<K> extends L<L>
? never
: UnionKeys<$.Input<(...)>>
}[number]) extends O
? [O] extends [never]
? $.Shape<$.Input<E[K<(...)>]> & {}, $.Input<E[K<(...)>]> & {}>
: $.Shape<{
[_ in string | number | symbol]?: undefined
}, {
[_ in string | number | symbol]?: undefined
}>
: never
}
: E)[]]