import type { EcoPagesAppConfig } from '../types/internal-types.js'; import type { SitemapConfig, StaticRoute } from '../types/public-types.js'; import type { PageRendererResolver, StaticGenerationRendererResolver } from '../route-renderer/route-renderer.js'; import type { StaticGenerationRoute } from '../router/server/route-registry.js'; import type { RouteModuleBuildCache } from '../services/module-loading/route-module-build-cache.store.js'; type StaticGenerationRouteSource = { listStaticGenerationRoutes(input: { runtimeOrigin: string; }): Promise; }; type StaticPageRouteRendererFactory = PageRendererResolver; type StaticGenerationRendererFactory = StaticGenerationRendererResolver; export declare const STATIC_SITE_GENERATOR_ERRORS: { readonly ROUTE_RENDERER_FACTORY_REQUIRED: "RouteRendererFactory is required for render strategy"; readonly unsupportedBodyType: (bodyType: string) => string; readonly missingIntegration: (routePath: string) => string; readonly noRendererForIntegration: (integrationName: string) => string; readonly dynamicRouteRequiresStaticPaths: (routePath: string) => string; }; /** * Generates static output files from the finalized app config and route graph. * * @remarks * This class intentionally reuses the same routing, renderer, and server-module * loading seams used by runtime rendering. Static generation should be a build * loop over the normal app model, not a parallel rendering stack with different * semantics. */ export declare class StaticSiteGenerator { appConfig: EcoPagesAppConfig; private readonly routeModuleBuildCacheOverride?; private staticRenderCacheContext; private forceFullStaticGeneration; private pageModuleLoader?; /** * Creates the static-site generator for one app config. */ constructor({ appConfig, routeModuleBuildCache, }: { appConfig: EcoPagesAppConfig; routeModuleBuildCache?: RouteModuleBuildCache; }); private getRouteModuleBuildCache; private getExportDir; private shouldSkipStaticPageFile; private shouldSkipStaticView; /** * Writes the robots.txt file declared by the app config. */ generateRobotsTxt(): void; /** * Writes the configured sitemap file to the export directory. */ generateSitemap(locations: readonly string[], sitemap: SitemapConfig): void; /** * Returns whether the input path points at the root directory. */ isRootDir(path: string): boolean | null; /** * Collects parent directories that must exist for the generated route set. */ getDirectories(routes: string[]): string[]; private writeStaticOutput; private writeStaticPageArtifact; /** * Marks a successfully exported pathname as sitemap-eligible when robots allow indexing. * * @remarks * Fail-closed: metadata resolution errors omit the URL. `robots.index === false` * also omits it. Eligibility is decided during generation, not by reloading modules * after `afterStaticExport`. */ private considerSitemapEligibility; private getPageModuleLoader; private resolveFilesystemPageMetadata; private resolveExplicitViewMetadata; private pruneStaleStaticOutputs; private createFilesystemStaticContents; /** * Generates static output for all filesystem-discovered routes. * * @remarks * Routes are rendered through the normal route renderer directly. */ generateStaticPages(input: { router: StaticGenerationRouteSource; baseUrl: string; routeRendererFactory?: StaticPageRouteRendererFactory; skipped?: string[]; activeStaticPathnames?: Set; preloadedRoutes?: readonly StaticGenerationRoute[]; sitemapEligiblePathnames?: Set; }): Promise; private createStaticExportContext; private invokeStaticExportHook; /** * Executes the full static-generation workflow for one app run. */ run({ router, baseUrl, routeRendererFactory, staticRoutes, force, preserveExportDirectory, }: { router: StaticGenerationRouteSource; baseUrl: string; routeRendererFactory?: StaticGenerationRendererFactory; staticRoutes?: StaticRoute[]; force?: boolean; preserveExportDirectory?: boolean; }): Promise; private generateExplicitStaticPages; private resolveExplicitViewSourceFile; private generateExplicitStaticRoute; private planExplicitStaticRoute; private createExplicitStaticContents; private listExplicitStaticRouteEntries; /** * Resolve a route path template with actual params. * Supports both :param and [param] syntax. */ private resolveRoutePath; /** * Get the output file path for a given route. */ private getOutputPath; } export {};