import type { JSX } from 'solid-js'; import type { HeadlessProps, ValidConstructor } from '../../utils/dynamic-prop'; export type ToastProps = HeadlessProps; /** * One notification inside a {@link Toaster}. Carries `role="status"`, so it is * announced without stealing focus. * * Renders a `
` by default. * * @see {@link https://github.com/lxsmnsyc/terracotta/blob/main/docs/components/toast.md} */ export declare function Toast(props: ToastProps): JSX.Element; export type ToasterProps = HeadlessProps; /** * The region that holds the toasts. It does not read the queue for you: * subscribe with {@link useToaster} and map over the result yourself. * * Renders a `
` by default. * * @see {@link https://github.com/lxsmnsyc/terracotta/blob/main/docs/components/toast.md} */ export declare function Toaster(props: ToasterProps): JSX.Element; export interface ToastData { id: string; data: T; } export type ToasterListener = (queue: ToastData[]) => void; /** * The queue behind a {@link Toaster}. Create one at module scope and share it, * so any code can push a toast with `create`, drop one with `remove`, or empty * the queue with `clear`. * * @see {@link https://github.com/lxsmnsyc/terracotta/blob/main/docs/components/toast.md} */ export declare class ToasterStore { private static toasterID; private readonly id; private queue; private readonly listeners; private toastID; constructor(); subscribe(callback: ToasterListener): () => void; private notify; create(data: T): string; remove(id: string): void; clear(): void; getQueue(): ToastData[]; } /** * Subscribes to a {@link ToasterStore} and returns its queue as a signal. The * store is passed in rather than read from context, so the same queue can be * reached from anywhere in the app, including outside the component tree. * * @see {@link https://github.com/lxsmnsyc/terracotta/blob/main/docs/components/toast.md} */ export declare function useToaster(toaster: ToasterStore): () => ToastData[]; //# sourceMappingURL=index.d.ts.map