import { emitter , toaster , Toaster } from './utils' ; import { Events , ToastContent , ToastConfig } from './types' ; const applyToast = ( { ... toast } ) => emitter . emit ( Events . SHOW , toaster ( { ... toast } ) ) ; const toast = ( content , config ? ) => applyToast ( { content , type : 'default' , config } ) ; toast . success = ( content , config ? ) => applyToast ( { content , type : 'success' , config } ) ; toast . error = ( content , config ? ) => applyToast ( { content , type : 'error' , config } ) ; toast . info = ( content , config ? ) => applyToast ( { content , type : 'info' , config } ) ; toast . warn = ( content , config ? ) => applyToast ( { content , type : 'warning' , config } ) ; toast . hideAll = ( ) => emitter . emit ( Events . HIDE_ALL ) ; export { toast } ;