This object maintains the undo stack for an [[EditSession EditSession]].

Constructors

Properties

$fromUndo: boolean
$keepRedoStack: boolean
$lastDelta: any
$maxRev: number
$redoStack: any
$redoStackBaseRev: any
$rev: any
$session: EditSession
$undoDepth: number
$undoStack: any
hasRedo: (() => boolean)

Type declaration

    • (): boolean
    • Returns true if there are redo operations left to perform.

      Returns boolean

hasUndo: (() => boolean)

Type declaration

    • (): boolean
    • Returns true if there are undo operations left to perform.

      Returns boolean

isClean: (() => boolean)

Type declaration

    • (): boolean
    • Returns if the current status is clean

      Returns boolean

lastDeltas: any[]
mark: number
markClean: ((rev?) => void)

Type declaration

    • (rev?): void
    • Marks the current status clean

      Parameters

      • Optional rev: number

      Returns void

selections: any[]

Methods

  • Provides a means for implementing your own undo manager. options has one property, args, an [[Array Array]], with two elements:

    • args[0] is an array of deltas
    • args[1] is the document to associate with

    Parameters

    • delta: Delta
    • allowMerge: boolean
    • Optional session: EditSession

    Returns void

  • Parameters

    • selection: any
    • Optional rev: number

    Returns void

  • Marks the current status clean

    Parameters

    • Optional rev: number

    Returns void

  • Returns true if there are redo operations left to perform.

    Returns boolean

  • Returns true if there are undo operations left to perform.

    Returns boolean

  • Takes in an object which was returned from the toJSON method above, and resets the current undoManager instance to use the previously exported instance state.

    Parameters

    • json: any

    Returns void

  • Parameters

    • from: number
    • Optional to: number

    Returns void

  • Parameters

    • from: number
    • Optional to: number

    Returns void

  • Parameters

    • from: number
    • Optional to: number

    Returns Delta[]

  • Parameters

    • rev: number
    • Optional after: boolean

    Returns {
        rev: number;
        value: string;
    }

    • rev: number
    • value: string
  • Returns if the current status is clean

    Returns boolean

  • Parameters

    • from: number
    • Optional to: number

    Returns void

  • [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo}

    Parameters

    • session: EditSession
    • Optional dontSelect: boolean

      {:dontSelect}

    Returns void

  • Destroys the stack of undo and redo redo operations.

    Returns void

  • Returns an object which can be safely stringified into JSON

    Returns any

  • [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo}

    Parameters

    • session: EditSession
    • Optional dontSelect: boolean

      {:dontSelect}

    Returns void

Generated using TypeDoc