import { AfterViewInit, ElementRef, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'; import { Platform } from '@angular/cdk/platform'; import { OriginConnectionPosition, Overlay, OverlayConnectionPosition, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay'; import { MatTooltipDefaultOptions, TooltipComponent, TooltipTouchGestures } from '@angular/material/tooltip'; import { AriaDescriber, FocusMonitor } from '@angular/cdk/a11y'; import { Directionality } from '@angular/cdk/bidi'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import * as i0 from "@angular/core"; /** Possible positions for a tooltip. */ export declare type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | 'after'; export declare class TooltipDirective implements OnDestroy, AfterViewInit { private _overlay; private _elementRef; private _scrollDispatcher; private _viewContainerRef; private _ngZone; private _platform; private _ariaDescriber; private _focusMonitor; private _dir; private _defaultOptions; constructor(_overlay: Overlay, _elementRef: ElementRef, _scrollDispatcher: ScrollDispatcher, _viewContainerRef: ViewContainerRef, _ngZone: NgZone, _platform: Platform, _ariaDescriber: AriaDescriber, _focusMonitor: FocusMonitor, scrollStrategy: any, _dir: Directionality, _defaultOptions: MatTooltipDefaultOptions); /** Allows the user to define the position of the tooltip relative to the parent element */ get position(): TooltipPosition; set position(value: TooltipPosition); /** Disables the display of the tooltip. */ get disabled(): boolean; set disabled(value: boolean); /** The message to be displayed in the tooltip */ get message(): string; set message(value: string); /** Classes to be passed to the tooltip. Supports the same syntax as `ngClass`. */ get tooltipClass(): string | string[] | Set | { [key: string]: any; }; set tooltipClass(value: string | string[] | Set | { [key: string]: any; }); static ngAcceptInputType_disabled: BooleanInput; static ngAcceptInputType_hideDelay: NumberInput; static ngAcceptInputType_showDelay: NumberInput; _overlayRef: OverlayRef | undefined; _tooltipInstance: TooltipComponent | undefined; private _portal; private _position; private _disabled; private _tooltipClass; private readonly _scrollStrategy; private _viewInitialized; private _pointerExitEventsInitialized; /** The default delay in ms before showing the tooltip after show is called */ showDelay: number; /** The default delay in ms before hiding the tooltip after hide is called */ hideDelay: number; /** * How touch gestures should be handled by the tooltip. On touch devices the tooltip directive * uses a long press gesture to show and hide, however it can conflict with the native browser * gestures. To work around the conflict, Angular Material disables native gestures on the * trigger, but that might not be desirable on particular elements (e.g. inputs and draggable * elements). The different values for this option configure the touch event handling as follows: * - `auto` - Enables touch gestures for all elements, but tries to avoid conflicts with native * browser gestures on particular elements. In particular, it allows text event on inputs * and textareas, and preserves the native browser dragging on elements marked as `draggable`. * - `on` - Enables touch gestures for all elements and disables native * browser gestures with no exceptions. * - `off` - Disables touch gestures. Note that this will prevent the tooltip from * showing on touch devices. */ touchGestures: TooltipTouchGestures; private _message; /** Manually-bound passive event listeners. */ private readonly _passiveListeners; /** Timer started at the last `touchstart` event. */ private _touchstartTimeout; /** Emits when the component is destroyed. */ private readonly _destroyed; ngAfterViewInit(): void; /** * Dispose the tooltip when destroyed. */ ngOnDestroy(): void; /** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */ show(delay?: number): void; /** Hides the tooltip after the delay in ms, defaults to tooltip-delay-hide or 0ms if no input */ hide(delay?: number): void; /** Shows/hides the tooltip */ toggle(): void; /** Returns true if the tooltip is currently visible to the user */ _isTooltipVisible(): boolean; /** * Handles the keydown events on the host element. * Needs to be an arrow function so that we can use it in addEventListener. */ private _handleKeydown; /** Create the overlay config and position strategy */ private _createOverlay; /** Detaches the currently-attached tooltip. */ private _detach; /** Updates the position of the current tooltip. */ private _updatePosition; /** * Returns the origin position and a fallback position based on the user's position preference. * The fallback position is the inverse of the origin (e.g. `'below' -> 'above'`). */ _getOrigin(): { main: OriginConnectionPosition; fallback: OriginConnectionPosition; }; /** Returns the overlay position and a fallback position based on the user's preference */ _getOverlayPosition(): { main: OverlayConnectionPosition; fallback: OverlayConnectionPosition; }; /** Updates the tooltip message and repositions the overlay according to the new message length */ private _updateTooltipMessage; /** Updates the tooltip class */ private _setTooltipClass; /** Inverts an overlay position. */ private _invertPosition; /** Binds the pointer events to the tooltip trigger. */ private _setupPointerEnterEventsIfNeeded; private _setupPointerExitEventsIfNeeded; private _addListeners; private _platformSupportsMouseEvents; /** Disables the native browser gestures, based on how the tooltip has been configured. */ private _disableNativeGesturesIfNecessary; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; }