import { type ConfigurableToastProps } from "./Toast.js";
/**
 * @since 6.0.0
 */
export declare const DEFAULT_TOAST_VISIBLE_TIME = 5000;
/**
 * - `"normal"` - the toast will be added to the end of the queue
 * - `"next"` - the toast will be inserted next-in-line in the queue, waiting
 *   for the current visible toast to exit before being shown. If the toast does
 *   not support duplicates, the existing toast will be moved instead and merged
 *   with the toast.
 * - `"replace"` - if there is a currently visible toast, it will start the
 *   leave transition and display the newly added toast instead.
 * - `"immediate"` - the same behavior as `"replace"` except that if there was a
 *   currently visible toast, the toast will be shown again once the `"immediate"`
 *   toast is hidden.
 *
 * @since 6.0.0 Renamed from `MessagePriority` to `ToastPriority`
 */
export type ToastPriority = "normal" | "next" | "replace" | "immediate";
/**
 * - `"allow"` - toasts with the same `toastId` can be added into the queue, but
 *   the leave timeout behavior might not work if multiple toasts can be shown
 *   at the same time.
 * - `"restart"` - (default) toasts that have the same `toastId` as a toast
 *   being shown will restart the exit timeout and update the toast with any
 *   differences in the toast. If the toast is not currently being shown, a new
 *   toast will not be added.
 * - `"update"` - toasts that have the same `toastId` will just update the toast
 *   with the latest content while maintaining any existing timeouts
 *
 * @since 6.0.0 Renamed from `DuplicateBehavior`
 */
export type ToastDuplicateBehavior = "allow" | "restart" | "update";
/**
 * @since 6.0.0
 */
export interface ToastMeta {
    /**
     * This will be `true` if the exit timeout has been paused either by hovering
     * the toast or the page has become inactive through blur or minimizing.
     */
    paused: boolean;
    /**
     * This will be `true` when the toast should be visible and `false` during the
     * exit animation.
     */
    visible: boolean;
    /**
     * The current toast's id which can be used with the:
     * - {@link ToastManager.removeToast}
     * - {@link ToastManager.startRemoveTimeout}
     * - {@link ToastManager.pauseRemoveTimeout}
     * - {@link ToastManager.resumeRemoveTimeout}
     */
    toastId: string;
    priority: ToastPriority;
    duplicates: ToastDuplicateBehavior;
    visibleTime: number | null;
}
/**
 * @since 6.0.0
 */
export interface CreateToastOptions extends ConfigurableToastProps {
    /**
     * @defaultValue `nanoid()`
     */
    toastId?: string;
    /**
     * @see {@link ToastDuplicateBehavior}
     * @defaultValue `"restart"`
     */
    duplicates?: ToastDuplicateBehavior;
    /**
     * @see {@link ToastPriority}
     * @defaultValue `"normal"`
     */
    priority?: ToastPriority;
    /**
     * Set this to `null` to prevent the toast from automatically hiding,
     * otherwise set this to the number of milliseconds to remain visible.
     *
     * @see {@link DEFAULT_TOAST_VISIBLE_TIME}
     * @defaultValue `DEFAULT_TOAST_VISIBLE_TIME`
     */
    visibleTime?: number | null;
}
/**
 * @since 6.0.0
 */
export interface QueuedToast extends ConfigurableToastProps, ToastMeta {
}
/**
 * @since 6.0.0
 */
export type ToastQueue = readonly Readonly<QueuedToast>[];
/**
 * @since 6.0.0
 */
export type ToastCallback = (queue: ToastQueue) => void;
/**
 * @internal
 * @since 6.0.0
 */
export interface ToastVisibilityTimers {
    inactive: boolean;
    startTime: number;
    elapsedTime: number;
    exitTimeout?: number;
}
/**
 * @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
 * @see {@link ToastManagerProvider}
 * @since 6.0.0
 */
export declare class ToastManager {
    #private;
    constructor();
    /**
     * This is just used to subscribe to changes in the {@link useToastQueue}.
     *
     * ```tsx
     * useSyncExternalStore(
     *   toastManager.subscribe,
     *   toastManager.getQueue,
     *   toastManager.getQueue,
     * );
     * ```
     *
     * @internal
     */
    subscribe: (callback: ToastCallback) => (() => void);
    /**
     * @see {@link subscribe}
     * @internal
     */
    getQueue: () => ToastQueue;
    /**
     * Either adds the toast to the queue or updates an existing toast when using
     * an existing `toastId`.
     *
     * @example Adding toasts
     * ```tsx
     * // create a toast when the user is offline that will not disappear
     * addToast({ toastId: "offline", visibleTime: null });
     *
     * // add a new toast that displays `"Toast"` to the queue
     * addToast({ children: "Toast!" });
     *
     * // add an online toast notification. since these three use the same toast
     * // id, the hide timer will be reset each time
     * addToast({ toastId: "online" });
     * addToast({ toastId: "online" });
     * addToast({ toastId: "online" });
     *
     * // add a server error toast to the queue where the second one will be
     * // ignored
     * addToast({
     *   toastId: "ServerError",
     *   theme: "error",
     *   duplicates: "prevent",
     * });
     * addToast({
     *   toastId: "ServerError",
     *   theme: "error",
     *   duplicates: "prevent",
     * });
     *
     * // add a toast to the queue that has an action button that says "Goodbye"
     * addToast({
     *   children: "Hello, world!",
     *   action: "Goodbye",
     * });
     *
     * // add a toast to the queue that has an action button that says "Goodbye"
     * // and a custom click handler
     * addToast({
     *   children: "Hello, world!",
     *   action: {
     *     onClick: () => {
     *       logout();
     *     },
     *     children: "Goodbye",
     *   },
     * });
     *
     * // add a toast to the queue that renders a react component in the content,
     * // a custom action button implementation (using `ToastActionButton`), and a
     * // close button
     * addToast({
     *   children: <SomeCustomComponent />,
     *   actionButton: <SomeCustomActionButton />,
     *   closeButton: true,
     * });
     * ```
     */
    addToast: (toast: CreateToastOptions) => void;
    /**
     * Attempts to start the timeout for removing the toast when the `visibleTime`
     * is not null for a toast.
     *
     * @param toastId - The specific toastId to update
     */
    startRemoveTimeout: (toastId: string) => void;
    /**
     * Pauses the remove timeout for a specific toast normally with hover events
     * or the browser becoming inactive.
     *
     * @param toastId - The specific toastId to pause
     */
    pauseRemoveTimeout: (toastId: string) => void;
    /**
     * Resumes the current remove timeout if it was paused by
     * {@link pauseRemoveTimeout}.
     *
     * @param toastId - The specific toastId to resume
     */
    resumeRemoveTimeout: (toastId: string) => void;
    /**
     * Removes a toast by id from the queue without any exit animation.
     *
     * @param toastId - The specific {@link QueuedToast.toastId}
     * @param transition - Set this to `true` to remove the toast by the exit
     * transition instead of immediately.
     */
    removeToast: (toastId: string, transition: boolean) => void;
    /**
     * Clears any pending timers for the provided toast id. This should generally
     * be used in the `useEffect` cleanup effect for any custom toast renderer
     * implementations.
     *
     * @example
     * ```tsx
     * const { toastId } = toast;
     * const toastManager = useToastManager();
     *
     * useEffect(() => {
     *   return () => {
     *     toastManager.clearTimer(toastId):
     *   }
     * }, [toastManager, toastId]);
     * ```
     */
    clearTimer: (toastId: string) => void;
    /**
     * Removes first toast from the queue without any exit animation. You most
     * likely want to use {@link removeToast} instead.
     */
    popToast: () => void;
    /**
     * Removes all toasts from the queue. There will be no exit animation.
     *
     * @param disableEmit - Set this to `true` to disable emitting the empty queue.
     * Mostly used for tests.
     */
    clearToasts: (disableEmit?: boolean) => void;
}
/**
 * The default toast manager for react-md apps that will allow toasts to be
 * added without setting up the {@link ToastManagerProvider}.
 *
 * @internal
 * @since 6.0.0
 */
export declare const toastManager: ToastManager;
/**
 * @see {@link ToastManager.addToast}
 * @since 6.0.0
 */
export declare const addToast: ToastManager["addToast"];
/**
 * @see {@link ToastManager.startRemoveTimeout}
 * @since 6.0.0
 */
export declare const startRemoveToastTimeout: ToastManager["startRemoveTimeout"];
/**
 * @see {@link ToastManager.popToast}
 * @since 6.0.0
 */
export declare const popToast: ToastManager["popToast"];
/**
 * @see {@link ToastManager.removeToast}
 * @since 6.0.0
 */
export declare const removeToast: ToastManager["removeToast"];
/**
 * @see {@link ToastManager.clearToasts}
 * @since 6.0.0
 */
export declare const clearToasts: () => void;
