/** * @jorvel/ssr — staticExport * * Pre-renders a list of routes to static HTML files. * * @example * ```ts * import { staticExport } from '@jorvel/ssr'; * * await staticExport({ * routes: [ * { path: '/' }, * { path: '/dashboard/settings' }, * { path: '/dashboard/users/42', params: { id: '42' } }, * ], * App, * template: fs.readFileSync('index.html', 'utf8'), * outDir: 'dist', * }); * ``` */ import type { StaticExportOptions, StaticPage } from './types.js'; export interface StaticExportFailure { path: string; error: Error; } export interface StaticExportManifestEntry { file: string; /** Content SHA-256, hex-encoded (16-char prefix). */ hash: string; bytes: number; } export interface StaticExportResult { pages: StaticPage[]; failures: StaticExportFailure[]; manifest: Record; } export interface StaticExportExtraOptions { /** Maximum concurrent route renders. Default 8. Set to 1 for sequential. */ concurrency?: number; /** * When set, write a JSON manifest mapping route path → output file + content * hash + byte length. Use it for ETag/CDN purge keys. Path is relative to * `outDir` (or absolute). */ manifestFile?: string; } /** * Pre-render all routes and optionally write them to `outDir`. * * Returns the list of generated pages plus any per-route failures so callers * can fail their own build deterministically. The caller decides whether to * throw on `failures.length > 0`. */ export declare function staticExport(options: StaticExportOptions & StaticExportExtraOptions): Promise; export declare function staticExport(options: StaticExportOptions & StaticExportExtraOptions & { detailed: true; }): Promise; //# sourceMappingURL=static-export.d.ts.map