/*! * vue-my-toasts v2.0.0 * (c) 2021 * @license MIT */ import * as vue_demi from 'vue-demi'; import { defineComponent, Ref, ComponentPublicInstance, RendererElement, ComponentOptions, ComponentOptionsMixin, Plugin } from 'vue-demi'; import { MotionVariants } from '@vueuse/motion'; declare type VueMyToastsComponent = typeof defineComponent; declare type VueMyToastsPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-middle' | 'bottom-middle'; declare type VueMyToastsOptions = { width?: string; padding?: string; position?: VueMyToastsPosition; variants?: MotionVariants | VueMyToastsVariantsFunction; [key: string]: any; }; declare type VueMyToastsPluginOptions = { component: VueMyToastsComponent; options: VueMyToastsOptions; }; declare type MyToastsInstance = { add: (toast: VueMyToastsPayload) => void; remove: (toastId: string) => void; toasts: Ref; } & ComponentPublicInstance; declare type VueMyToastsPayload = { id?: string; type?: 'base' | 'success' | 'warning' | 'error' | string; message?: string; [key: string]: any; }; declare type VueMyToastsUpdateConfig = (newOptions: VueMyToastsOptions, userComponent: typeof defineComponent) => void; declare type VueMyToastsHelper = (message: string, options: VueMyToastsPayload) => void; declare type VueMyToastsGlobalInstance = { toasts: Ref; push: (toast: VueMyToastsPayload) => void; remove: (toastId: string) => void; base: VueMyToastsHelper; success: VueMyToastsHelper; warning: VueMyToastsHelper; error: VueMyToastsHelper; updateConfig: VueMyToastsUpdateConfig; }; declare type TransitionComponentHook = (el: RendererElement, done: () => void) => void; declare type VueMyToastsVariantsFunction = (position: VueMyToastsPosition, toastId?: string, index?: number) => MotionVariants; declare module '@vue/runtime-core' { interface ComponentCustomProperties { $toasts: VueMyToastsGlobalInstance; } } /** * Returns the toasts instance methods * * @returns VueMyToastsGlobalInstance instance */ declare const useToasts: () => VueMyToastsGlobalInstance; declare const defineToastComponent: (parameters: ComponentOptions, withTimer?: boolean) => vue_demi.DefineComponent<{}, any, any, any, any, any, any, any, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<{} & {}>, {}>; declare const TimerMixin: ComponentOptionsMixin; declare const ToastMixin: ComponentOptionsMixin; declare let currentComponent: VueMyToastsComponent | undefined; declare let pluginOptions: VueMyToastsOptions; /** * Update the VueMyToasts options and reload instance. * @param newOptions * @param userComponent */ declare const updateConfig: (newOptions: VueMyToastsOptions, userComponent?: typeof vue_demi.defineComponent | undefined) => void; /** * Vue plugin functions, default component and mixins * * @type {{ * install: install, * version: string * }} */ declare const plugin: Plugin; export default plugin; export { MyToastsInstance, TimerMixin, ToastMixin, TransitionComponentHook, VueMyToastsComponent, VueMyToastsGlobalInstance, VueMyToastsHelper, VueMyToastsOptions, VueMyToastsPayload, VueMyToastsPluginOptions, VueMyToastsPosition, VueMyToastsUpdateConfig, VueMyToastsVariantsFunction, currentComponent, defineToastComponent, pluginOptions, updateConfig, useToasts };