UNPKG

press-next

Version:

Vue3 组件库,支持 Composition API

39 lines (27 loc) 809 B
import Toast from 'press-ui/press-toast/index'; export type Options = string | { message: string; text?: string; zIndex?: number; duration?: number forbidClick?: boolean; }; export type ToastLoadingFunc = () => Array<Promise<{ default?: RawToast }>>; export type Handler = (text: Options, duration?: number) => void; export type IToast = { (options: Options, duration?: number): void; show: Handler; showSuccess: Handler; success: Handler; showFail: Handler; fail: Handler; clear: () => void; showLoading: (text: Options) => void; loading: (text: Options) => void; dismissLoading: () => void; toastComponent: ToastLoadingFunc; setComponent: (comp: ToastLoadingFunc) => void; useCustomUI: () => void; customUI?: boolean; }; export type RawToast = typeof Toast;