UNPKG

1.99 kBTypeScriptView Raw
1import { EventEmitter, Renderer2, ElementRef, OnChanges, OnInit, SimpleChanges, NgZone } from '@angular/core';
2import { Observable } from 'rxjs';
3import { NgbAlertConfig } from './alert-config';
4/**
5 * Alert is a component to provide contextual feedback messages for user.
6 *
7 * It supports several alert types and can be dismissed.
8 */
9export declare class NgbAlert implements OnInit, OnChanges {
10 private _renderer;
11 private _element;
12 private _zone;
13 /**
14 * If `true`, alert closing will be animated.
15 *
16 * Animation is triggered only when clicked on the close button (×)
17 * or via the `.close()` function
18 *
19 * @since 8.0.0
20 */
21 animation: boolean;
22 /**
23 * If `true`, alert can be dismissed by the user.
24 *
25 * The close button (×) will be displayed and you can be notified
26 * of the event with the `(close)` output.
27 */
28 dismissible: boolean;
29 /**
30 * Type of the alert.
31 *
32 * Bootstrap provides styles for the following types: `'success'`, `'info'`, `'warning'`, `'danger'`, `'primary'`,
33 * `'secondary'`, `'light'` and `'dark'`.
34 */
35 type: string;
36 /**
37 * An event emitted when the close button is clicked. It has no payload and only relevant for dismissible alerts.
38 *
39 * @since 8.0.0
40 */
41 closed: EventEmitter<void>;
42 constructor(config: NgbAlertConfig, _renderer: Renderer2, _element: ElementRef, _zone: NgZone);
43 /**
44 * Triggers alert closing programmatically (same as clicking on the close button (×)).
45 *
46 * The returned observable will emit and be completed once the closing transition has finished.
47 * If the animations are turned off this happens synchronously.
48 *
49 * Alternatively you could listen or subscribe to the `(closed)` output
50 *
51 * @since 8.0.0
52 */
53 close(): Observable<void>;
54 ngOnChanges(changes: SimpleChanges): void;
55 ngOnInit(): void;
56}