import Toast from "./toast" ; import Modal from "./modal" ; import ActionSheet from "./actionsheet" ; import { ismp } from "../utils/index" ; const toast = new Toast ( ) ; const modal = new Modal ( ) ; const actionSheet = new ActionSheet ( ) ; if ( ! ismp ) { actionSheet . render ( ) ; } export function showToast ( options = { } ) { return toast . show ( options ) ; } export function hideToast ( options = { } ) { return toast . hide ( 0 ) . then ( ( ) => { ( typeof options . success === "function" ) && options . success ( ) ( typeof options . complete === "function" ) && options . complete ( ) ; } ) ; } export function showModal ( options = { } ) { return modal . show ( options ) ; } export function showLoading ( options = { } ) { options . duration = 0 ; options . icon = "loading" ; return toast . show ( options ) ; } export function hideLoading ( options = { } ) { return toast . hide ( 0 ) . then ( ( ) => { ( typeof options . success === "function" ) && options . success ( ) ( typeof options . complete === "function" ) && options . complete ( ) ; } ) ; } export function showActionSheet ( options = { } ) { return actionSheet . show ( options ) ; }