-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
typings.ts
40 lines (33 loc) · 1.25 KB
/
typings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
import { TemplateRef } from '@angular/core';
import { Subject } from 'rxjs';
import { NgClassInterface, NgStyleInterface } from 'ng-zorro-antd/core/types';
export type NzNotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'top' | 'bottom';
export interface NzNotificationDataOptions<T = {}> {
nzKey?: string;
nzStyle?: NgStyleInterface;
nzClass?: NgClassInterface | string;
nzCloseIcon?: TemplateRef<void> | string;
nzPlacement?: NzNotificationPlacement;
nzData?: T;
nzDuration?: number;
nzAnimate?: boolean;
nzPauseOnHover?: boolean;
}
export interface NzNotificationData {
content?: string | TemplateRef<void>;
createdAt?: Date;
messageId?: string;
options?: NzNotificationDataOptions;
state?: 'enter' | 'leave';
template?: TemplateRef<{}>;
title?: string;
type?: 'success' | 'info' | 'warning' | 'error' | 'blank' | string;
// observables exposed to users
onClose?: Subject<boolean>;
onClick?: Subject<MouseEvent>;
}
export type NzNotificationRef = Pick<Required<NzNotificationData>, 'onClose' | 'onClick' | 'messageId'>;