DocumentHistory

interface DocumentHistory

Interface for undo/redo operations on a document.

Functions

Link copied to clipboard
abstract fun canRedo(): Boolean

Returns true if there are operations that can be redone. Also false while a Client.resyncAsync call on this document is between its discard and its re-anchor, even if the redo stack itself is non-empty.

Link copied to clipboard
abstract fun canUndo(): Boolean

Returns true if there are operations that can be undone. Also false while a Client.resyncAsync call on this document is between its discard and its re-anchor, even if the undo stack itself is non-empty.

Link copied to clipboard
abstract fun redoAsync(): Deferred<OperationResult>

Redoes the last undone operation. Throws YorkieException.Code.ErrRefused while a Client.resyncAsync call on this document is between its discard and its re-anchor -- a new failure mode reachable once any caller opts into resync.

Link copied to clipboard
abstract fun undoAsync(): Deferred<OperationResult>

Undoes the last local operation. Throws YorkieException.Code.ErrRefused while a Client.resyncAsync call on this document is between its discard and its re-anchor -- a new failure mode reachable once any caller opts into resync.