Class TrackedJSON<T>

Type Parameters

  • T extends JSONObject

Hierarchy

  • TrackedJSON

Constructors

Accessors

Methods

Constructors

  • new TrackedJSON<T>(options?: { initialState: T }): TrackedJSON<T>
  • Type Parameters

    • T extends JSONObject

    Parameters

    • Optional options: { initialState: T }
      • initialState: T

    Returns TrackedJSON<T>

Accessors

  • get data(): T
  • set data(newData: T): void
  • The tracked data object to manipulate

    Returns T

  • The tracked data object to manipulate

    Parameters

    • newData: T

    Returns void

  • get redoSize(): number
  • set redoSize(val: number): void
  • Returns the current number of times redo can be called

    Returns number

  • Returns the current number of times redo can be called

    Parameters

    • val: number

    Returns void

  • get undoSize(): number
  • set undoSize(val: number): void
  • Returns the current number of times undo can be called

    Returns number

  • Returns the current number of times undo can be called

    Parameters

    • val: number

    Returns void

Methods

  • clone(at?: number): T
  • Clones the object at a given point in it's history. No argument clones the current state of the data object

    Parameters

    • Optional at: number

      The position in the history stack to clone at. Positive numbers are from initialisation and negative numbers from current object state

    Returns T

  • redo(): void
  • Moves the data property forward to the state it was in before the the last call of undo

    Returns void

  • undo(): void
  • Moves the data property back to the state it was in before the previous change

    Returns void

Generated using TypeDoc