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

Constructors

Properties

hasRedo: () => boolean
hasUndo: () => boolean
isClean: () => boolean
lastDeltas: any[]
mark: number
markClean: (rev?: number) => 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

    Returns void

  • Parameters

    • selection: any
    • Optionalrev: number

    Returns void

  • Marks the current status clean

    Parameters

    • Optionalrev: 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: object

    Returns void

  • Parameters

    • from: number
    • Optionalto: number

    Returns void

  • Parameters

    • from: number
    • Optionalto: number

    Returns void

  • Parameters

    • rev: number
    • Optionalafter: boolean

    Returns { rev: number; value: string }

  • Returns if the current status is clean

    Returns boolean

  • Parameters

    • from: number
    • Optionalto: number

    Returns void

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

    Parameters

    Returns void

  • Destroys the stack of undo and redo redo operations.

    Returns void

  • Returns an object which can be safely stringified into JSON

    Returns object

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

    Parameters

    Returns void