import { default as SDK } from '..'; import { EditorAPI } from '../types/CommonTypes'; /** * The UndoManagerController is responsible for all communication regarding the Undo-Manager. * Methods inside this controller can be called by `window.SDK.undoManager.{method-name}` */ export declare class UndoManagerController { #private; /** * @ignore */ constructor(children: EditorAPI, sdk: SDK); /** * This method undoes the last operation * @returns */ undo: () => Promise>; /** * This method redoes the last operation * @returns */ redo: () => Promise>; /** * This method adds custom data that will be saved and restored when undoing and redoing. * Duplicate values are overwritten. The data is exposed via the onCustomUndoDataChanged event. * * @param key The key of the custom data * @param value The value of the custom data * @returns */ addCustomData: (key: string, value: string) => Promise>; /** * Record any operations in the current scope. This will automatically begin * the undo operation. Once you leave the record scope, it will end the undo operation. * Even if you throw an exception inside the record scope it will still end it properly. * @returns */ record: (operationName: string, undoOperationCallback: (sdk: SDK) => Promise) => Promise; /** * This method pauses the undo manager * @returns */ pause: () => Promise>; /** * This method resumes the undo manager * @returns */ resume: () => Promise>; /** * This method clears the undo stack * @returns */ clear: () => Promise>; /** * Advanced undo manager functionality for manually controlling undo operations. * This will start a new undo operation. * This will throw an exception when there is already an undo operation recording. * @experimental This method is experimental and may change in future versions. * @returns */ advanced: { /** * This will start a new undo operation. * This will throw an exception when there is already an undo operation recording. * @experimental This method is experimental and may change in future versions. * @returns */ begin: (operationName: string) => Promise>; /** * This will start a new undo operation if there is no other undo operation recording. * This does not throw. * @experimental This method is experimental and may change in future versions. * @returns */ beginIfNoneActive: (operationName: string) => Promise>; /** * Ends the currently active recording operation. * If there is no recording operation currently running this will throw an exception. * @experimental This method is experimental and may change in future versions. * @returns */ end: () => Promise>; /** * Aborts the currently active recording operation. * If there is no recording operation currently running this will throw an exception. * @experimental This method is experimental and may change in future versions. * @returns */ abort: () => Promise>; }; } export declare class AdvancedUndoManagerController { #private; /** * @ignore */ constructor(children: EditorAPI); /** * This will start a new undo operation. * This will throw an exception when there is already an undo operation recording. * @returns */ begin: (operationName: string) => Promise>; /** * This will start a new undo operation if there is no other undo operation recording. * This does not throw. * @returns */ beginIfNoneActive: (operationName: string) => Promise>; /** * Ends the currently active recording operation. * If there is no recording operation currently running this will throw an exception. * @returns */ end: () => Promise>; /** * Aborts the currently active recording operation. * If there is no recording operation currently running this will throw an exception. * @returns */ abort: () => Promise>; }