Class UcMetaAttr<T, TInput, TData>Abstract

Typed attribute of charge metadata.

When used as attribute key, the methods of attribute applied to store and extract attribute value(s).

Type Parameters

  • out T = unknown

    Attribute value type.

  • in TInput = unknown

    Attribute input type.

    Accepted when attribute value added to metadata.

    May differ from actual attribute value type.

  • out TData = unknown

    Stored data type.

    Declares what actually stored inside metadata.

Hierarchy

Constructors

Accessors

Methods

Constructors

  • Constructs attribute.

    Type Parameters

    • out T = unknown

    • in TInput = unknown

    • out TData = unknown

    Parameters

    • name: string

      Attribute name.

    • Optional uid: unknown

      Unique attribute identifier. this by default.

      Optional

    Returns UcMetaAttr<T, TInput, TData>

Accessors

Methods

  • Extracts attribute value from metadata.

    Parameters

    • data: undefined | TData

      Stored attribute data or undefined if nothing stored.

    • meta: UcMeta

      Source metadata to extract the value from.

    Returns undefined | T

    Either extracted attribute value, or undefined if nothing extracted.

  • Extracts all attribute values.

    Parameters

    • data: undefined | TData

      Stored attribute data or undefined if nothing stored.

    • meta: UcMeta

      Source metadata to extract values from.

    Returns T[]

    Either array of extracted attribute values, or empty array if nothing extracted.

  • Merges two attribute data instances.

    Called when metadata instances merged.

    Parameters

    • first: TData

      First attribute data instance to merge.

    • second: TData

      Second attribute data instance to merge.

    Returns TData

    Merged attribute data.

  • Stores attribute value to metadata.

    Parameters

    • data: undefined | TData

      Already stored attribute data or undefined if nothing stored yet.

    • value: TInput

      The input value to store.

    • meta: UcMeta

      Target metadata to store the value in.

    Returns TData

    Value to store.

Generated using TypeDoc