UNPKG

@vnmfify/core

Version:

```shell npm i @vnmfify/core -S ```

23 lines (22 loc) 1.04 kB
import { CSSProperties, ReactNode } from "react"; import { PopupBackdropProps } from "../popup"; import { ToastPosition, ToastType } from "./toast.shared"; export declare function setDefaultToastOptions(options: ToastOptions): void; export declare function resetDefaultToastOptions(): void; export declare function useToastOpen(cb: (options: ToastOptions) => void): void; export declare function useToastClose(cb: (selector: string) => void): void; export interface ToastOptions { selector?: string; className?: string; style?: CSSProperties; backdrop?: boolean | Omit<PopupBackdropProps, "open">; type?: ToastType; position?: ToastPosition; icon?: ReactNode; duration?: number; message?: ReactNode; onClose?(opened: boolean): void; } export declare function openToast(args: ReactNode | ToastOptions): void; export declare function createToast(type: ToastType): (args: string | Omit<ToastOptions, "type">) => void; export declare function closeToast(selector?: string): void;