Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

  • KeyNode<Tkey, Tself>
    • KeyValueNode

Index

Constructors

constructor

Accessors

__@toStringTag

__@toStringTag:

depth

depth:

isRootKey

isRootKey:

isTerminalKey

isTerminalKey:

keepHistory

keepHistory:

Overrides default history condition for this KeyValueNode. Set true to keep all set values, false to keep no historical values, or set the number of historical values to keep.

key

key:

keyType

keyType:

Returns "index" for keys of type "number" and "key" for keys of type "string".

note

Type "index" is overridden to "key" when a sibling KeyNode is type "key".

numChildren

numChildren:

numSiblings

numSiblings:

parent

parent:

path

path:

PathNotation from the root to the KeyNode.

rootKey

rootKey:

Returns the root KeyNode of the path that leads to this KeyNode.

value

value:

Static keepHistory

keepHistory:

Sets default history conditions for all KeyValueNode instances. Individual instances can override this default. Set true to keep all set values, false to keep no historical values, or set the number of historical values to keep per KeyValueNode instance.

Methods

Protected _historyIteratorIsValid

  • _historyIteratorIsValid(historyEpoch: symbol): boolean
  • Provides hook for derived classes. Reference KeyValueNode.history for context.

    note

    When overriding, MUST call super._historyIteratorIsValid and pass through args.

    Parameters

    • historyEpoch: symbol

    Returns boolean

Protected _privateIniArgs

Protected _setHistoricalValue

  • _setHistoricalValue(index: number, historyEpoch: symbol): boolean
  • Provides hook for derived classes to be notified when value is updated by a historical undo or redo action, reference KeyValueNode.history for context.

    note

    When overriding, MUST call super._setHistoricalValue and pass through args.

    Parameters

    • index: number
    • historyEpoch: symbol

    Returns boolean

addChild

  • addChild<Tchildvalue, TchildKey>(childKey: KeyValueNode<TchildKey, Tchildvalue>): KeyValueNode<TchildKey, Tchildvalue>
  • addChild<Tchildvalue, TchildKey>(childKey: TchildKey, value?: Tchildvalue): KeyValueNode<TchildKey, Tchildvalue>

addSibling

  • addSibling<Tsiblingvalue, TsiblingKey>(siblingKey: KeyValueNode<TsiblingKey, Tsiblingvalue>): KeyValueNode<TsiblingKey, Tsiblingvalue>
  • addSibling<Tsiblingvalue, TsiblingKey>(siblingKey: TsiblingKey, value?: Tsiblingvalue): KeyValueNode<TsiblingKey, Tsiblingvalue>

ancestors

  • ancestors(): IterableIterator<Tself>

children

  • children(): IterableIterator<Tself>

getChild

  • getChild(childKey: string | number): Tself | null

getSibling

  • getSibling(siblingKey: string | number): Tself | null

hasChild

  • hasChild(childKey: string | number): boolean

hasSibling

  • hasSibling(siblingKey: string | number): boolean

history

pathToKey

  • pathToKey(includeSelf?: boolean): IterableIterator<Tself>

redo

  • redo(): boolean

removeChild

  • removeChild(childKey: string | number): boolean

removeSibling

  • removeSibling(siblingKey: string | number): boolean

rootKeys

  • rootKeys(): IterableIterator<Tself>

siblings

  • siblings(): IterableIterator<Tself>

terminalKeys

  • terminalKeys(global?: boolean): IterableIterator<Tself>
  • Iterates decedent terminal KeyNodes (default). If this KeyNode is terminal, iterates self.

    Parameters

    • Default value global: boolean = false

      pass true to iterate all terminal keys in the hierarchy from the terminal KeyNodes.

    Returns IterableIterator<Tself>

toString

  • toString(): string

undo

  • undo(): boolean

valueOf

  • valueOf(): string | number