Class CategoryCollection

Hierarchy (view full)

Accessors

  • get previousIndexSymbol(): symbol
  • Get the symbol which is attached to an item prior to its removal. If an item is removed, the current index of the item is set on the item with this symbol.

    Returns symbol

  • get uniqueKey(): undefined | keyof T
  • The key by which to check uniqueness against. undefined if no uniqueness constraint is set.

    Returns undefined | keyof T

Constructors

Methods

  • Protected

    internal remove function, to remove an item from the collection, does not raise an event.

    Parameters

    Returns number

    returns the index of the removed item or -1 if the item has not been found.

  • Returns true, if the key exists. Returns undefined, if there is no uniqueness constraint.

    Parameters

    • value: unknown

    Returns undefined | boolean

  • Parses the category items. Items will only be parsed, if a category with said name exists. Otherwise, they will be cached, until such a category is requested.

    Parameters

    • name: string
    • items: object[]
    • moduleId: string

    Returns Promise<void>

Properties

_array: Category<object | VcsObject, object>[]
added: VcsEvent<Category<object | VcsObject, object>>

Event raised if an item is added. Is passed the added item.

moved: VcsEvent<Category<object | VcsObject, object>>

Event raised if an item is relocated within the collection. Is passed the moved item.

removed: VcsEvent<Category<object | VcsObject, object>>

Event raised if an item is removed. Is passed the removed item.