import { ReactNode } from "react"; //#region src/components/ClientOnly.d.ts interface ClientOnlyProps { readonly children: ReactNode; readonly fallback?: ReactNode; } declare function ClientOnly({ children, fallback }: ClientOnlyProps): ReactNode; //#endregion //#region src/components/ServerOnly.d.ts interface ServerOnlyProps { readonly children: ReactNode; readonly fallback?: ReactNode; } declare function ServerOnly({ children, fallback }: ServerOnlyProps): ReactNode; //#endregion //#region src/components/Streamed.d.ts interface StreamedProps { /** Shown while any descendant `use(promise)` / `` is pending. */ readonly fallback: ReactNode; readonly children: ReactNode; } /** * Cross-adapter alias for ``. Pairs with `` * for symmetry with `` boundaries in the SvelteKit / Solid * deferred-data conventions. * * ```tsx * }> * name="reviews"> * {(reviews) => } * * * ``` * * The component is a thin wrapper around React's native `` — no * additional behaviour. Use plain `` directly if you don't need * the cross-framework naming alignment. */ declare function Streamed({ fallback, children }: StreamedProps): ReactNode; //#endregion //#region src/components/HttpStatusCode.d.ts interface HttpStatusCodeProps { /** HTTP status to apply to the response. Common values: 404, 410, 451, 503. */ readonly code: number; } /** * Render-time HTTP status declaration. Mount inside a route component (typical * use case: a glob `*` route's NotFound page) when the status is decided by * the rendered tree rather than a loader. * * Writes `code` to the nearest ``'s sink during render and * returns `null`. With no provider mounted (the standard client-side case) * the component is a silent no-op — same component tree hydrates without * touching the DOM or warning about mismatches. * * Loader-driven errors (`LoaderNotFound` → 404, `LoaderRedirect` → 30x) keep * working as before; this component covers render-time decisions only. * * Last write wins when several `` instances mount in the * same render pass — sink reflects the last component that ran. * * ```tsx * // entry-server.tsx * import { renderToString } from "react-dom/server"; * import { createHttpStatusSink, HttpStatusProvider } from "@real-router/react/ssr"; * * const sink = createHttpStatusSink(); * const html = renderToString( * * * * * , * ); * response.status(sink.code ?? 200).send(html); * ``` * * **Streaming SSR (`renderToReadableStream`):** the response status MUST be * sent before the first body byte flushes. If `` is mounted * inside a late-resolving `` boundary, the sink write may happen * AFTER the headers are already on the wire — the override is then lost. * Either mount the component in the shell (above every `` that * could delay it) or `await stream.allReady` before reading `sink.code` * (which forfeits streaming benefits). For non-streaming SSR * (`renderToString`) there is no such ordering concern. * * **Valid `code` range:** Node's `res.end()` throws `Invalid status code` on * `NaN`, `0`, negative values, or values `> 999` — this surfaces as a 5xx / * dropped connection, not silent corruption. Pass a real HTTP status integer * (commonly 4xx/5xx; 100-999 is what Node accepts). */ declare function HttpStatusCode({ code }: HttpStatusCodeProps): ReactNode; //#endregion //#region src/utils/createHttpStatusSink.d.ts /** * Render-scoped HTTP status sink. Created per request on the server, passed to * ``, and read after `renderToString` / * `renderToReadableStream` to apply the value to the HTTP response. * * Last write wins: if the rendered tree mounts more than one * ``, the value reflects the last component that ran during * the render pass. * * No-op on the client — `` reads the optional context and * skips the write when no provider is mounted, so the same component tree can * be hydrated without changing behaviour. * * Constraints: * - **Per-request only.** Don't share a sink across requests; the rendered * tree mutates `code` in place. Module-level singletons leak status * between concurrent requests. * - **Don't `Object.freeze` the sink.** The component writes to `.code`; * freezing makes the assignment throw under ESM strict mode. */ interface HttpStatusSink { code: number | undefined; } declare function createHttpStatusSink(): HttpStatusSink; //#endregion //#region src/components/HttpStatusProvider.d.ts interface HttpStatusProviderProps { readonly sink: HttpStatusSink; readonly children: ReactNode; } declare function HttpStatusProvider({ sink, children }: HttpStatusProviderProps): ReactNode; //#endregion export { HttpStatusCode as a, StreamedProps as c, ClientOnly as d, ClientOnlyProps as f, createHttpStatusSink as i, ServerOnly as l, HttpStatusProviderProps as n, HttpStatusCodeProps as o, HttpStatusSink as r, Streamed as s, HttpStatusProvider as t, ServerOnlyProps as u }; //# sourceMappingURL=HttpStatusProvider-JE5sw8SA.d.ts.map