import { Injectable, TemplateRef } from '@angular/core'; @Injectable() export class NotifyOptions { type: string; title?: string; msg?: string; /** 按钮列表模板 */ buttons?:TemplateRef | Array; showClose?: boolean; theme?: string; timeout?: number; onAdd?: Function; onRemove?: Function; id?:number|string; } export class NotifyData extends NotifyOptions { } @Injectable() export class NotifyConfig { // Maximum number of toasties to show at once limit = 5; // Whether to show the 'X' icon to close the toast showClose = true; // The window position where the toast pops up position: | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'top-center' | 'bottom-center' | 'center-center' = 'top-center'; // How long (in miliseconds) the toasty shows before it's removed. Set to null/0 to turn off. timeout = 3000; // What theme to use theme: 'default' | 'material' | 'bootstrap' = 'bootstrap'; left: number; right: number; top: number; bottom: number; } export enum NotifyEventType { ADD, CLEAR, CLEAR_ALL } export class NotifyEvent { constructor(public type: NotifyEventType, public value?: any) { } } export interface NotifyButton { cls?: string; text: string; disable?: boolean; handle?: (ev:Event,cmp:any) => any; }