import type { Manifest } from "../manifest.js"; export interface GenerateClientEntryOptions { /** * Module specifier for the adapter's client runtime, e.g. `"@nifrajs/web-solid/client"`. * * **Contract:** the module MUST export `mountRouter({ router, routes, container })`. The generated * bootstrap imports the specifier and calls it - so a self-executing entry that mounts on import * builds cleanly and then does nothing, which is the trap this contract exists to name. The type is * a bare `string` because a specifier is resolved by the bundler, not the type system, so the * requirement is enforced by the bootstrap instead: it throws immediately, naming this module and * the missing export, rather than failing later as `mountRouter is not a function`. */ readonly clientModule: string; /** Turn a route/layout source file (relative to the routes dir) into an import specifier. */ readonly resolve: (file: string) => string; } /** * Codegen: emit a client-entry module (as source) that lazily imports each route's layout chain * (so `Bun.build` with `splitting` code-splits one chunk per route), builds a `patterns` list, * then creates the agnostic router store (with a `loadModule` hook), installs history + form * interception, loads the initial route's chunk, and hydrates the adapter's stateful Router. The * initial route is derived from the URL (falling back to the server-injected route id, e.g. * `_404`), so after hydration the Router owns navigation and swaps routes without full reloads. * Bun has no `import.meta.glob`, so file-based routing needs this. Write the result to a file and * bundle it with `buildClient` / `Bun.build` (+ the adapter's transform). */ export declare function generateClientEntry(manifest: Manifest, options: GenerateClientEntryOptions): string; export interface GenerateRouteSearchTypesOptions { /** Turn a route source file into a module specifier for a `typeof import(...)` type - the same contract * as `generateClientEntry`'s `resolve`, but WITHOUT a file extension (a `.d.ts` imports a module, not a * path). Relative to wherever the emitted `.d.ts` is written. */ readonly resolve: (file: string) => string; /** The module whose `RouteSearch` interface is augmented (default `"@nifrajs/web"`). Every adapter's * `NavigateTarget` reads `@nifrajs/web`'s `RouteSearch`, so the default types `navigate` on all of them. */ readonly module?: string; } /** * Codegen: emit a `.d.ts` that types cross-route `navigate({ to, search })` against each route's * `searchSchema`. It augments the {@link RouteSearch} map with `"": SearchOf` * for every **static** route (one with no `:param`/`*` segment - a concrete `to` a caller can pass; a * dynamic route's concrete path can't match its pattern key, so those keep the loose object form). Written * by `nifra sync-routes` next to the route tree and included in the app's `tsconfig`; because it is * regenerated from the route files, a `navigate` whose `search` no longer matches the route's schema * becomes a `tsc` error - the same drift guarantee as nifra's typed client, no hand-maintained map. */ export declare function generateRouteSearchTypes(manifest: Manifest, options: GenerateRouteSearchTypesOptions): string; export interface GenerateServerManifestOptions { /** Turn a route/layout source file (relative to the routes dir) into an import specifier - * same contract as `generateClientEntry`'s `resolve`. */ readonly resolve: (file: string) => string; /** The content-hashed client entry URL (from `buildClient`'s manifest), **baked** into the emitted * module - a disk-less worker can't read `manifest.json` at runtime. */ readonly clientEntry: string; /** The app's aggregate stylesheet URLs (`buildClient`'s `BuildManifest.css`) - baked as * `export const styles` so the server entry can hand them to `createWebApp` (→ `` * in ``). Without this the built SSR page ships no CSS link and renders unstyled. */ readonly styles?: readonly string[] | undefined; /** Per-route stylesheet URLs (`buildClient`'s `BuildManifest.routeStyles`) - baked as * `export const routeStyles` so a page links only the CSS its route chain uses. */ readonly routeStyles?: Readonly> | undefined; /** Emit **lazy** per-route loaders (`() => import("./routes/x")`, a static specifier) instead of * eager `import * as`, so a bundler with code-splitting emits one chunk per route - loaded on the * first request to it, not all at boot (smaller cold-start parse). Default `false` (eager). Both * modes are fs-free with statically-analyzable specifiers; only the *when* differs. */ readonly lazy?: boolean; } export declare function generateServerManifest(manifest: Manifest, options: GenerateServerManifestOptions): string; //# sourceMappingURL=codegen.d.ts.map