@trellixio/roaster-coffee
Version:
Beans' product component library
37 lines • 1.63 kB
TypeScript
import type { ToastProps } from './types';
export declare type ToastsEvents = {
/**
* Displays a toast notification with the provided `ToastProps`
* @param toast - The `ToastProps` object representing the notification to display
*/
show(toast: ToastProps): void;
/**
* Removes the toast notification with the specified `id` from the screen
* @param id - The `id` of the toast notification to remove
*/
hide(id: string): void;
/**
* Updates the toast notification with the specified `id` with the provided `ToastProps`
* @param toast - The `ToastProps` object representing the updated notification
*/
update(toast: ToastProps & {
id: string;
}): void;
/**
* Removes all existing toast notifications from the screen
*/
clean(): void;
/**
* Clears the queue of pending toast notifications, which haven't been displayed yet.
*/
cleanQueue(): void;
};
export declare const useToastsEvents: (events: ToastsEvents) => void, createEvent: <EventKey extends keyof ToastsEvents>(event: EventKey) => (...payload: Parameters<ToastsEvents[EventKey]>[0] extends undefined ? [undefined?] : [Parameters<ToastsEvents[EventKey]>[0]]) => void;
export declare const showToast: (payload_0: ToastProps) => void;
export declare const hideToast: (payload_0: string) => void;
export declare const cleanToasts: (payload_0?: undefined) => void;
export declare const cleanToastsQueue: (payload_0?: undefined) => void;
export declare const updateToast: (payload_0: ToastProps & {
id: string;
}) => void;
//# sourceMappingURL=events.d.ts.map