import * as react_jsx_runtime from 'react/jsx-runtime'; import { FC, SuspenseProps } from 'react'; import { A as AsyncState, C as ContainerType } from '../types-5EvFF6wb.cjs'; import 'keyweaver'; type Props = { state: S; /** A function to render the content when the {@link Props.state state} resolves successfully. */ render(value: S extends AsyncState ? V : never): ReturnType; /** A function or element to render if the {@link Props.state state} fails. */ renderIfError?: ((error: S extends AsyncState ? E : never) => ReturnType) | ReturnType; /** If provided, it wraps the rendered content or fallback only if they exist. */ container?: ContainerType; } & Pick; /** * A controller component for rendering a {@link Props.state state}. * It utilizes the {@link use} hook under the hood to retrieve the value or error of the provided state. * This component integrates with the {@link Suspense} component, deferring rendering until the state is resolved or an error occurs. * * @example * ```jsx * Loading...} * render={(data) =>
Data: {JSON.stringify(data)}
} * renderIfError={(error) =>
Error: {error.message}
} * /> * ``` */ declare const SuspenseController: (props: Props) => react_jsx_runtime.JSX.Element; export = SuspenseController;