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 { OverlayRef } from '@angular/cdk/overlay';
|
---|
9 | import { Observable } from 'rxjs';
|
---|
10 | import { _SnackBarContainer } from './snack-bar-container';
|
---|
11 | /** Event that is emitted when a snack bar is dismissed. */
|
---|
12 | export interface MatSnackBarDismiss {
|
---|
13 | /** Whether the snack bar was dismissed using the action button. */
|
---|
14 | dismissedByAction: boolean;
|
---|
15 | }
|
---|
16 | /**
|
---|
17 | * Reference to a snack bar dispatched from the snack bar service.
|
---|
18 | */
|
---|
19 | export declare class MatSnackBarRef<T> {
|
---|
20 | private _overlayRef;
|
---|
21 | /** The instance of the component making up the content of the snack bar. */
|
---|
22 | instance: T;
|
---|
23 | /**
|
---|
24 | * The instance of the component making up the content of the snack bar.
|
---|
25 | * @docs-private
|
---|
26 | */
|
---|
27 | containerInstance: _SnackBarContainer;
|
---|
28 | /** Subject for notifying the user that the snack bar has been dismissed. */
|
---|
29 | private readonly _afterDismissed;
|
---|
30 | /** Subject for notifying the user that the snack bar has opened and appeared. */
|
---|
31 | private readonly _afterOpened;
|
---|
32 | /** Subject for notifying the user that the snack bar action was called. */
|
---|
33 | private readonly _onAction;
|
---|
34 | /**
|
---|
35 | * Timeout ID for the duration setTimeout call. Used to clear the timeout if the snackbar is
|
---|
36 | * dismissed before the duration passes.
|
---|
37 | */
|
---|
38 | private _durationTimeoutId;
|
---|
39 | /** Whether the snack bar was dismissed using the action button. */
|
---|
40 | private _dismissedByAction;
|
---|
41 | constructor(containerInstance: _SnackBarContainer, _overlayRef: OverlayRef);
|
---|
42 | /** Dismisses the snack bar. */
|
---|
43 | dismiss(): void;
|
---|
44 | /** Marks the snackbar action clicked. */
|
---|
45 | dismissWithAction(): void;
|
---|
46 | /**
|
---|
47 | * Marks the snackbar action clicked.
|
---|
48 | * @deprecated Use `dismissWithAction` instead.
|
---|
49 | * @breaking-change 8.0.0
|
---|
50 | */
|
---|
51 | closeWithAction(): void;
|
---|
52 | /** Dismisses the snack bar after some duration */
|
---|
53 | _dismissAfter(duration: number): void;
|
---|
54 | /** Marks the snackbar as opened */
|
---|
55 | _open(): void;
|
---|
56 | /** Cleans up the DOM after closing. */
|
---|
57 | private _finishDismiss;
|
---|
58 | /** Gets an observable that is notified when the snack bar is finished closing. */
|
---|
59 | afterDismissed(): Observable<MatSnackBarDismiss>;
|
---|
60 | /** Gets an observable that is notified when the snack bar has opened and appeared. */
|
---|
61 | afterOpened(): Observable<void>;
|
---|
62 | /** Gets an observable that is notified when the snack bar action is called. */
|
---|
63 | onAction(): Observable<void>;
|
---|
64 | }
|
---|