import type { DOMEventPluginState, EditorOptions, IEditor, PluginWithState } from 'roosterjs-editor-types'; /** * @internal * DOMEventPlugin handles customized DOM events, including: * 1. Keyboard event * 2. Mouse event * 3. IME state * 4. Drop event * 5. Focus and blur event * 6. Input event * 7. Scroll event * It contains special handling for Safari since Safari cannot get correct selection when onBlur event is triggered in editor. */ export default class DOMEventPlugin implements PluginWithState { private editor; private disposer; private state; /** * Construct a new instance of DOMEventPlugin * @param options The editor options * @param contentDiv The editor content DIV */ constructor(options: EditorOptions, contentDiv: HTMLDivElement); /** * 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(): DOMEventPluginState; private onDragStart; private onDrop; private onFocus; private onSelectionChangeSafari; private cacheSelection; private onScroll; private getEventHandler; private onKeyboardEvent; private onInputEvent; private onContextMenuEvent; }