/** * On-demand / time-based revalidation for statically exported pages. * * Wraps `staticExport` so a deployment can rebuild a subset of routes without * re-rendering the whole catalog. Two modes: * - TTL based: revalidate any page older than `revalidateAfterMs`. * - Targeted: revalidate the specific paths listed in `force`. * * The result is written back to the same manifest file the original export * produced — so CDN purge keys (content hash) stay accurate. */ import type { StaticExportExtraOptions, StaticExportResult } from './static-export.js'; import type { StaticExportOptions, SsrRoute } from './types.js'; export interface RevalidationManifestEntry { file: string; hash: string; bytes: number; /** Unix milliseconds at which the page was last rendered. */ storedAt?: number; } export type RevalidationManifest = Record; export interface RevalidateStaticPagesOptions extends Omit, StaticExportExtraOptions { /** Routes that *could* be rebuilt. Each path is matched against the manifest key. */ routes: SsrRoute[]; /** Manifest path (relative to `outDir` or absolute). Defaults to `manifestFile` when given. */ manifestPath?: string; /** Rebuild pages older than this many milliseconds. */ revalidateAfterMs?: number; /** Force-rebuild this exact list of route paths. Combined with TTL mode. */ force?: string[]; /** Time source for tests. */ now?: () => number; /** * Injection point for the underlying rebuild. Defaults to a lazy import of * `staticExport` so production code calls the real renderer; tests can pass * a fake to avoid pulling in the React/security stack. */ renderer?: (opts: StaticExportOptions & StaticExportExtraOptions & { detailed: true; }) => Promise; } export interface RevalidateResult { /** Route paths that were rebuilt. */ revalidated: string[]; /** Route paths that were skipped (still fresh). */ skipped: string[]; /** Per-route failures bubbled up from `staticExport`. */ failures: Array<{ path: string; error: Error; }>; /** Updated manifest. */ manifest: RevalidationManifest; } /** * Inspect the manifest, pick stale (or force-listed) routes, re-render only * those, and write the merged manifest back to disk. */ export declare function revalidateStaticPages(opts: RevalidateStaticPagesOptions): Promise; //# sourceMappingURL=revalidate.d.ts.map