overlay.d.ts 1.9 KB

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