import { ComponentRef } from '@angular/core'; import { Observable } from 'rxjs'; export declare enum NbTrigger { CLICK = "click", HOVER = "hover", HINT = "hint", FOCUS = "focus" } /** * Provides entity with two event stream: show and hide. * Each stream provides different events depends on implementation. * We have three main trigger strategies: click, hint and hover. * */ /** * TODO maybe we have to use renderer.listen instead of observableFromEvent? * Renderer provides capability use it in service worker, ssr and so on. * */ export declare abstract class NbTriggerStrategy { protected document: Document; protected host: HTMLElement; protected container: () => ComponentRef; protected isNotOnHostOrContainer(event: Event): boolean; protected isOnHostOrContainer(event: Event): boolean; protected isOnHost({ target }: Event): boolean; protected isOnContainer({ target }: Event): boolean; abstract show$: Observable; abstract hide$: Observable; constructor(document: Document, host: HTMLElement, container: () => ComponentRef); } /** * Creates show and hide event streams. * Fires toggle event when the click was performed on the host element. * Fires close event when the click was performed on the document but * not on the host or container. * */ export declare class NbClickTriggerStrategy extends NbTriggerStrategy { protected click$: Observable<[boolean, Event]>; readonly show$: Observable; readonly hide$: Observable; } /** * Creates show and hide event streams. * Fires open event when a mouse hovers over the host element and stay over at least 100 milliseconds. * Fires close event when the mouse leaves the host element and stops out of the host and popover container. * */ export declare class NbHoverTriggerStrategy extends NbTriggerStrategy { show$: Observable; hide$: Observable; } /** * Creates show and hide event streams. * Fires open event when a mouse hovers over the host element and stay over at least 100 milliseconds. * Fires close event when the mouse leaves the host element. * */ export declare class NbHintTriggerStrategy extends NbTriggerStrategy { show$: Observable; hide$: Observable; } /** * Creates show and hide event streams. * Fires open event when a focus is on the host element and stay over at least 100 milliseconds. * Fires close event when the focus leaves the host element. * */ export declare class NbFocusTriggerStrategy extends NbTriggerStrategy { protected focusOut$: Observable; protected clickIn$: Observable; protected clickOut$: Observable; protected tabKeyPress$: Observable; show$: Observable; hide$: Observable; } export declare class NbTriggerStrategyBuilder { protected _host: HTMLElement; protected _container: () => ComponentRef; protected _trigger: NbTrigger; protected _document: Document; document(document: Document): this; trigger(trigger: NbTrigger): this; host(host: HTMLElement): this; container(container: () => ComponentRef): this; build(): NbTriggerStrategy; }