hed-typescript API
    Preparing search index...

    A schema value class.

    Hierarchy (View Summary)

    Index
    • Constructor.

      Parameters

      • name: string

        The name of this value class.

      • description: string | undefined

        The description of this value class.

      • booleanAttributes: Set<default>

        The boolean attributes for this value class.

      • valueAttributes: Map<default, string[]>

        The value attributes for this value class.

      • allowedNames: string[] = []

        The character set names that define the class's characters.

      Returns default

    allowedNames: string[]

    The character set names (character_sets.json) that define this class's characters; empty for no constraint.

    booleanAttributeNames: Set<string>

    The set of boolean attribute names this schema entry has.

    booleanAttributes: Set<default>

    The set of boolean attributes this schema entry has.

    valueAttributeNames: Map<string, string[]>

    The collection of value attribute names this schema entry has.

    valueAttributes: Map<default, string[]>

    The collection of value attributes this schema entry has.

    • get description(): string | undefined

      The description of this schema entry.

      Returns string | undefined

    • Determine if this schema value class is equivalent to another schema value class.

      Parameters

      • other: unknown

        A schema value class to compare with this one.

      Returns boolean

      Whether the other value class is equivalent to this schema value class.

      Value classes are equivalent if they have the same name, description, attributes, and allowed characters (in any order, as for the attribute values).

    • Retrieve a single value of a value attribute (by name) on this schema entry, throwing an error if more than one value exists.

      Parameters

      • attributeName: string

        The attribute whose value should be returned.

      Returns string | undefined

      The value of the attribute.

      If the attribute has more than one value.

    • Determine if a value is valid according to this value class.

      Parameters

      • value: string

        A HED value.

      Returns boolean

      Whether the value conforms to this value class.

    • Say why a value fails this class, checking the whole-value rule before the characters, as hed-python does.

      Parameters

      • value: string

        A HED value.

      Returns ValueClassProblem | null

      null if the value is valid; {rule: true} if it is empty, breaks the class's whole-value rule, or (dateTimeClass) names a date that does not exist; otherwise the characters the class does not allow, as [index, character] pairs.