typings.d.ts 1.0 KB

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { TemplateRef } from '@angular/core';
  6. import { Subject } from 'rxjs';
  7. import { NzSafeAny } from 'ng-zorro-antd/core/types';
  8. import { NzMNComponent } from './base';
  9. export type NzMessageType = 'success' | 'info' | 'warning' | 'error' | 'loading';
  10. export type NzMessageContentType = string | TemplateRef<void | {
  11. $implicit: NzMNComponent;
  12. data: NzSafeAny;
  13. }>;
  14. export interface NzMessageDataOptions {
  15. nzDuration?: number;
  16. nzAnimate?: boolean;
  17. nzPauseOnHover?: boolean;
  18. nzData?: NzSafeAny;
  19. }
  20. export interface NzMessageData {
  21. type?: NzMessageType | string;
  22. content?: NzMessageContentType;
  23. messageId?: string;
  24. createdAt?: Date;
  25. options?: NzMessageDataOptions;
  26. state?: 'enter' | 'leave';
  27. onClose?: Subject<boolean>;
  28. }
  29. export type NzMessageRef = Pick<Required<NzMessageData>, 'onClose' | 'messageId'>;