import { AggregatedResourceStatus, ResourceStatus } from "./hooks/use-resource-status.js"; import * as react_jsx_runtime0 from "react/jsx-runtime"; import { LucideIcon } from "lucide-react"; import { ToasterProps } from "sonner"; //#region src/react/resource-status-indicator.d.ts /** Per-kind copy + icon overrides for {@link ResourceStatusIndicator}. */ interface ResourceKindRenderer { title: (status: ResourceStatus) => string; description: (status: ResourceStatus, aggregate: AggregatedResourceStatus) => string; /** Defaults to sonner's built-in loading/error icon. */ icon?: LucideIcon; } /** Options shared by {@link ResourceStatusIndicator} and {@link useResourceStatusToaster}. */ interface ResourceStatusToasterOptions { /** Restrict to a single resource kind. Otherwise shows the worst across all kinds. */ kind?: string; /** Per-kind copy + icon overrides. */ renderers?: Record; /** Class name applied to the toast (not the Toaster wrapper). */ toastClassName?: string; /** Full custom render override, rendered inside `toast.custom`. */ render?: (aggregate: AggregatedResourceStatus) => React.ReactNode; } /** * Drives a sticky sonner toast that mirrors the worst pending resource * status. Does not render anything — supply your own ``. Most * apps should prefer {@link ResourceStatusIndicator}; use this hook only * to share an existing Toaster with unrelated app toasts. */ declare function useResourceStatusToaster(options?: ResourceStatusToasterOptions): void; interface ResourceStatusIndicatorProps extends ResourceStatusToasterOptions, Omit { /** Class name applied to the Toaster wrapper. */ className?: string; } /** * Drop-in indicator that mounts a `` and surfaces the worst * pending {@link ResourceStatus} across every plugin/component publishing * into the nearest {@link ResourceStatusProvider} as a sonner toast * (`toast.loading` for cold starts, `toast.error` for unrecoverable * states), keyed by the worst kind so only one indicator toast is on * screen at a time. * * Forwards `Toaster` props (`position` defaults to `top-right`, plus * `theme`, `richColors`, …). Apps that already mount their own * `` should drop this component and call * {@link useResourceStatusToaster} instead. * * @example * ```tsx * * * * * ``` * * @example Custom render * ```tsx * ( *
* {agg.worst?.kind} {agg.worst?.state.toLowerCase()} *
* )} * /> * ``` */ declare function ResourceStatusIndicator({ kind, renderers, toastClassName, render, position, ...toasterProps }?: ResourceStatusIndicatorProps): react_jsx_runtime0.JSX.Element; //#endregion export { ResourceKindRenderer, ResourceStatusIndicator, ResourceStatusIndicatorProps, ResourceStatusToasterOptions, useResourceStatusToaster }; //# sourceMappingURL=resource-status-indicator.d.ts.map