import { ElementRef, NgZone, OnDestroy, ViewContainerRef } from '@angular/core'; import { Overlay, OverlayRef } from '@angular/cdk/overlay'; import { Directionality } from '@angular/cdk/bidi'; import { Subject } from 'rxjs'; import { HcPopComponent } from './popover.component'; import { HcPopoverOpenOptions } from './types'; import { HcPopoverAnchorDirective } from './directives/popover-anchor.directive'; export declare class HcPopoverAnchoringService implements OnDestroy { private _overlay; private _ngZone; private _dir; /** Emits when the popover is opened. */ popoverOpened: Subject; /** Emits when the popover is closed. */ popoverClosed: Subject; /** Reference to the overlay containing the popover component. */ _overlayRef: OverlayRef | null; /** Reference to the target popover. */ private _popover; /** Stores the context assigned to the popover */ _context: any; /** Reference to the view container for the popover template. */ private _viewContainerRef; /** Reference to the anchor */ private _anchor; /** Reference to a template portal where the overlay will be attached. */ private _portal; /** Communications channel with the popover. */ private _notifications; /** Single subscription to notifications service events. */ private _notificationsSubscription; /** Single subscription to position changes. */ private _positionChangeSubscription; /** Whether the popover is presently open. */ private _popoverOpen; /** Emits when the service is destroyed. */ private _onDestroy; constructor(_overlay: Overlay, _ngZone: NgZone, _dir: Directionality); ngOnDestroy(): void; /** Anchor a popover instance to a view and connection element. */ anchor(popover: HcPopComponent, viewContainerRef: ViewContainerRef, anchor: HcPopoverAnchorDirective): void; /** Gets whether the popover is presently open. */ isPopoverOpen(): boolean; /** Toggles the popover between the open and closed states. */ togglePopover(): void; /** Opens the popover. */ openPopover(options?: HcPopoverOpenOptions): void; /** Closes the popover. */ closePopover(value?: any): void; /** Realign the popover to the anchor. */ realignPopoverToAnchor(): void; /** Get a reference to the anchor element. */ getAnchorElement(): ElementRef; /** Apply behavior properties on the popover based on the open options. */ private _applyOpenOptions; /** Create an overlay to be attached to the portal. */ private _createOverlay; /** Removes the popover from the DOM. Does NOT update open state. */ private _destroyPopover; /** * Destroys the popover immediately if it is closed, or waits until it * has been closed to destroy it. */ private _destroyPopoverOnceClosed; /** * Call appropriate anchor method when an event is dispatched through * the notification service. */ private _subscribeToNotifications; /** Close popover when backdrop is clicked. */ private _subscribeToBackdrop; /** Close popover when escape keydown event occurs. */ private _subscribeToEscape; /** Set state back to closed when detached. */ private _subscribeToDetachments; /** Save the opened state of the popover and emit. */ private _saveOpenedState; /** Save the closed state of the popover and emit. */ private _saveClosedState; /** Gets the text direction of the containing app. */ private _getDirection; /** Create and return a config for creating the overlay. */ private _getOverlayConfig; /** * Listen to changes in the position of the overlay and set the correct alignment classes, * ensuring that the animation origin is correct, even with a fallback position. */ private _subscribeToPositionChanges; /** Map a scroll strategy string type to an instance of a scroll strategy. */ private _getScrollStrategyInstance; /** Create and return a position strategy based on config provided to the component instance. */ private _getPositionStrategy; /** Get fallback positions based around target alignments. */ private _getFallbacks; }