import * as react_jsx_runtime from 'react/jsx-runtime'; import { FC, SuspenseProps } from 'react'; import { A as AsyncState, F as Falsy, E as ExtractValues, k as ExtractErrors, C as ContainerType } from '../types-5EvFF6wb.js'; import 'keyweaver'; type Props> = { states: S; /** A function to render the final content when all {@link Props.states states} resolve successfully. */ render(values: ExtractValues): ReturnType; /** A function or element to render if any of the {@link Props.states states} fail */ renderIfError?: ((errors: ExtractErrors, values: ExtractValues) => ReturnType) | ReturnType; /** If provided, it wraps the rendered content or fallback only if they exist. */ container?: ContainerType; } & Pick; /** * A controller component for rendering multiple {@link Props.states states}. * It utilizes the {@link useAll} hook under the hood to collect the values or errors of all provided states. * This component integrates with the {@link Suspense} component, deferring rendering until all states are resolved or an error occurs. * * @example * ```jsx * Loading...} * render={(data1, data2) => ( *
*
Data 1: {JSON.stringify(data1)}
*
Data 2: {JSON.stringify(data2)}
*
* )} * renderIfError={(values, errors) => ( *
Error occurred: {errors.map((error, index) => ( *
Error {index + 1}: {error?.message}
* ))}
* )} * /> * ``` */ declare const SuspenseAllController: >(props: Props) => react_jsx_runtime.JSX.Element; export { SuspenseAllController as default };