import type { EcoPageFile, GetMetadata, GetMetadataContext, GetStaticProps, PageMetadataProps, RouteRendererOptions, EcoPageComponent } from '../../types/public-types.js'; import type { EcoPagesAppConfig } from '../../types/internal-types.js'; /** * Loads route page modules and normalizes their data hooks for rendering. * * @remarks * This service keeps the render pipeline from depending directly on raw module * imports. It owns the shared server-module transpiler setup, the precedence * rules between component statics and module exports, and the normalization of * page props and metadata into one renderer-facing shape. */ export declare class PageModuleLoaderService { private appModuleLoader; private appConfig; private runtimeOrigin; /** * Creates the page-module loader for one app/runtime instance. * * @param appConfig Finalized app config that owns build and invalidation state. * @param runtimeOrigin Runtime origin exposed to page data hooks. */ constructor(appConfig: EcoPagesAppConfig, runtimeOrigin: string); /** * Imports one page module through the shared server-side module loading path. * * @remarks * The underlying transpiler keeps Bun and Node aligned on one framework-owned * loading contract even though the runtime-specific execution transport differs. */ importPageFile(file: string, options?: { bypassCache?: boolean; }): Promise; /** * Executes the page's static-props hook with Ecopages runtime context. * * @remarks * Pages without a static-props hook still return a normalized empty props * object so downstream render preparation does not branch on hook presence. */ getStaticPropsForPage(options: { getStaticProps?: GetStaticProps>; params?: RouteRendererOptions['params']; }): Promise<{ props: Record; metadata?: PageMetadataProps; }>; /** * Builds the final page metadata object for one render request. * * @remarks * App-level default metadata forms the baseline, then page-level metadata is * overlaid so route-specific fields win without dropping global defaults. */ getMetadataPropsForPage(options: { getMetadata: GetMetadata | undefined; context: GetMetadataContext; }): Promise; /** * Loads a page module and normalizes integration-facing exports. * When both component static methods and module exports exist, component statics win. */ resolvePageModule(options: { file: string; pageModule?: EcoPageFile; importPageFileFn?: (file: string) => Promise; }): Promise<{ module: EcoPageFile; Page: EcoPageFile['default'] | EcoPageComponent; getStaticProps?: GetStaticProps>; getMetadata?: GetMetadata; integrationSpecificProps: Record; }>; /** * Resolves the page data needed by the render pipeline. * * @remarks * Static props are resolved first because page metadata may depend on those * props. This preserves the same ordering whether data hooks are declared as * component statics or module exports. */ resolvePageData(options: { pageModule: { getStaticProps?: GetStaticProps>; getMetadata?: GetMetadata; }; routeOptions: RouteRendererOptions; }): Promise<{ props: Record; metadata: PageMetadataProps; }>; }