new UndoManager()
The class UndoManager.
Undo-redo interface; one-to-one mapped to document
Extends
Methods
-
canRedo()
-
Returns a boolean indicating whether it is possible to redo from the current snapshot.
Returns:
A promise that resolves to a boolean indicating whether it is possible to redo from the current snapshot.- Type
- Promise.<boolean>
-
canUndo()
-
Returns whether it is possible to undo from the current snapshot.
Returns:
A promise that resolves to whether it is possible to undo from the current snapshot.- Type
- Promise.<boolean>
-
destroy()
-
Destructor
- Inherited From:
Returns:
- Type
- Promise.<void>
-
discardAllSnapshots()
-
Forget all changes in this manager (without changing the document).
Returns:
A promise that resolves to an invalid DocSnapshot.- Type
- Promise.<PDFNet.DocSnapshot>
-
getNextRedoSnapshot()
-
Gets the next state of the document. This state may be invalid if it is impossible to redo.
Returns:
A promise that resolves to the next state of the document. This state may be invalid if it is impossible to redo.- Type
- Promise.<PDFNet.DocSnapshot>
-
getNextUndoSnapshot()
-
Gets the previous state of the document. This state may be invalid if it is impossible to undo.
Returns:
A promise that resolves to the previous state of the document. This state may be invalid if it is impossible to undo.- Type
- Promise.<PDFNet.DocSnapshot>
-
redo()
-
Restores to the next snapshot, if there is one.
Returns:
A promise that resolves to a representation of the transition to the next snapshot, if there is one.- Type
- Promise.<PDFNet.ResultSnapshot>
-
takeOwnership()
-
Take the ownership of this object, so that PDFNet.runWithCleanup won't destroy this object.
- Inherited From:
Returns:
- Type
- void
-
takeSnapshot()
-
Creates a snapshot of document state, transitions to the new snapshot.
Returns:
A promise that resolves to a representation of the transition.- Type
- Promise.<PDFNet.ResultSnapshot>
-
undo()
-
Restores to the previous snapshot point, if there is one.
Returns:
A promise that resolves to the resulting snapshot id.- Type
- Promise.<PDFNet.ResultSnapshot>