import { LitElement, type CSSResultGroup, type PropertyValues, type TemplateResult } from "lit"; import { HideEvent, ShowEvent } from "./events.ts"; interface TapsiTooltipEventMap extends HTMLElementEventMap { [HideEvent.type]: HideEvent; [ShowEvent.type]: ShowEvent; } /** * @summary A simple text popup box. * * @tag tapsi-tooltip * * @fires {ShowEvent} show - Fires when the tooltip should be visible. (cancelable) * @fires {HideEvent} hide - Fires when the tooltip should be hidden. (cancelable) */ export declare class Tooltip extends LitElement { /** @internal */ static readonly styles: CSSResultGroup; /** @internal */ addEventListener: (type: K, listener: (this: Tooltip, ev: TapsiTooltipEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void; /** @internal */ removeEventListener: (type: K, listener: (this: Tooltip, ev: TapsiTooltipEventMap[K]) => void, options?: boolean | EventListenerOptions) => void; /** * Controls how to position the tooltip relative to the anchor. * * @prop {"top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end"} placement * @attr {"top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end"} placement * @default "top" */ placement: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end"; /** * Whether tooltip is dismissable or not. * * @prop {boolean} dismissible * @attr {string} dismissible * @default false */ dismissible: boolean; /** * The text content of the tooltip. * * @prop {string} text * @attr {string} text * @default "" */ text: string; /** * The id of the anchor element. * * @prop {string} anchor * @attr {string} anchor * @default "" */ anchor: string; /** * Whether the tooltip is visible or not. * * @prop {boolean} visible * @attr {string} visible * @default false */ visible: boolean; /** * Whether to prevent showing tooltip on hover or not. * * @prop {boolean} noHoverActivation * @attr {string} no-hover-activation * @default false */ noHoverActivation: boolean; /** * Whether to prevent showing tooltip on focus or not. * * @prop {boolean} noFocusActivation * @attr {string} no-focus-activation * @default false */ noFocusActivation: boolean; /** * Whether to hide tooltip on escape or not. * * @prop {boolean} noEscapeDeactivation * @attr {string} no-escape-deactivation * @default false */ noEscapeDeactivation: boolean; private _tooltipElement; private _arrowElement; private _tooltipPosition; private _arrowPosition; constructor(); /** @internal */ connectedCallback(): void; /** @internal */ disconnectedCallback(): void; protected updated(changed: PropertyValues): void; /** * Forces the tooltip to display. */ show(): void; /** * Forces the tooltip to hide. */ hide(): void; /** * Calculates and updates the position of the tooltip based on * Its anchor element. */ updateTooltipPosition(): Promise; private _getAnchorElement; private _handleKeyDown; private _handleTriggerShowByEvent; private _handleTriggerHideByEvent; private _handleAnchorMouseEnter; private _handleAnchorMouseLeave; private _renderDismissButton; protected render(): TemplateResult; } export {};