UNPKG

@mescius/dspdfviewer

Version:
70 lines (69 loc) 1.91 kB
import { ViewerOptions } from "../ViewerOptions"; import { UndoCommandSupport } from "./Commands/UndoCommandSupport"; /** * Command based undo state storage. **/ export interface IUndoStorage { /** * Apply undo storage options. * @param options */ applyOptions(options: Partial<ViewerOptions>): any; /** * Dispose undo storage. **/ dispose(): any; /** * Clear undo storage. **/ clear(): any; /** * Gets a value indicating whether the command specified in the command parameter is supported. * @param command **/ isCommandSupported(command: UndoCommandSupport): boolean; /** * Execute a new command. * @param {type} command Instance of a command. * @returns {undefined} **/ execute(command: UndoCommandSupport): Promise<void>; /** * Called after command action has been executed. * @param command */ onCommandExecuted(command: UndoCommandSupport): any; /** * Undo last action. **/ undo(): Promise<void>; /** * Redo next action. **/ redo(): Promise<void>; /** * Gets a value indicating whether the undo storage can undo changes. **/ readonly hasUndo: boolean; /** * Gets a value indicating whether the undo storage can redo changes. **/ readonly hasRedo: boolean; /** * Gets current undo level index. **/ readonly undoIndex: number; /** * Gets total undo levels count. **/ readonly undoCount: number; /** * Gets a flag indicating whether an undo/redo or execute operation is in progress. **/ readonly undoInProgress: boolean; /** * Gets undo commands list. Used by FiltersPreviewPanel. * @ignore exclude from docs. **/ readonly commands: UndoCommandSupport[]; }