@ossedb/patmat - v1.0.0
    Preparing search index...

    Type Alias VariantOf<A>

    VariantOf: A extends { "[ADT_SPEC]"?: infer Spec } ? SpecToUnion<Spec> : never

    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.)

    Type Parameters

    • A
    const Shape = adt('Shape', { Circle: (radius: number) => ({ radius }), Point: null });
    type Shape = VariantOf<typeof Shape>;