import type { PageRoute, ScannedRoutes } from "../router/route-scanner.js"; import type { BuildConfig } from "../build/build.js"; import type { RouteParams } from "../types.js"; import { type CachePolicy } from "../cache/policy.js"; export interface RenderPageOptions { route: PageRoute; params?: RouteParams; searchParams?: URLSearchParams; config: Pick; /** Custom module loader. Defaults to native dynamic import. */ importer?: (path: string) => Promise; /** Per-page action names exposed in the HTML shell. */ actions?: Record; /** Current request, used to hydrate data loaders that need cookies/headers. */ request?: Request; } export interface RenderPageResult { html: string; revalidate?: number; /** * `Set-Cookie` header value that clears the action error cookie, when the * page consumed a relayed action failure. The SSR server should append it to * the outgoing response so the cookie does not persist. */ clearActionErrorCookie?: string; /** `` tags (title, meta, OG, twitter) for the SPA router to merge. */ head?: string; /** Resolved page title (from metadata or fallback). */ resolvedTitle?: string; /** * When a loader or layout throws a `Response` (e.g. `throw new Response(..., * { status: 404 })`), it is captured here as a first-class response instead * of being treated as an internal error (A-22). */ response?: Response; /** HTTP status code for the rendered page (e.g. 404 for not-found pages). */ status?: number; /** Cache policy declared by the route (ยง9.1). */ cachePolicy?: CachePolicy; } /** * Collects `` attributes and head scripts declared by data loaders * (page and layouts) via top-level `htmlAttributes` / `headScripts` fields. */ export declare function collectShellExtras(pageData: unknown, layoutDataList: unknown[]): { htmlAttributes: Record; headScripts: string[]; headLinks: string[]; }; export declare function renderPage(options: RenderPageOptions): Promise; export interface RenderErrorPageOptions { routes: ScannedRoutes; status: 404 | 500; error?: unknown; config: Pick; actions?: Record; importer?: (path: string) => Promise; } export declare function renderErrorPage(options: RenderErrorPageOptions): Promise<{ html: string; status: number; } | undefined>;