UNPKG

@mescius/dspdfviewer

Version:
39 lines (38 loc) 1.06 kB
import GcPdfViewer from "../../GcPdfViewer"; /** * Interface for undo commands. * @example * // The UndoCommandSupport interface implementation example. * function CustomUndoCommand() { } * CustomUndoCommand.prototype = { * name: "CustomUndoCommand", * execute: function(viewer) { * return new Promise((resolve)=>{ * // Put your action code here * resolve(); * }) * }, * undo: function(viewer) { * return new Promise((resolve)=>{ * // Put your undo action here * resolve(); * }) * } * }; **/ export interface UndoCommandSupport { /** * Optional. The unique name of the command. Used by the undo.skipCommands option setting. **/ name?: string; /** * Action implementation. * @param viewer **/ execute(viewer: GcPdfViewer): Promise<void>; /** * Undo action implementation. * @param viewer **/ undo(viewer: GcPdfViewer): Promise<void>; }