bottom-sheet.d.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 { Overlay } from '@angular/cdk/overlay';
  9. import { ComponentType } from '@angular/cdk/portal';
  10. import { Injector, TemplateRef, InjectionToken, OnDestroy } from '@angular/core';
  11. import { Location } from '@angular/common';
  12. import { MatBottomSheetConfig } from './bottom-sheet-config';
  13. import { MatBottomSheetRef } from './bottom-sheet-ref';
  14. /** Injection token that can be used to specify default bottom sheet options. */
  15. export declare const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS: InjectionToken<MatBottomSheetConfig<any>>;
  16. /**
  17. * Service to trigger Material Design bottom sheets.
  18. */
  19. export declare class MatBottomSheet implements OnDestroy {
  20. private _overlay;
  21. private _injector;
  22. private _parentBottomSheet;
  23. private _location?;
  24. private _defaultOptions?;
  25. private _bottomSheetRefAtThisLevel;
  26. /** Reference to the currently opened bottom sheet. */
  27. _openedBottomSheetRef: MatBottomSheetRef<any> | null;
  28. constructor(_overlay: Overlay, _injector: Injector, _parentBottomSheet: MatBottomSheet, _location?: Location | undefined, _defaultOptions?: MatBottomSheetConfig<any> | undefined);
  29. open<T, D = any, R = any>(component: ComponentType<T>, config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;
  30. open<T, D = any, R = any>(template: TemplateRef<T>, config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;
  31. /**
  32. * Dismisses the currently-visible bottom sheet.
  33. */
  34. dismiss(): void;
  35. ngOnDestroy(): void;
  36. /**
  37. * Attaches the bottom sheet container component to the overlay.
  38. */
  39. private _attachContainer;
  40. /**
  41. * Creates a new overlay and places it in the correct location.
  42. * @param config The user-specified bottom sheet config.
  43. */
  44. private _createOverlay;
  45. /**
  46. * Creates an injector to be used inside of a bottom sheet component.
  47. * @param config Config that was used to create the bottom sheet.
  48. * @param bottomSheetRef Reference to the bottom sheet.
  49. */
  50. private _createInjector;
  51. }