import { type PopupPlacement, type PopupProps } from '@gravity-ui/uikit';
import type { Mark, MarkType, Node, NodeType } from 'prosemirror-model';
import { type PluginView } from 'prosemirror-state';
import type { EditorView } from 'prosemirror-view';
import { type RendererItem } from "../../extensions/index.js";
import "./index.css";
export type BaseTooltipNode = {
    pos: number;
    node: Node;
    dom: HTMLElement | null;
};
export type TooltipContentCb = (view: EditorView, node: BaseTooltipNode, onChange?: (attrs: Record<string, string>) => void, forceEdit?: boolean, onOutsideClick?: () => void) => React.ReactElement | null;
export interface BaseTooltipPluginOptions {
    idPrefix: string;
    content?: TooltipContentCb;
    nodeType: NodeType | MarkType;
    popupPlacement?: PopupPlacement;
    disableHideOnEscapeKeyDown?: boolean;
}
export declare const BaseTooltipCn: import("@bem-react/classname").ClassNameFormatter;
export declare const defaultPlacement: PopupPlacement;
export declare const baseTooltipContentCn: import("@bem-react/classname").ClassNameFormatter;
export type TooltipOnChangeCallback = (attrs: Record<string, string>, options?: {
    setFocus?: boolean;
    setSelection?: boolean;
    hideTooltip?: boolean;
    marks?: Mark[];
}) => void;
export type TooltipContentProps = {
    node: BaseTooltipNode;
    view: EditorView;
    onChange?: TooltipOnChangeCallback;
    toggleEdit?: () => void;
};
export declare class BaseTooltipPluginView implements PluginView {
    protected view: EditorView;
    protected currentNode: BaseTooltipNode | null;
    protected readonly content?: TooltipContentCb;
    protected readonly nodeType: NodeType | MarkType;
    protected readonly popupPlacement?: PopupPlacement;
    protected manualHidden: boolean;
    protected destroyed: boolean;
    protected readonly disableHideOnEscapeKeyDown?: boolean;
    protected focusTrackingRafId: number | null;
    private readonly idPrefix;
    private renderItem?;
    constructor(view: EditorView, options: BaseTooltipPluginOptions);
    update(view: EditorView): void;
    destroy(): void;
    onEscapeDown: () => boolean;
    protected setCurrentNode(node: NodeType): void;
    protected changeAttrsCb: TooltipOnChangeCallback;
    protected updateTooltipView(): void;
    protected render(): void;
    protected onOutsideClick: PopupProps['onOutsideClick'];
    protected popupOpenChangeHandler: PopupProps['onOpenChange'];
    protected startTrackingViewFocus(): void;
    protected stopTrackingViewFocus(): void;
    protected hidePopupManual(): void;
    protected renderContent(currentNode: BaseTooltipNode): React.ReactNode;
    protected createRenderItem(): RendererItem;
}
