import { ThemeContext, TooltipContentData } from '../../shared/kernel'; import { ColorValue, FontOptions, PaddingValue, Pixels, Switchable } from '../../shared/options'; export interface TooltipOptions extends Switchable, FontOptions { /** single — the nearest node; shared — values of all series in the category. */ mode?: 'single' | 'shared'; /** * Capture area: a number — radius in px (30), 'exact' — only direct hits * on a node, 'nearest' — the nearest node from anywhere in the plot area. */ range?: Pixels | 'exact' | 'nearest'; /** Positioning: at the node edge (by default), at the node center, or at the pointer. */ position?: { anchorTo?: 'node' | 'center' | 'pointer'; xOffset?: Pixels; yOffset?: Pixels; }; /** * Where the tooltip element lives. 'chart' (by default) — inside the chart * container, positioned in its coordinates and kept within its bounds. * 'body' — in document.body with position: fixed, kept within the viewport, * so ancestors with overflow: hidden don't clip it. An element — appended * there and positioned like 'body' (an app's own overlay layer). */ container?: 'chart' | 'body' | HTMLElement; /** CSS z-index of the tooltip element: 10 inside the chart, 1000 outside it. */ zIndex?: number; /** Container background (theme background by default). */ background?: ColorValue; /** Border color (theme muted color by default). */ borderColor?: ColorValue; /** Border width; 0 removes the border. */ borderWidth?: Pixels; borderRadius?: Pixels; /** CSS box-shadow; false removes the shadow. */ shadow?: string | false; /** * Inner padding of the container: `8`, `[8, 12]`, `[8, 12, 4, 0]`, * `{ top, right, bottom, left }` — or a raw CSS string. */ padding?: PaddingValue | string; } /** * HTML tooltip (DOM, not canvas): an absolutely positioned element inside the * chart container — or, with `container: 'body'` or an element, a fixed one * outside it that the chart's clipping ancestors can't cut. */ export declare class HtmlTooltip { private readonly container; private readonly element; /** Lives outside the chart container, positioned against the viewport. */ private detached; /** A fixed tooltip would stay put while the page slides under it, so scrolling hides it. */ private readonly onViewportChange; constructor(container: HTMLElement); show(content: TooltipContentData, x: number, y: number, theme: ThemeContext, options?: TooltipOptions): void; /** Whether it is on screen — a tooltip already shown is one worth re-reading when the data moves. */ get visible(): boolean; hide(): void; destroy(): void; /** Moves the element to its host: the chart container (undefined) or an element outside it. */ private attach; private buildContent; private buildSwatch; } /** Feature API for widgets (via registry.getFeature('tooltip')). */ export declare const tooltipApi: { create: (container: HTMLElement) => HtmlTooltip; }; export type TooltipApi = typeof tooltipApi; export declare const tooltipModule: { readonly kind: "feature"; readonly name: "tooltip"; readonly api: { create: (container: HTMLElement) => HtmlTooltip; }; };