@slan-health/taro-vueuse
Version:
taro vue版本hooks
22 lines (21 loc) • 764 B
TypeScript
export interface ToastOption {
title: string;
duration?: number;
icon?: 'success' | 'loading' | 'none' | 'error';
image?: string;
mask?: boolean;
}
export type ShowToast = (option?: Partial<ToastOption>) => Promise<TaroGeneral.CallbackResult>;
export type ShowStringToast = (title: string) => Promise<TaroGeneral.CallbackResult>;
export type HideToast = () => Promise<TaroGeneral.CallbackResult>;
declare function useToast(initialOption?: Partial<ToastOption>): [
{
showToastAsync: ShowToast;
showSuccessAsync: ShowStringToast;
showErrorAsync: ShowStringToast;
showNoneAsync: ShowStringToast;
showNoneTimeoutAsync: (title: string) => Promise<number>;
},
HideToast
];
export default useToast;