@mescius/dspdfviewer
Version:
Document Solutions PDF Viewer
40 lines (39 loc) • 1.17 kB
TypeScript
import GcPdfViewer from "../../GcPdfViewer";
export type UndoCommandName = "AddReplaceTextHighlight" | "ExtractTableData" | "Open" | "Close";
/**
* 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?: UndoCommandName | string;
/**
* Action implementation.
* @param viewer
**/
execute(viewer: GcPdfViewer): Promise<void>;
/**
* Undo action implementation.
* @param viewer
**/
undo(viewer: GcPdfViewer): Promise<void>;
}