overlay.d.ts 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * @license
  3. * Copyright Google LLC All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. import { Directionality } from '@angular/cdk/bidi';
  9. import { Location } from '@angular/common';
  10. import { ComponentFactoryResolver, Injector, NgZone } from '@angular/core';
  11. import { OverlayKeyboardDispatcher } from './keyboard/overlay-keyboard-dispatcher';
  12. import { OverlayConfig } from './overlay-config';
  13. import { OverlayContainer } from './overlay-container';
  14. import { OverlayRef } from './overlay-ref';
  15. import { OverlayPositionBuilder } from './position/overlay-position-builder';
  16. import { ScrollStrategyOptions } from './scroll/index';
  17. /**
  18. * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
  19. * used as a low-level building block for other components. Dialogs, tooltips, menus,
  20. * selects, etc. can all be built using overlays. The service should primarily be used by authors
  21. * of re-usable components rather than developers building end-user applications.
  22. *
  23. * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
  24. */
  25. export declare class Overlay {
  26. /** Scrolling strategies that can be used when creating an overlay. */
  27. scrollStrategies: ScrollStrategyOptions;
  28. private _overlayContainer;
  29. private _componentFactoryResolver;
  30. private _positionBuilder;
  31. private _keyboardDispatcher;
  32. private _injector;
  33. private _ngZone;
  34. private _document;
  35. private _directionality;
  36. private _location?;
  37. private _appRef;
  38. constructor(
  39. /** Scrolling strategies that can be used when creating an overlay. */
  40. scrollStrategies: ScrollStrategyOptions, _overlayContainer: OverlayContainer, _componentFactoryResolver: ComponentFactoryResolver, _positionBuilder: OverlayPositionBuilder, _keyboardDispatcher: OverlayKeyboardDispatcher, _injector: Injector, _ngZone: NgZone, _document: any, _directionality: Directionality, _location?: Location | undefined);
  41. /**
  42. * Creates an overlay.
  43. * @param config Configuration applied to the overlay.
  44. * @returns Reference to the created overlay.
  45. */
  46. create(config?: OverlayConfig): OverlayRef;
  47. /**
  48. * Gets a position builder that can be used, via fluent API,
  49. * to construct and configure a position strategy.
  50. * @returns An overlay position builder.
  51. */
  52. position(): OverlayPositionBuilder;
  53. /**
  54. * Creates the DOM element for an overlay and appends it to the overlay container.
  55. * @returns Newly-created pane element
  56. */
  57. private _createPaneElement;
  58. /**
  59. * Creates the host element that wraps around an overlay
  60. * and can be used for advanced positioning.
  61. * @returns Newly-create host element.
  62. */
  63. private _createHostElement;
  64. /**
  65. * Create a DomPortalOutlet into which the overlay content can be loaded.
  66. * @param pane The DOM element to turn into a portal outlet.
  67. * @returns A portal outlet for the given DOM element.
  68. */
  69. private _createPortalOutlet;
  70. }