07bf57f61b5f6e471c8ce939a1131ddf31d6e14363e12109dd805340953950b2af25eaf002a5625686f1097c833e381b7a56a52122d4f3b120bb30ba700961 5.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import type { AppContext, ExtractPropTypes, VNode, __ExtractPublicPropTypes } from 'vue';
  2. import type Notification from './notification.vue';
  3. export declare const notificationTypes: readonly ["primary", "success", "info", "warning", "error"];
  4. export declare const notificationProps: {
  5. readonly customClass: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
  6. readonly dangerouslyUseHTMLString: BooleanConstructor;
  7. readonly duration: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 4500, boolean>;
  8. readonly icon: {
  9. readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
  10. readonly required: false;
  11. readonly validator: ((val: unknown) => boolean) | undefined;
  12. __epPropKey: true;
  13. };
  14. readonly id: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
  15. readonly message: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
  16. [key: string]: any;
  17. }> | (() => VNode)) | (() => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
  18. [key: string]: any;
  19. }> | (() => VNode)) | ((new (...args: any[]) => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
  20. [key: string]: any;
  21. }> | (() => VNode)) | (() => string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
  22. [key: string]: any;
  23. }> | (() => VNode)))[], unknown, unknown, "", boolean>;
  24. readonly offset: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
  25. readonly onClick: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => () => void) | (() => () => void) | {
  26. (): () => void;
  27. new (): any;
  28. readonly prototype: any;
  29. } | ((new (...args: any[]) => () => void) | (() => () => void) | {
  30. (): () => void;
  31. new (): any;
  32. readonly prototype: any;
  33. })[], unknown, unknown, () => undefined, boolean>;
  34. readonly onClose: {
  35. readonly type: import("vue").PropType<() => void>;
  36. readonly required: true;
  37. readonly validator: ((val: unknown) => boolean) | undefined;
  38. __epPropKey: true;
  39. };
  40. readonly position: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "top-left" | "top-right" | "bottom-left" | "bottom-right", unknown, "top-right", boolean>;
  41. readonly showClose: import("element-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
  42. readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
  43. readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "error" | "primary" | "success" | "warning" | "info", unknown, "", boolean>;
  44. readonly zIndex: NumberConstructor;
  45. readonly closeIcon: {
  46. readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
  47. readonly required: false;
  48. readonly validator: ((val: unknown) => boolean) | undefined;
  49. __epPropKey: true;
  50. };
  51. };
  52. export type NotificationProps = ExtractPropTypes<typeof notificationProps>;
  53. export type NotificationPropsPublic = __ExtractPublicPropTypes<typeof notificationProps>;
  54. export declare const notificationEmits: {
  55. destroy: () => boolean;
  56. };
  57. export type NotificationEmits = typeof notificationEmits;
  58. export type NotificationInstance = InstanceType<typeof Notification> & unknown;
  59. export type NotificationOptions = Omit<NotificationProps, 'id' | 'onClose'> & {
  60. /**
  61. * @description set the root element for the notification, default to `document.body`
  62. */
  63. appendTo?: HTMLElement | string;
  64. /**
  65. * @description callback function when closed
  66. */
  67. onClose?(vm: VNode): void;
  68. };
  69. export type NotificationOptionsTyped = Omit<NotificationOptions, 'type'>;
  70. export interface NotificationHandle {
  71. close: () => void;
  72. }
  73. export type NotificationParams = Partial<NotificationOptions> | string | VNode;
  74. export type NotificationParamsTyped = Partial<NotificationOptionsTyped> | string | VNode;
  75. export interface NotifyFn {
  76. (options?: NotificationParams, appContext?: null | AppContext): NotificationHandle;
  77. closeAll(): void;
  78. updateOffsets(position?: NotificationOptions['position']): void;
  79. _context: AppContext | null;
  80. }
  81. export type NotifyTypedFn = (options?: NotificationParamsTyped, appContext?: null | AppContext) => NotificationHandle;
  82. export interface Notify extends NotifyFn {
  83. primary: NotifyTypedFn;
  84. success: NotifyTypedFn;
  85. warning: NotifyTypedFn;
  86. error: NotifyTypedFn;
  87. info: NotifyTypedFn;
  88. }
  89. export interface NotificationQueueItem {
  90. vm: VNode;
  91. }
  92. export type NotificationQueue = NotificationQueueItem[];