@mescius/dspdfviewer
Version:
Document Solutions PDF Viewer
89 lines (88 loc) • 2.52 kB
TypeScript
import GcPdfViewer from "../GcPdfViewer";
import { ViewerOptions } from "../ViewerOptions";
import { IUndoStorage } from "./IUndoStorage";
import { UndoCommandSupport } from "./Commands/UndoCommandSupport";
/**
* Command based undo state storage.
**/
export declare class UndoStorage implements IUndoStorage {
viewer: GcPdfViewer;
skipCommandsHash: {
[name: string]: boolean;
};
private _index;
private _eventBus?;
private _commandsList;
private _undoInProgress;
private _disabled;
private _maxLevels;
constructor(viewer: GcPdfViewer);
/**
* Apply undo storage options.
* @param options
*/
applyOptions(options: ViewerOptions): void;
/**
* Dispose undo storage.
**/
dispose(): void;
/**
* Clear undo storage.
**/
clear(): void;
/**
* 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): void;
/**
* Undo last action.
**/
undo(): Promise<void>;
/**
* Redo next action.
**/
redo(): Promise<void>;
/**
* Gets a value indicating whether the undo storage can undo changes.
**/
get hasUndo(): boolean;
/**
* Gets a value indicating whether the undo storage can redo changes.
**/
get hasRedo(): boolean;
/**
* Gets current undo level index.
**/
get undoIndex(): number;
/**
* Gets total undo levels count.
**/
get undoCount(): number;
/**
* Gets a flag indicating whether an undo/redo or execute operation is in progress.
**/
get undoInProgress(): boolean;
/**
* Gets undo commands list. Used by FiltersPreviewPanel.
* @ignore exclude from docs.
**/
get commands(): UndoCommandSupport[];
applyOptionsInternal(options: Partial<ViewerOptions>, isInit?: boolean): void;
private _init;
private _onAddReplaceHighlights;
private _legacyUndoCount;
private _onLegacyUndoStorageChanged;
private _reset;
}