import uPlot from 'uplot';
import Yagr from '../../index';
import { ProcessingInterpolation, YagrPlugin } from '../../types';
import { TooltipOptions, TooltipHandler, TooltipData, TooltipState, TooltipAction } from './types';
export type TooltipPlugin = YagrPlugin<{
    state: TooltipState;
    pin(pinState: boolean, position?: {
        x: number;
        y: number;
    }): void;
    show(): void;
    hide(): void;
    updateOptions: (o: Partial<TooltipOptions>) => void;
    on: (event: TooltipAction, handler: TooltipHandler) => void;
    off: (event: TooltipAction, handler: TooltipHandler) => void;
    display: (props: {
        left: number;
        top: number;
        idx: number;
    }) => void;
    tooltip: YagrTooltip;
    dispose: () => void;
    reInit: (u: uPlot) => void;
    reset: () => void;
}, [
    Partial<TooltipOptions>
]>;
declare class YagrTooltip {
    handlers: Record<TooltipAction, TooltipHandler[]>;
    private placement;
    private renderTooltipCloses;
    private tOverlay;
    private bound;
    private renderNode;
    /**
     * Flag to skip next mouseup event, used for unpinning
     * tooltip on any mousedown, but continiously pinning on drag
     */
    private skipNextMouseUp;
    yagr: Yagr;
    opts: TooltipOptions;
    state: TooltipState;
    over: HTMLDivElement;
    private bLeft;
    private bTop;
    private bWidth;
    constructor(yagr: Yagr, options?: Partial<TooltipOptions>);
    emit: (action: TooltipAction, data?: TooltipData) => void;
    reset: () => void;
    show: () => void;
    hide: () => void;
    pin: (pinState: boolean, position?: {
        x: number;
        y: number;
    }) => void;
    checkFocus: (event: MouseEvent) => void;
    render: (props: {
        left: number;
        top: number;
        idx: number;
    }) => void;
    initWithUplot: (u: uPlot) => void;
    setSize: () => void;
    dispose: () => void;
    updateOptions: (newOptions: Partial<TooltipOptions>) => void;
    on: (event: TooltipAction, handler: TooltipHandler) => void;
    off: (event: TooltipAction, handler: TooltipHandler) => void;
    private mountTooltip;
    private detectClickOutside;
    private onMouseDown;
    private onMouseMove;
    /**
     * Calculates where exactly cursor leaved the chart
     * and sets range[1] to this position
     */
    private setCursorLeaved;
    private onMouseUp;
    private onMouseEnter;
    private onMouseLeave;
    private defaultTooltipValueFormatter;
    private getCursorPosition;
    get interpolation(): ProcessingInterpolation | undefined;
    get stripValue(): unknown;
    get isNotInDrag(): boolean;
}
declare function YagrTooltipPlugin(yagr: Yagr, options?: Partial<TooltipOptions>): ReturnType<TooltipPlugin>;
export default YagrTooltipPlugin;
