2019-06-13 16:15:58 +08:00
|
|
|
import { MandComponent } from './component'
|
|
|
|
|
|
2018-03-26 16:04:04 +08:00
|
|
|
export type ToastOptions = {
|
|
|
|
|
content: string
|
2018-07-30 13:38:23 +08:00
|
|
|
duration?: number
|
2022-08-10 16:29:56 +08:00
|
|
|
parentNode?: Element
|
2018-07-23 18:53:30 +08:00
|
|
|
hasMask?: boolean
|
2022-08-10 16:29:56 +08:00
|
|
|
square?: boolean
|
2018-03-26 16:04:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type ToastConstructorOptions = {
|
2018-07-30 13:38:23 +08:00
|
|
|
icon?: string,
|
2018-07-23 18:53:30 +08:00
|
|
|
position?: string
|
2018-03-26 16:04:04 +08:00
|
|
|
} & ToastOptions
|
|
|
|
|
|
|
|
|
|
export interface Toast {
|
|
|
|
|
(options?: ToastConstructorOptions): void
|
2022-08-10 16:29:56 +08:00
|
|
|
info(content: string, duration?: number, hasMask?: boolean, parentNode?: Element, square?: boolean): void
|
|
|
|
|
succeed(content: string, duration?: number, hasMask?: boolean, parentNode?: Element, square?: boolean): void
|
|
|
|
|
failed(content: string, duration?: number, hasMask?: boolean, parentNode?: Element, square?: boolean): void
|
|
|
|
|
loading(content: string, duration?: number, hasMask?: boolean, parentNode?: Element, square?: boolean): void
|
2018-03-26 16:04:04 +08:00
|
|
|
hide(): void
|
2019-06-13 16:15:58 +08:00
|
|
|
component: MandComponent
|
2018-03-26 16:04:04 +08:00
|
|
|
}
|
|
|
|
|
|
2018-08-01 00:52:11 +08:00
|
|
|
declare module 'vue/types/vue' {
|
|
|
|
|
interface Vue {
|
|
|
|
|
$toast: Toast
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-23 18:53:30 +08:00
|
|
|
export const Toast: Toast
|