@metreeca/blue - v0.9.1
    Preparing search index...

    Interface Union<V>

    Discriminated type alternatives for polymorphic property values.

    Values for union properties are represented as Indexed records mapping variant identifiers to values. In JSON-LD, this maps to an indexed container (@container: @index), where variant keys serve as type discriminators.

    Unions are pure type discriminators — cardinality constraints belong on the enclosing Range, not on individual variants.

    Note

    Indexed containers are designed exactly to provide JSON structure without affecting JSON-LD graph semantics, making unions unambiguous and manageable while preserving interoperability with linked data systems.

    interface Union<
        V extends
            { readonly [variant: string]: ValueShape } = {
            readonly [variant: string]: ValueShape;
        },
    > {
        kind: "union";
        model: {
            readonly [K in string
            | number
            | symbol]?: V[K] extends ValueShape ? any[any]["model"] : never
        };
        variants: V;
    }

    Type Parameters

    • V extends { readonly [variant: string]: ValueShape } = { readonly [variant: string]: ValueShape }

      The variants record type mapping names to value shapes

    Index

    Properties

    Properties

    kind: "union"

    Discriminator identifying this as a union.

    model: {
        readonly [K in string | number | symbol]?: V[K] extends ValueShape
            ? any[any]["model"]
            : never
    }

    Prototype value for runtime model assembly.

    An indexed record mapping variant keys to their model types. Each variant key is individually optional since union values provide one variant at a time.

    variants: V

    Named value shape variants.

    Each key serves as a type discriminator for polymorphic property values.