UNPKG

3.82 kBTypeScriptView Raw
1import { AfterContentInit, EventEmitter, OnChanges, SimpleChanges, TemplateRef } from '@angular/core';
2import { Observable } from 'rxjs';
3import * as i0 from "@angular/core";
4/**
5 * This directive allows the usage of HTML markup or other directives
6 * inside of the toast's header.
7 *
8 * @since 5.0.0
9 */
10export declare class NgbToastHeader {
11 static ɵfac: i0.ɵɵFactoryDeclaration<NgbToastHeader, never>;
12 static ɵdir: i0.ɵɵDirectiveDeclaration<NgbToastHeader, "[ngbToastHeader]", never, {}, {}, never, never, true, never>;
13}
14/**
15 * Toasts provide feedback messages as notifications to the user.
16 * Goal is to mimic the push notifications available both on mobile and desktop operating systems.
17 *
18 * @since 5.0.0
19 */
20export declare class NgbToast implements AfterContentInit, OnChanges {
21 ariaLive: string;
22 private _config;
23 private _zone;
24 private _injector;
25 private _element;
26 private _timeoutID;
27 /**
28 * If `true`, toast opening and closing will be animated.
29 *
30 * Animation is triggered only when the `.hide()` or `.show()` functions are called
31 *
32 * @since 8.0.0
33 */
34 animation: boolean;
35 /**
36 * Delay after which the toast will hide (ms).
37 * default: `500` (ms) (inherited from NgbToastConfig)
38 */
39 delay: number;
40 /**
41 * Auto hide the toast after a delay in ms.
42 * default: `true` (inherited from NgbToastConfig)
43 */
44 autohide: boolean;
45 /**
46 * Text to be used as toast's header.
47 * Ignored if a ContentChild template is specified at the same time.
48 */
49 header: string;
50 /**
51 * A template like `<ng-template ngbToastHeader></ng-template>` can be
52 * used in the projected content to allow markup usage.
53 */
54 contentHeaderTpl: TemplateRef<any> | null;
55 /**
56 * An event fired after the animation triggered by calling `.show()` method has finished.
57 *
58 * @since 8.0.0
59 */
60 shown: EventEmitter<void>;
61 /**
62 * An event fired after the animation triggered by calling `.hide()` method has finished.
63 *
64 * It can only occur in 2 different scenarios:
65 * - `autohide` timeout fires
66 * - user clicks on a closing cross
67 *
68 * Additionally this output is purely informative. The toast won't be removed from DOM automatically, it's up
69 * to the user to take care of that.
70 *
71 * @since 8.0.0
72 */
73 hidden: EventEmitter<void>;
74 constructor(ariaLive: string);
75 ngAfterContentInit(): void;
76 ngOnChanges(changes: SimpleChanges): void;
77 /**
78 * Triggers toast closing programmatically.
79 *
80 * The returned observable will emit and be completed once the closing transition has finished.
81 * If the animations are turned off this happens synchronously.
82 *
83 * Alternatively you could listen or subscribe to the `(hidden)` output
84 *
85 * @since 8.0.0
86 */
87 hide(): Observable<void>;
88 /**
89 * Triggers toast opening programmatically.
90 *
91 * The returned observable will emit and be completed once the opening transition has finished.
92 * If the animations are turned off this happens synchronously.
93 *
94 * Alternatively you could listen or subscribe to the `(shown)` output
95 *
96 * @since 8.0.0
97 */
98 show(): Observable<void>;
99 private _init;
100 private _clearTimeout;
101 static ɵfac: i0.ɵɵFactoryDeclaration<NgbToast, [{ attribute: "aria-live"; }]>;
102 static ɵcmp: i0.ɵɵComponentDeclaration<NgbToast, "ngb-toast", ["ngbToast"], { "animation": { "alias": "animation"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "autohide": { "alias": "autohide"; "required": false; }; "header": { "alias": "header"; "required": false; }; }, { "shown": "shown"; "hidden": "hidden"; }, ["contentHeaderTpl"], ["*"], true, never>;
103}