import type { Deferred } from "@nifrajs/web"; /** * `@nifrajs/web-react/await` - the `` primitive for deferred loader data (`defer()`). Isomorphic * and imports only `react` + a type from `@nifrajs/web` (never `react-dom/server`), so route components * can use it without dragging server code into the client bundle. No JSX (the package builds with * plain `tsc`). * * The server streams the boundary: `use(promise)` suspends, React flushes the fallback then the * resolved content mid-stream. On the client the registry promise is already settled (the core's * streamed `__nifraResolve` script tagged it `fulfilled`), so `use()` returns the value synchronously * - React hydrates the server-revealed boundary's content directly (no re-fetch, no fallback flash). */ import { type ReactNode } from "react"; export interface AwaitProps { /** A `Deferred` from a loader's `defer(...)`, or an already-resolved value (client nav). */ readonly resolve: Deferred | T; readonly fallback?: ReactNode; /** Rendered if the deferred rejects (the streamed `__nifraReject`). Without it the error * propagates to the nearest error boundary. */ readonly errorFallback?: (error: unknown) => ReactNode; readonly children: (value: T) => ReactNode; } /** * Render deferred loader data: show `fallback` until the `Deferred` settles (streamed in by the * server), then `children(value)`. An already-resolved `resolve` (a client navigation awaited it) * renders immediately. Pairs with a loader's `defer(...)`. */ export declare function Await(props: AwaitProps): ReactNode; //# sourceMappingURL=await.d.ts.map