interface.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import type { CSSProperties } from 'vue';
  2. import type { Key, VueNode } from '../_util/type';
  3. export type NotificationPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
  4. export type IconType = 'success' | 'info' | 'error' | 'warning';
  5. export interface ArgsProps {
  6. message: (() => VueNode) | VueNode;
  7. description?: (() => VueNode) | VueNode;
  8. btn?: (() => VueNode) | VueNode;
  9. key?: Key;
  10. onClose?: () => void;
  11. duration?: number | null;
  12. icon?: (() => VueNode) | VueNode;
  13. placement?: NotificationPlacement;
  14. style?: CSSProperties;
  15. class?: string;
  16. readonly type?: IconType;
  17. onClick?: () => void;
  18. closeIcon?: (() => VueNode) | VueNode;
  19. }
  20. type StaticFn = (args: ArgsProps) => void;
  21. export interface NotificationInstance {
  22. success: StaticFn;
  23. error: StaticFn;
  24. info: StaticFn;
  25. warning: StaticFn;
  26. open: StaticFn;
  27. destroy(key?: Key): void;
  28. }
  29. export interface GlobalConfigProps {
  30. top?: number | string;
  31. bottom?: number | string;
  32. duration?: number;
  33. prefixCls?: string;
  34. getContainer?: () => HTMLElement;
  35. placement?: NotificationPlacement;
  36. closeIcon?: (() => VueNode) | VueNode;
  37. rtl?: boolean;
  38. maxCount?: number;
  39. }
  40. export interface NotificationConfig {
  41. top?: number | string;
  42. bottom?: number | string;
  43. prefixCls?: string;
  44. getContainer?: () => HTMLElement;
  45. placement?: NotificationPlacement;
  46. maxCount?: number;
  47. rtl?: boolean;
  48. }
  49. export {};