import type { VNodeChild } from "vue"; import type { XySemanticClassNames, XySemanticStyles } from "../core"; import type { XyIconName } from "../icon"; export type XyNotificationType = "danger" | "info" | "success" | "warning"; export type XyNotificationPlacement = "bottomLeft" | "bottomRight" | "topLeft" | "topRight"; export type XyNotificationSemanticDom = "actions" | "body" | "close" | "description" | "icon" | "message" | "progress" | "progressBar" | "root"; export interface XyNotificationSemanticProps { closable: boolean; hasActions: boolean; hasDescription: boolean; hasIcon: boolean; hasMessage: boolean; hasProgress: boolean; type: XyNotificationType; } export type XyNotificationClassNames = XySemanticClassNames; export type XyNotificationStyles = XySemanticStyles; export interface XyNotificationProps { actions?: VNodeChild | string; classNames?: XyNotificationClassNames; closable?: boolean; closeAriaLabel?: string; description?: VNodeChild | string; icon?: boolean | XyIconName; message?: VNodeChild | string; progress?: number; progressAriaLabel?: string; showProgress?: boolean; styles?: XyNotificationStyles; type?: XyNotificationType; } export interface XyNotificationSlots { actions?: () => VNodeChild; closeIcon?: () => VNodeChild; default?: () => VNodeChild; description?: () => VNodeChild; icon?: () => VNodeChild; message?: () => VNodeChild; } export interface XyNotificationOpenOptions { actions?: VNodeChild | string; classNames?: XyNotificationClassNames; closable?: boolean; closeAriaLabel?: string; description?: VNodeChild | string; duration?: number; icon?: boolean | XyIconName; key?: string | number; maxCount?: number; message?: VNodeChild | string; onClose?: () => void; placement?: XyNotificationPlacement; progress?: number; progressAriaLabel?: string; showProgress?: boolean; styles?: XyNotificationStyles; type?: XyNotificationType; } export type XyNotificationMethodOptions = Omit; export interface XyNotificationGlobalConfig { bottom?: number; duration?: number; getContainer?: () => HTMLElement | null | undefined; maxCount?: number; placement?: XyNotificationPlacement; top?: number; zIndex?: number; } export interface XyNotificationResolvedConfig { bottom: number; duration: number; getContainer?: () => HTMLElement | null | undefined; maxCount: number; placement: XyNotificationPlacement; top: number; zIndex: number; } export interface XyNotificationHandler { close: () => void; key: string | number; } export type XyNotificationCloseTarget = string | number | XyNotificationHandler; export interface XyNotificationApi { close: (target: XyNotificationCloseTarget) => void; closeAll: () => void; config: (options?: XyNotificationGlobalConfig) => void; danger: (message: string, options?: XyNotificationMethodOptions) => XyNotificationHandler; destroy: () => void; error: (message: string, options?: XyNotificationMethodOptions) => XyNotificationHandler; info: (message: string, options?: XyNotificationMethodOptions) => XyNotificationHandler; open: (options: XyNotificationOpenOptions) => XyNotificationHandler; success: (message: string, options?: XyNotificationMethodOptions) => XyNotificationHandler; warning: (message: string, options?: XyNotificationMethodOptions) => XyNotificationHandler; } export interface NotificationInternalInstance { actions?: VNodeChild | string; classNames?: XyNotificationClassNames; closable: boolean; closeAriaLabel?: string; description?: VNodeChild | string; duration: number; icon: boolean | XyIconName; key: string | number; message?: VNodeChild | string; onClose?: () => void; placement: XyNotificationPlacement; progress?: number; progressAriaLabel?: string; progressKey: string; showProgress: boolean; styles?: XyNotificationStyles; timer?: ReturnType; type: XyNotificationType; }