UNPKG

ng-alertbar

Version:

A configurable alertbar for Angular

78 lines (77 loc) 2.75 kB
import { EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import { AlertTrigger } from './interface'; import { NgAlertbarService } from './ng-alertbar.service'; export declare class NgAlertbarComponent implements OnInit, OnDestroy { private alertBarService; private domSanitizer; private queue; private queuePop; queueing: boolean; lifeTime: number; showDelay: number; backgroundColor: string; tempBackgroundColor: string; borderColor: string; tempBorderColor: string; textColor: string; tempTextColor: string; widthMode: string; tempWidthMode: 'full' | 'partial'; closeButton: boolean; tempCloseButton: boolean; html: boolean; tempHtml: boolean; open: EventEmitter<AlertTrigger>; close: EventEmitter<void>; show: boolean; message: string; private destroy; readonly isFullWidth: boolean; readonly showCloseButton: boolean; readonly useHtml: boolean; readonly htmlMessage: import("@angular/platform-browser/src/security/dom_sanitization_service").SafeHtml; /** * The trigger stream after waiting the specified showDelay since the alert was triggered */ readonly openTriggerPostDelay$: import("rxjs/internal/Observable").Observable<AlertTrigger>; /** * The trigger stream after waiting the specified lifetime since the alert opened */ readonly postAlertLifetime$: import("rxjs/internal/Observable").Observable<number>; /** * The service cancel trigger */ readonly cancelTrigger$: import("rxjs/internal/Observable").Observable<void>; /** * Timer representing the delay taken for an alert to animate when exiting */ readonly alertLeaveTimer: import("rxjs/internal/Observable").Observable<number>; constructor(alertBarService: NgAlertbarService, domSanitizer: DomSanitizer); ngOnInit(): void; ngOnDestroy(): void; private onTrigger; /** * Sets up temp variables and shows the alert * @param trigger The trigger to display */ private showAlert; /** * Closes any open alert. If there are any alerts waiting in the queue, * the alert is popped off the queue and emitted for opening */ onClose(): void; private closeAlert; /** * Clears out any temporary config options so that they * do not persist beyond their single use */ private clearTempOptions; /** * Assigns the options included in the trigger to the temporary * config variables so they can apply for the upcoming alert * @param options The options passed in the trigger */ private assignTempOptions; private shouldAlertAutoClose; }