import { Type, ViewContainerRef } from '@angular/core'; import { ComponentFactoryResolver, Injector } from '@angular/core'; import { OverlayContainerComponent } from '../components/overlays/overlay-container/overlay-container.component'; import { DynamicBaseComponent } from '../components/overlays/dynamic-base.component'; import { Subscription } from 'rxjs'; export declare class OverlayService { private _cfr; private injector; static instance: any; private cmp_reg; private cmp_list; private containers; private container_services; private default_vc; private _view; constructor(_cfr: ComponentFactoryResolver, injector: Injector); /** * Sets the view to attach the notification display, usually the root component * @param view View Container to attach the notifications display */ view: ViewContainerRef; /** * Attempts to load the root view container */ loadView(tries?: number): void; /** * Define a component that can be rendered on the overlay * @param id ID of the component * @param type Component Type * @param data Initial data to pass to the component */ setup(id: string, cmp: Type, data?: { [name: string]: any; }): void; /** * Defines a modal that can be rendered on the overlay * @param id ID of the modal * @param data Initial data to pass to the modal */ setupModal(id: string, data?: { [name: string]: any; }): void; /** * Defines a tooltip that can be rendered on the overlay * @param id ID of the tooltip * @param data Initial data to pass to the tooltip */ setupTooltip(id: string, data?: { [name: string]: any; }): void; /** * Register a component that can be rendered on the overlay * @param id ID of the component * @param type Component Type * @param data Initial data to pass to the component */ register(id: string, cmp: Type, data?: { [name: string]: any; }): void; /** * Function to register a component attached to an overlay * @param id ID of the component * @param type Component Type */ registerComponent(id: string, cmp: Type): void; /** * Open predefined modal with the given data * @param id ID of the component * @param next Callback for events on the modal * @param data Initial data to pass to the component * @return Promise of an observable for events on the open modal */ openModal(id: string, data?: { [name: string]: any; }, next?: (event: any) => void, cntr?: string): Promise; /** * Open predefined modal with the given data * @param id ID of the component * @param data Initial data to pass to the component * @param action Callback for events on the notification * @return Promise of an observable for events on the notification */ notify(id: string, data?: { [name: string]: any; }, action?: () => void, cntr?: string): () => void; /** * Open predefined tooltip with the given data * @param id ID of the component * @param data Initial data to pass to the component * @return Promise of an observable for events on the tooltip */ openTooltip(id: string, data?: { [name: string]: any; }): Promise; /** * Create/Open component on the overlay * @param c_id ID of the container to render the component * @param id ID of the component * @param type Component Type * @param data Initial data to pass to the component * @return Promise of instance of the created component */ add(c_id: string, id: string, cmp: Type | string, data?: { [name: string]: any; }, next?: (value: any) => void): Promise; /** * Removes the component with the given id from the container * @param c_id ID of the container * @param id ID of the component */ remove(c_id: string, id: string): void; /** * Updates the model of the component with the given ID on the container * @param c_id ID of the container. Defaults to root * @param id ID of the component * @param data New data to pass to the component */ set(c_id: string, id: string, data: { [name: string]: any; }): void; /** * Get the component instance with the given id from the container * @param c_id ID of the container. Defaults to root * @param id ID of the component * @returns Component with the given ID or null */ get(c_id: string, id: string): any; /** * Listen to events of component on the specified overlay container * @param c_id ID of the overlay container * @param id ID of the component * @param next Callback for emitted event from the component */ listen(c_id: string, id: string, next: (event: any) => {}): Subscription; /** * Closes all components in the overlay space */ clear(id?: string): void; /** * Registers an overlay container with the given ID * @param id ID of the container * @param container Overlay container instance */ registerContainer(id: string, container: OverlayContainerComponent): void; /** * Registers the service to inject into overlay components * @param service Service instance to inject into components * @param id ID of the service. Defaults to global */ registerService(service: any, id?: string): void; /** * Gets the specifed service * @param id ID of the service to get. Defaults to global * @returns Service with the specified ID or null */ getService(id?: string): any; /** * Clears the overlay container with the given ID * @param id ID of the container to clear. Defaults to root */ clearContainer(id?: string): void; /** * Merges the two given objects * @param dest Destination object * @param src Source object * @returns Merged destination object */ private merge; /** * Creates the root overlay container */ private renderRootContainer; }