Class HierarchicalMap<Key, Value, Parent>

Maps string event identifiers to string action identifiers.

When an event identifier is looked up in a given HierarchicalMap, it is resolved to a corresponding action identifier in one of two ways:

  1. via mappings defined directly on the HierarchicalMap.

  2. via a recursive lookup on a "parent" HierarchicalMap that has been specified for the root HierarchicalMap on which the lookup was initiated.

HierarchicalMap objects may be specified as "parents" of another HierarchicalMap along with a specified numerical priority value, such that there is a directed graph of HierarchicalMap objects. Cycles in this graph may lead to infinite looping.

Recursive lookups in parent HierarchicalMap objects are performed in order of decreasing priority. The lookup stops as soon as a mapping is found. Direct bindings have a priority of 0. Therefore, parent maps with a priority higher than 0 take precedence over direct bindings.

Type Parameters

Hierarchy

Implements

Constructors

Properties

bindings: Map<Key, Value> = ...
parentPriorities: number[] = ...
parents: Parent[] = ...

Methods

  • Register parent as a parent map. If priority > 0, this map will take precedence over direct bindings.

    Returns

    A nullary function that unregisters the parent (and may be called at most once).

    Parameters

    • parent: Parent
    • priority: number

    Returns (() => void)

      • (): void
      • Returns void

Generated using TypeDoc