@nuxt/ui
Version:
A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
20 lines (19 loc) • 761 B
TypeScript
import type { Ref, InjectionKey } from 'vue';
import type { ToastProps, ToastEmits } from '../components/Toast.vue';
import type { EmitsToProps } from '../types/utils';
export declare const toastMaxInjectionKey: InjectionKey<Ref<number | undefined>>;
export interface Toast extends Omit<ToastProps, 'defaultOpen'>, EmitsToProps<ToastEmits> {
id: string | number;
onClick?: (toast: Toast) => void;
/** @internal */
_duplicate?: number;
/** @internal */
_updated?: boolean;
}
export declare function useToast(): {
toasts: Ref<Toast[], Toast[]>;
add: (toast: Partial<Toast>) => Toast;
update: (id: string | number, toast: Omit<Partial<Toast>, "id">) => void;
remove: (id: string | number) => void;
clear: () => void;
};