Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UndoRedoManager<T>

Manages undo and redo stacks.

Type parameters

  • T

Hierarchy

  • UndoRedoManager

Index

Accessors

isRedoPossible

  • get isRedoPossible(): boolean
  • Returns true if there are items in the redo stack.

    Returns boolean

isUndoPossible

  • get isUndoPossible(): boolean
  • Returns true if there are items in the undo stack.

    Returns boolean

redoStepCount

  • get redoStepCount(): number
  • Returns the number of items in the redo stack

    since

    2.23.0

    Returns number

undoStepCount

  • get undoStepCount(): number
  • Returns the number of items in the undo stack

    since

    2.23.0

    Returns number

Methods

addUndoStep

  • addUndoStep(stepData: T): void
  • Adds a step to the undo stack.

    Parameters

    • stepData: T

      data representing a state.

    Returns void

getLastUndoStep

  • getLastUndoStep(): T | undefined
  • Returns the last step in the undo log

    Returns T | undefined

redo

  • redo(): T | undefined
  • Returns most recent item in the redo stack.

    Returns T | undefined

replaceLastUndoStep

  • replaceLastUndoStep(stepData: T): void
  • Replaces the last undo step with step data provided

    Parameters

    • stepData: T

      data representing a state.

    Returns void

undo

  • undo(): T | undefined
  • Returns data for the previous step in the undo stack and adds last step to the redo stack.

    Returns T | undefined

Generated using TypeDoc