UNPKG

2.06 kBTypeScriptView Raw
1import { ApplicationRef, ComponentFactoryResolver } from '@angular/core';
2import { ToastContainerDirective } from '../toastr/toast.directive';
3import { OverlayContainer } from './overlay-container';
4import { OverlayRef } from './overlay-ref';
5import * as i0 from "@angular/core";
6/**
7 * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
8 * used as a low-level building building block for other components. Dialogs, tooltips, menus,
9 * selects, etc. can all be built using overlays. The service should primarily be used by authors
10 * of re-usable components rather than developers building end-user applications.
11 *
12 * An overlay *is* a PortalHost, so any kind of Portal can be loaded into one.
13 */
14export declare class Overlay {
15 private _overlayContainer;
16 private _componentFactoryResolver;
17 private _appRef;
18 private _document;
19 private _paneElements;
20 constructor(_overlayContainer: OverlayContainer, _componentFactoryResolver: ComponentFactoryResolver, _appRef: ApplicationRef, _document: any);
21 /**
22 * Creates an overlay.
23 * @returns A reference to the created overlay.
24 */
25 create(positionClass?: string, overlayContainer?: ToastContainerDirective): OverlayRef;
26 getPaneElement(positionClass?: string, overlayContainer?: ToastContainerDirective): HTMLElement;
27 /**
28 * Creates the DOM element for an overlay and appends it to the overlay container.
29 * @returns Newly-created pane element
30 */
31 private _createPaneElement;
32 /**
33 * Create a DomPortalHost into which the overlay content can be loaded.
34 * @param pane The DOM element to turn into a portal host.
35 * @returns A portal host for the given DOM element.
36 */
37 private _createPortalHost;
38 /**
39 * Creates an OverlayRef for an overlay in the given DOM element.
40 * @param pane DOM element for the overlay
41 */
42 private _createOverlayRef;
43 static ɵfac: i0.ɵɵFactoryDeclaration<Overlay, never>;
44 static ɵprov: i0.ɵɵInjectableDeclaration<Overlay>;
45}