UNPKG

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