Notification.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import type { Key, VueNode } from '../_util/type';
  2. import type { CSSProperties } from 'vue';
  3. import type { NoticeProps } from './Notice';
  4. export interface NoticeContent extends Omit<NoticeProps, 'prefixCls' | 'noticeKey' | 'onClose'> {
  5. prefixCls?: string;
  6. key?: Key;
  7. updateMark?: string;
  8. content?: string | ((arg: {
  9. prefixCls: string;
  10. }) => VueNode) | VueNode;
  11. onClose?: () => void;
  12. style?: CSSProperties;
  13. class?: String;
  14. }
  15. export type Placement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
  16. export interface OpenConfig extends NoticeProps {
  17. key: Key;
  18. placement?: Placement;
  19. content?: string | (() => VueNode) | VueNode;
  20. duration?: number | null;
  21. }
  22. export type NoticeFunc = (noticeProps: NoticeContent) => void;
  23. export type HolderReadyCallback = (div: HTMLDivElement, noticeProps: NoticeProps & {
  24. key: Key;
  25. }) => void;
  26. export interface NotificationInstance {
  27. notice: NoticeFunc;
  28. removeNotice: (key: Key) => void;
  29. destroy: () => void;
  30. component: Notification;
  31. }
  32. export interface NotificationProps {
  33. prefixCls?: string;
  34. transitionName?: string;
  35. animation?: string | object;
  36. maxCount?: number;
  37. closeIcon?: any;
  38. hashId?: string;
  39. }
  40. declare const Notification: import("vue").DefineComponent<NotificationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NotificationProps>, {
  41. closeIcon?: any;
  42. }, {}>;
  43. export default Notification;