The UndoManagerController is responsible for all communication regarding the Undo-Manager. Methods inside this controller can be called by window.SDK.undoManager.{method-name}

Properties

advanced: {
    abort: () => Promise<EditorResponse<null>>;
    begin: (operationName: string) => Promise<EditorResponse<null>>;
    beginIfNoneActive: (operationName: string) => Promise<EditorResponse<null>>;
    end: () => Promise<EditorResponse<null>>;
} = ...

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. This method is experimental and may change in future versions.

Type declaration

  • Experimentalabort: () => Promise<EditorResponse<null>>

    Aborts the currently active recording operation. If there is no recording operation currently running this will throw an exception. This method is experimental and may change in future versions.

  • Experimentalbegin: (operationName: string) => Promise<EditorResponse<null>>

    This will start a new undo operation. This will throw an exception when there is already an undo operation recording. This method is experimental and may change in future versions.

  • ExperimentalbeginIfNoneActive: (operationName: string) => Promise<EditorResponse<null>>

    This will start a new undo operation if there is no other undo operation recording. This does not throw. This method is experimental and may change in future versions.

  • Experimentalend: () => Promise<EditorResponse<null>>

    Ends the currently active recording operation. If there is no recording operation currently running this will throw an exception. This method is experimental and may change in future versions.

Methods

  • 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.

    Parameters

    • key: string

      The key of the custom data

    • value: string

      The value of the custom data

    Returns Promise<EditorResponse<null>>

  • 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.

    Parameters

    • operationName: string
    • undoOperationCallback: (sdk: default) => Promise<void>

    Returns Promise<void>