import { type ComponentProps } from 'react'; import type { QueuedToast, ToastQueue } from '../core/toaster.js'; /** * Unstyled toaster, the behaviour of the styled `` without a single class (Carbon has no * toast manager; this is ``'s). Keep the toasts in a `ToastQueue` (core/toaster: at most * its `max`, a new one closes the oldest, the same `id` replaces an open one) and read them with * `useToasts(queue)`. `Root` is the one polite live region that exists before any toast, so every * toast added to it is announced: give it an `aria-label` and render each toast as a * `Notification` with `role="none"` (an actionable one keeps `alertdialog`), removing it from the * queue in its `onClose`. The region is in the top layer from the start (`popover="manual"`); a * toast added while a modal dialog is open lifts it above the modal. * * ```tsx * const queue = new ToastQueue<{ title: string }>(); * const toasts = Toaster.useToasts(queue); * * {toasts.map(({ key, data }) => ( * queue.remove(key)}>… * ))} * * ``` */ export { ToastQueue, toastTimeout, type QueuedToast, type ToasterPlacement } from '../core/toaster.js'; /** The open toasts of `queue`, oldest first; re-renders when it changes. */ export declare function useToasts(queue: ToastQueue): readonly QueuedToast[]; export interface RootProps extends Omit, 'popover'> { /** The toasts this region shows (render them as its children); its `max` caps how many show at once. */ queue: ToastQueue; } /** The live region the toasts go in: polite, additions only, in the top layer, lifted above a modal for a new toast. */ export declare function Root({ queue, ref, ...rest }: Readonly>): import("react").JSX.Element;