UNPKG

2.33 kBTypeScriptView Raw
1import { ComponentFactoryResolver } from '@angular/core';
2import { OverlayState } from './overlay-state';
3import { OverlayRef } from './overlay-ref';
4import { OverlayPositionBuilder } from './position/overlay-position-builder';
5import { ViewportRuler } from './position/viewport-ruler';
6import { OverlayContainer } from './overlay-container';
7/**
8 * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
9 * used as a low-level building building block for other components. Dialogs, tooltips, menus,
10 * selects, etc. can all be built using overlays. The service should primarily be used by authors
11 * of re-usable components rather than developers building end-user applications.
12 *
13 * An overlay *is* a PortalHost, so any kind of Portal can be loaded into one.
14 */
15export declare class Overlay {
16 private _overlayContainer;
17 private _componentFactoryResolver;
18 private _positionBuilder;
19 constructor(_overlayContainer: OverlayContainer, _componentFactoryResolver: ComponentFactoryResolver, _positionBuilder: OverlayPositionBuilder);
20 /**
21 * Creates an overlay.
22 * @param state State to apply to the overlay.
23 * @returns A reference to the created overlay.
24 */
25 create(state?: OverlayState): OverlayRef;
26 /**
27 * Returns a position builder that can be used, via fluent API,
28 * to construct and configure a position strategy.
29 */
30 position(): OverlayPositionBuilder;
31 /**
32 * Creates the DOM element for an overlay and appends it to the overlay container.
33 * @returns Promise resolving to the created element.
34 */
35 private _createPaneElement();
36 /**
37 * Create a DomPortalHost into which the overlay content can be loaded.
38 * @param pane The DOM element to turn into a portal host.
39 * @returns A portal host for the given DOM element.
40 */
41 private _createPortalHost(pane);
42 /**
43 * Creates an OverlayRef for an overlay in the given DOM element.
44 * @param pane DOM element for the overlay
45 * @param state
46 * @returns {OverlayRef}
47 */
48 private _createOverlayRef(pane, state);
49}
50/** Providers for Overlay and its related injectables. */
51export declare const OVERLAY_PROVIDERS: (typeof ViewportRuler | typeof OverlayPositionBuilder | typeof OverlayContainer | typeof Overlay)[];