import type { EditorOptions, IEditor, PluginEvent, PluginWithState, UndoPluginState } from 'roosterjs-editor-types'; /** * @internal * Provides snapshot based undo service for Editor */ export default class UndoPlugin implements PluginWithState { private editor; private lastKeyPress; private state; /** * Construct a new instance of UndoPlugin * @param options The wrapper of the state object */ constructor(options: EditorOptions); /** * Get a friendly name of this plugin */ getName(): string; /** * Initialize this plugin. This should only be called from Editor * @param editor Editor instance */ initialize(editor: IEditor): void; /** * Dispose this plugin */ dispose(): void; /** * Get plugin state object */ getState(): UndoPluginState; /** * Check if the plugin should handle the given event exclusively. * @param event The event to check */ willHandleEventExclusively(event: PluginEvent): boolean; /** * Handle events triggered from editor * @param event PluginEvent object */ onPluginEvent(event: PluginEvent): void; private onKeyDown; private onKeyPress; private onBeforeKeyboardEditing; private onContentChanged; private clearRedoForInput; private canUndoAutoComplete; private addUndoSnapshot; }