export type TooltipConfig = { /** The tooltip text; the tooltip never opens when it is empty. */ text?: () => string | undefined; /** Suppress the tooltip entirely. */ disabled?: () => boolean; /** Show delay in ms after hover/focus. Default 300. */ delay?: () => number; /** Hide delay in ms after leave/blur. Default 0. Give it room for interactive tips. */ closeDelay?: () => number; /** * Delay-group id. Tooltips sharing a group open INSTANTLY while any group * member is open or was open within a short grace window - so scanning a * toolbar of icon buttons does not re-wait the show delay each time. */ group?: () => string | undefined; }; export type TooltipAnchorProps = { 'aria-describedby': string | undefined; onpointerenter: () => void; onpointerleave: () => void; onfocusin: () => void; onfocusout: () => void; }; export type TooltipProps = { id: string; role: 'tooltip'; }; export declare function createTooltip(config?: TooltipConfig): { readonly open: boolean; /** Stable id of the tooltip element (for `aria-describedby` + the tip's id). */ tipId: string; show: () => void; hide: () => void; /** Keep an interactive tip open while the pointer is over it. */ keepOpen: () => void; /** Delayed hide honoring `closeDelay` (pointer/focus leave). */ scheduleHide: () => void; /** Spread onto the anchor/trigger wrapper. Also mirror `tipId` onto the real * focusable child's `aria-describedby` so AT announces it on focus. */ anchorProps: () => TooltipAnchorProps; /** Spread onto the tooltip element. */ tooltipProps: () => TooltipProps; }; export type Tooltip = ReturnType;