import { ExternalToast, ToastT } from "sonner"; import { Notification, NotificationProps } from "./Notification"; export type AddNotificationProps = Omit & { duration?: number; }; /** * `closeLabel` may be a thunk, resolved once per notification rather than when the store is built. * Consumers that construct this store during app startup can otherwise capture a translation before * their i18n bundle has loaded, pinning an empty accessible name on the close button for good. */ export type DefaultNotificationProps = Omit, "closeLabel"> & { closeLabel: NotificationProps["closeLabel"] | (() => NotificationProps["closeLabel"]); }; export type NotificationStoreDependencies = { defaultNotificationProps: DefaultNotificationProps; }; type Notification = { id: number | string; /** Merges into the previous props rather than replacing them, so a progress tick keeps the title * and a result keeps the action, preview and `dismissible`. Pass a field as `undefined` to clear it. */ update: (partialProps: Partial) => void; dismiss: () => void; }; export declare class NotificationsStore { #private; constructor(dependencies: NotificationStoreDependencies); addNotification: (partialProps: AddNotificationProps) => Notification; addCustomNotification: (jsx: (id: number | string) => React.ReactElement, data?: ExternalToast) => string | number; dismissNotification: (id?: number | string) => string | number; getNotifications: () => ToastT[]; confirm: (options: { label: string; confirmLabel: string; position?: ExternalToast["position"]; duration?: number; }) => Promise; } export {}; //# sourceMappingURL=NotificationsStore.d.ts.map