The union of a non-recursive ADT's variants, derived from the adt return value. (Recursive ADTs must declare their union manually, since the spec's field types need to refer to it.)
const Shape = adt('Shape', { Circle: (radius: number) => ({ radius }), Point: null });type Shape = VariantOf<typeof Shape>; Copy
const Shape = adt('Shape', { Circle: (radius: number) => ({ radius }), Point: null });type Shape = VariantOf<typeof Shape>;
The union of a non-recursive ADT's variants, derived from the adt return value. (Recursive ADTs must declare their union manually, since the spec's field types need to refer to it.)