biplab-notifier
Version:
This is a notification npm package, it can be use as simple notification or modal dialog, a lot of customization option are available as well, checkout the github repo and examples
56 lines (55 loc) • 2.11 kB
TypeScript
import { Observable, Subject } from 'rxjs';
import { Message } from './message/notifer';
import { NotifcationLayout, Css, NotificationButton } from './layout/notifier';
export interface Timer {
duration: number;
}
export declare class Notification extends NotifcationLayout {
status?: 'activate' | 'deactivate';
data?: Message | Message[];
css: Css;
actionButtons: NotificationButton[];
protected readonly _afterOpened: Subject<void>;
protected readonly _afterClosed: Subject<any>;
private readonly _event;
private notificationType;
private _timer?;
private cancelTimer;
constructor(layoutType?: 'single' | 'multi', displayAs?: 'dialog' | 'snack-bar' | 'notification', status?: 'activate' | 'deactivate', data?: Message | Message[], css?: Css, actionButtons?: NotificationButton[]);
message: string;
defaultButtons(actionButtons?: NotificationButton[]): void;
applyThemeColorInTrueButtons(): void;
trueActionButtonStatus: 'enable' | 'disable';
readonly currentStatus: 'hide' | 'show';
readonly trueActionButton: NotificationButton;
addNewButton(label: string, callBackFunctions: {
func: Function;
param: any;
}[], disabled: boolean, type: 'submit' | 'button', emitValue: any, css?: Css): void;
buttonColorReverse(): void;
private _handleTransparentColor;
buttonShadow(status: 'show' | 'hide'): void;
messages: string[];
layoutType: 'single' | 'multi';
timer: Timer | null;
show(): void;
hide(why?: boolean): void;
titleText: string;
readonly action: Observable<boolean>;
header: string;
isDialog: boolean;
isSnack: boolean;
isNotification: boolean;
disableOutsideClick: boolean;
body: 'show' | 'hide';
actionRow: 'show' | 'hide';
closeButton: 'show' | 'hide';
title: 'show' | 'hide';
trueButton: string;
falseButton: string;
type: 'warn' | 'error' | 'note' | 'success' | 'help' | 'other';
readonly afterOpened: Observable<void>;
readonly afterClosed: Observable<boolean | any>;
close: any;
opened(): void;
}