import type { XySemanticClassNames, XySemanticStyles } from "../core"; import type { XyIconName } from "../icon"; export type XyMessageType = "danger" | "info" | "loading" | "success" | "warning"; export type XyMessageVariant = "inline" | "toast"; export type XyMessageSemanticDom = "body" | "close" | "content" | "icon" | "mark" | "root" | "title"; export interface XyMessageSemanticProps { closable: boolean; hasTitle: boolean; icon: boolean; type: XyMessageType; variant: XyMessageVariant; } export type XyMessageClassNames = XySemanticClassNames; export type XyMessageStyles = XySemanticStyles; export interface XyMessageProps { type?: XyMessageType; title?: string; icon?: boolean | XyIconName; closable?: boolean; closeAriaLabel?: string; variant?: XyMessageVariant; classNames?: XyMessageClassNames; styles?: XyMessageStyles; } export interface XyMessageOpenOptions { closeAriaLabel?: string; content?: string; type?: XyMessageType; title?: string; duration?: number; closable?: boolean; icon?: boolean | XyIconName; key?: string | number; maxCount?: number; onClose?: () => void; } export type XyMessageMethodOptions = Omit; export interface XyMessageGlobalConfig { duration?: number; getContainer?: () => HTMLElement | null | undefined; maxCount?: number; top?: number; zIndex?: number; } export interface XyMessageResolvedConfig { duration: number; getContainer?: () => HTMLElement | null | undefined; maxCount: number; top: number; zIndex: number; } export interface XyMessageHandler { close: () => void; key: string | number; } export type XyMessageCloseTarget = string | number | XyMessageHandler; export interface XyMessageApi { close: (target: XyMessageCloseTarget) => void; closeAll: () => void; config: (options?: XyMessageGlobalConfig) => void; danger: (content: string, options?: XyMessageMethodOptions) => XyMessageHandler; destroy: () => void; info: (content: string, options?: XyMessageMethodOptions) => XyMessageHandler; loading: (content: string, options?: XyMessageMethodOptions) => XyMessageHandler; open: (options: XyMessageOpenOptions) => XyMessageHandler; success: (content: string, options?: XyMessageMethodOptions) => XyMessageHandler; warning: (content: string, options?: XyMessageMethodOptions) => XyMessageHandler; } export interface MessageInternalInstance { closable: boolean; closeAriaLabel?: string; content: string; duration: number; icon: boolean | XyIconName; key: string | number; onClose?: () => void; timer?: ReturnType; title: string; type: XyMessageType; }