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

    Type Alias Variant<Tag, Fields>

    Variant: { tag: Tag } & Readonly<Fields>

    One case of an ADT: a tagged record with the case's fields spread flat.

    Type Parameters

    • Tag extends string
    • Fields extends object = {}
    type Shape = Variant<'Circle', { radius: number }> | Variant<'Rect', { w: number; h: number }>;