Home > paratype > discriminatorType
Constructs a Type that represents a union of other types, each with a common distriminator property.
Signature:
export declare function discriminatorType<Key extends string & keyof TypeOf<Union[keyof Union]>, Union extends Record<string, Type>>(key: Key, union: Union): Type<TypeOf<Union[keyof Union]>>;
Parameter | Type | Description |
---|---|---|
key | Key | |
union | Union |
Returns: