import { Editor } from '@tiptap/core';
import { EditorState, Plugin, PluginKey } from '@tiptap/pm/state';
import { EditorView } from '@tiptap/pm/view';
import { default as CxPopup } from '../../../../../atoms/src/components/popup/popup.ts';

/**
 * Lit (or DOM) host for {@link BubbleMenuPlugin}: must expose the anchor `cx-popup`
 * used for floating placement.
 */
export interface TiptapBubbleMenuHost extends HTMLElement {
    bubbleMenu?: CxPopup | null;
}
export interface BubbleMenuPluginProps {
    editor: Editor;
    element: TiptapBubbleMenuHost;
    pluginKey: PluginKey | string;
    rectOffset: DOMRect;
    shouldShow?: ((props: {
        editor: Editor;
        from: number;
        oldState?: EditorState;
        state: EditorState;
        to: number;
        view: EditorView;
    }) => boolean) | null;
    updateDelay?: number;
}
export type BubbleMenuViewProps = BubbleMenuPluginProps & {
    view: EditorView;
};
export declare class BubbleMenuView {
    editor: Editor;
    element: TiptapBubbleMenuHost;
    view: EditorView;
    preventHide: boolean;
    updateDelay: number;
    private updateDebounceTimer;
    private readonly shouldShowFn;
    rectOffset: DOMRect;
    constructor({ editor, element, rectOffset, shouldShow, updateDelay, view, }: BubbleMenuViewProps);
    mousedownHandler: () => void;
    closeMenu: (rootElement: HTMLElement, path: EventTarget[]) => void;
    preventBubbleHandler: (event: Event) => void;
    dragstartHandler: () => void;
    focusHandler: () => void;
    blurHandler: () => void;
    update(view: EditorView, oldState?: EditorState): void;
    handleDebouncedUpdate: (view: EditorView, oldState?: EditorState) => void;
    updateHandler: (view: EditorView, selectionChanged: boolean, docChanged: boolean, oldState?: EditorState) => void;
    show(): void;
    hide(): void;
    destroy(): void;
}
export declare const BubbleMenuPlugin: (options: BubbleMenuPluginProps) => Plugin<any>;
