UNPKG

tdesign-vue

Version:
36 lines (35 loc) 1.81 kB
import { TNode, AttachNode } from '../common'; export interface TdNotificationProps { closeBtn?: string | boolean | TNode; content?: string | TNode; default?: string | TNode; duration?: number; footer?: string | TNode; icon?: boolean | TNode; theme?: NotificationThemeList; title?: string | TNode; onCloseBtnClick?: (context: { e: MouseEvent; }) => void; onDurationEnd?: () => void; } export interface NotificationOptions extends TdNotificationProps { attach?: AttachNode; offset?: Array<string | number>; placement?: NotificationPlacementList; zIndex?: number; } export declare type NotificationThemeList = 'info' | 'success' | 'warning' | 'error'; export declare type NotificationPlacementList = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; export interface NotificationInstance { close: () => void; } export declare type NotificationMethod = (theme: NotificationThemeList, options: NotificationOptions) => Promise<NotificationInstance>; export declare type NotificationInfoOptions = Omit<NotificationOptions, 'theme'>; export declare type NotificationInfoMethod = (options: NotificationInfoOptions) => Promise<NotificationInstance>; export declare type NotificationWarningMethod = (options: NotificationInfoOptions) => Promise<NotificationInstance>; export declare type NotificationErrorMethod = (options: NotificationInfoOptions) => Promise<NotificationInstance>; export declare type NotificationSuccessMethod = (options: NotificationInfoOptions) => Promise<NotificationInstance>; export declare type NotificationCloseMethod = (options: Promise<NotificationInstance>) => void; export declare type NotificationCloseAllMethod = () => void; export declare type NotificationConfigMethod = (notify: NotificationOptions) => void;