Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

  • ModelHistoryManager

Index

Constructors

constructor

  • Parameters

    • instance: T

    Returns ModelHistoryManager

Properties

Private _currentState

_currentState: T

Private _initialState

_initialState: T

Private _snapshots

_snapshots: object[] = []

maxSnapshots

maxSnapshots: number = -1

Accessors

get

get:

isUndoPossible

isUndoPossible:

snapshots

snapshots:

tags

tags:

Methods

getSnapshotsByTag

  • getSnapshotsByTag(tags: string[]): any[]
  • Parameters

    • tags: string[]

    Returns any[]

redo

  • redo(): void
  • Returns void

saveSnapshot

  • saveSnapshot(tag?: string): boolean
  • Parameters

    • Default value tag: string = ""

    Returns boolean

    true if a snapshot was saved, false if no snapshot saved (model has not changed)

setInitialState

  • setInitialState(): void
  • Returns void

undo

  • undo(tagsFilter?: string[]): boolean
  • Parameters

    • Default value tagsFilter: string[] = []

    Returns boolean

    True if the undo operation resulted in a current state change, false otherwise

undoAll

  • undoAll(): boolean
  • Returns boolean

    True if the current state changed, false otherwise

Generated using TypeDoc