/** * @jorvel/ssr — renderToString * * Synchronously renders a React component tree to an HTML string for a given * server-side request path. Uses React 18's `renderToString` so the output is * hydratable; for static-only exports use `renderToStaticMarkup` directly. * * For streaming SSR, see `render-to-stream.ts`. */ import type { ComponentType } from 'react'; import type { SsrRenderResult, SsrRoute } from './types.js'; export interface RenderRouteOptions { /** * If true (default for hydratable use), uses `renderToString` which emits * hydration markers. Set to false for static export / email rendering. */ hydratable?: boolean; } /** * Render a React component tree to an HTML string. * * @param App - The root component to render. Receives `{ path, params }`. * @param route - The route to render (`path` + optional `params`). * @param opts - Options. * @returns An `SsrRenderResult` with `{ html, statusCode }`. * * @example * ```ts * import { renderRouteToString } from '@jorvel/ssr'; * * const { html } = await renderRouteToString(App, { path: '/dashboard/settings' }); * ``` */ export declare function renderRouteToString(App: ComponentType<{ path: string; params?: Record; }>, route: SsrRoute, opts?: RenderRouteOptions): Promise; /** * Inject rendered HTML into an HTML shell template. * * The template must contain the placeholder ``. An optional * `` placeholder will be replaced with `headExtra` when given — * use this for state-hydration `'); * ``` */ export declare function injectIntoTemplate(template: string, html: string, headExtra?: string): string; //# sourceMappingURL=render-to-string.d.ts.map