hed-typescript API
    Preparing search index...

    A schema unit class.

    Hierarchy (View Summary)

    Index
    • Constructor.

      Parameters

      • name: string

        The name of this unit class.

      • description: string | undefined

        The description of this unit class.

      • booleanAttributes: Set<default>

        The boolean attributes for this unit class.

      • valueAttributes: Map<default, string[]>

        The value attributes for this unit class.

      • units: Map<string, default>

        The units for this unit class.

      Returns default

    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 defaultUnit(): default | undefined

      Get the default unit for this unit class.

      Returns default | undefined

      A listed unit wins; otherwise the unit that the default derives from (A for mA, Ohm for kOhm) is matched.

    • get description(): string | undefined

      The description of this schema entry.

      Returns string | undefined

    • get hasConversionFactors(): boolean

      Whether any unit of this unit class has a conversionFactor (none of the timeUnits of HED 8.0.0 does).

      Returns boolean

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

      Parameters

      • other: unknown

        A schema unit class to compare with this one.

      Returns boolean

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

      Schema unit classes are deemed equivalent if they have the same name and equivalent attributes.

    • Extract the unit class and remainder.

      Parameters

      • value: string

        The value part of a tag, possibly ending in a unit.

      • listedOnly: boolean = false

        Whether to match only unit names as listed in the schema (no plurals or modifiers).

      Returns [default | null, string | null, string]

      A tuple with the unit, unit string, and value string.

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