import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, Renderer2, SimpleChange, SimpleChanges } from '@angular/core'; import * as i0 from "@angular/core"; export type Placement = 'top' | 'right' | 'bottom' | 'left'; type Position = { top?: number; right?: number; bottom?: number; left?: number; }; /** * A tooltip is a text label that acts as a helper to a specific item. * Recommended to use value `top` or `bottom` with `placement` for responsive design. * Dynamic resizing and tooltip position are a work in progress. * https://designlibrary.sebgroup.com/components/component-tooltip */ export declare class NggvTooltipDirective implements AfterViewInit, OnChanges, OnDestroy { private anchorElementRef; private renderer; /** The text that will be shown in the tooltip. */ nggvTooltip?: string; /** Special property used for selecting DOM elements during automated UI testing. */ thook: string; /** The side of the anchor which the tooltip will be rendered. * Recommended `top` and `bottom` for responsive designs as these are more stable. */ placement: Placement; /** Initial state and subsequent updates on wether the tooltip is visible. */ shown: boolean; /** How far off from the text the tooltip will be rendered. */ offset: number; /** How frequently the tooltip will be re-rendered when the page size changes. */ resizeThrottle: number; /** Id of tooltip element. */ tooltipId?: string; /** Numeric max-width for tooltip. */ maxWidth: number; /** Emits a show event triggered changing visibility state of the tooltip. */ nggvShow: EventEmitter; /** Emits a hide event triggered changing visibility state of the tooltip. */ nggvHide: EventEmitter; /** @internal */ protected timeout: number; /** @internal */ protected parentElement: HTMLElement; /** @internal */ protected anchorElement: HTMLElement; /** @internal */ protected tooltipElement: HTMLElement | undefined; /** @internal */ protected arrowElement: HTMLElement | undefined; /** @internal Check if changes should trigger a re-render */ static shouldUpdate(change: SimpleChange): boolean; constructor(anchorElementRef: ElementRef, renderer: Renderer2); ngAfterViewInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; /** @internal */ onMouseEnter(): void; /** @internal */ onMouseLeave(): void; /** @internal */ resize(): void; /** * Sets the visibility state of the tooltip to true and creates a new tooltip if it doesn't exist or `recreate` is set. * @param recreate if set to true, destroy any existing tooltip and create a new one. */ show(recreate?: boolean): void; /** * Sets the visibility state of the tooltip to false and destroys an existing tooltip if `destroy` is set. * @param destroy if set to true, destroy any existing tooltip. */ hide(destroy?: boolean): void; /** * @internal * Creates a new tooltip with the set placement and a given text as its body. * @param text the string to be displayed in the tooltip body. */ create(text: string): void; /** * @internal * Destroys the current tooltip by un-setting variables, should only be used after detaching elements from the DOM. */ destroy(): void; /** * @internal * Recalculates the position of the tooltip. */ updatePosition(): void; /** * @internal * Calculates and set the position of the tooltip when the placement is `top` or `bottom`. */ alignVertical(above: boolean, scrollPos: number, anchor: DOMRect, tooltipWidth: number, tooltipHeight: number, arrowWidth: number): void; /** * @internal * Calculates and set the position of the tooltip when the placement is `left` or `right`. */ alignHorizontal(before: boolean, scrollPos: number, anchor: DOMRect, tooltipHeight: number): void; /** * @internal * Updates the CSS properties for the tooltip position. */ setStyle(tooltip: Position, arrow: Position): void; private pxToRem; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export {};