snack-bar-config.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 { ViewContainerRef, InjectionToken } from '@angular/core';
  9. import { AriaLivePoliteness } from '@angular/cdk/a11y';
  10. import { Direction } from '@angular/cdk/bidi';
  11. /** Injection token that can be used to access the data that was passed in to a snack bar. */
  12. export declare const MAT_SNACK_BAR_DATA: InjectionToken<any>;
  13. /** Possible values for horizontalPosition on MatSnackBarConfig. */
  14. export declare type MatSnackBarHorizontalPosition = 'start' | 'center' | 'end' | 'left' | 'right';
  15. /** Possible values for verticalPosition on MatSnackBarConfig. */
  16. export declare type MatSnackBarVerticalPosition = 'top' | 'bottom';
  17. /**
  18. * Configuration used when opening a snack-bar.
  19. */
  20. export declare class MatSnackBarConfig<D = any> {
  21. /** The politeness level for the MatAriaLiveAnnouncer announcement. */
  22. politeness?: AriaLivePoliteness;
  23. /**
  24. * Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom
  25. * component or template, the announcement message will default to the specified message.
  26. */
  27. announcementMessage?: string;
  28. /** The view container to place the overlay for the snack bar into. */
  29. viewContainerRef?: ViewContainerRef;
  30. /** The length of time in milliseconds to wait before automatically dismissing the snack bar. */
  31. duration?: number;
  32. /** Extra CSS classes to be added to the snack bar container. */
  33. panelClass?: string | string[];
  34. /** Text layout direction for the snack bar. */
  35. direction?: Direction;
  36. /** Data being injected into the child component. */
  37. data?: D | null;
  38. /** The horizontal position to place the snack bar. */
  39. horizontalPosition?: MatSnackBarHorizontalPosition;
  40. /** The vertical position to place the snack bar. */
  41. verticalPosition?: MatSnackBarVerticalPosition;
  42. }