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

    Type Alias StringValueConstraints<V>

    Value constraints accepted by the string shape factories.

    Restricts the admissible values of a shape to a closed enumeration or pins values that must be present. Accepted on its own by the format-specific factories, whose lexical space is already fixed, and included in the full StringConstraints set.

    type StringValueConstraints<V extends string = string> = {
        in?: readonly V[];
        hasValue?: readonly V[];
    }

    Type Parameters

    • V extends string = string

      The values the enumeration admits

    Index

    Properties

    Properties

    in?: readonly V[]

    Allowed values (closed enumeration).

    When specified, values must be members of this list. Empty arrays are ignored; the string factory takes the list as bare arguments too. Closing the domain also narrows the value the shape describes to the listed values, wherever they are stated precisely enough to be told apart; a list whose values are only known to be strings leaves it as the whole textual domain.

    Inheritance — child may only drop allowed values.

    undefined (no enumeration constraint)

    hasValue?: readonly V[]

    Values a member must carry.

    When specified, all listed values must appear among the ones the member carries. Empty arrays are ignored.

    Inheritance — child may only add required values.

    undefined (no required values)