export type ClientModuleStrategy = "fs" | "rsc-module"; export interface ClientModuleStrategyOptions { isLocalProject?: boolean; environment?: "preview" | "production"; } export interface ClientRuntimeHydrationData { pagePath?: string; clientModuleStrategy?: ClientModuleStrategy; /** Production release asset URLs keyed by source module path. */ releaseAssetModules?: Record; isolatedClientPage?: boolean; dev?: boolean; /** React version used for both server rendering and browser hydration. */ reactVersion?: string; /** Route slug for the current page (from the route match). */ slug?: string; /** Route params from the initial match — used to seed the reactive router. */ params?: Record; /** Page frontmatter — exposed reactively via `usePageContext()`. */ frontmatter?: Record; /** * Props returned by the page's `getServerData` — exposed reactively via * `usePageContext().data` so a hydrated client tree under an App/RSC page * reseeds with the same server data the server render used. */ props?: Record; /** Request-scoped dependency snapshot used to version browser module URLs. */ dependencyPinningCacheKey?: string; } export interface ClientModuleUrlOptions { strategy: ClientModuleStrategy; rel: string; absPath?: string; version?: string; dependencyPinningCacheKey?: string; releaseAssetModules?: Record | null; } export declare function determineClientModuleStrategy(options: ClientModuleStrategyOptions): ClientModuleStrategy; export declare function readHydrationData(doc?: Document): ClientRuntimeHydrationData | null; /** * Update the page-owned hydration state with the dependency snapshot returned * by an RSC transport. The token is server-issued and deliberately restricted * to enabled snapshot keys before it is persisted in the DOM. */ export declare function seedHydrationDependencyPins(doc: Document, dependencyPinningCacheKey: string | null | undefined): boolean; export declare function resolveClientModuleStrategy(hydrationData: ClientRuntimeHydrationData | null): ClientModuleStrategy; export declare function appendClientModuleVersion(url: string, version?: string): string; export declare function appendClientModuleDependencyPins(url: string, dependencyPinningCacheKey?: string): string; export declare function buildFsClientModuleUrl(path: string, version?: string): string; export declare function buildRSCModuleUrl(rel: string, version?: string, dependencyPinningCacheKey?: string): string; /** * Build headers for fetch-capable RSC transports. Application query parameters * remain application-owned; only dynamic import URLs carry snapshots in their * query string because import() cannot attach request headers. */ export declare function buildRSCTransportHeaders(hydrationData: ClientRuntimeHydrationData | null): Record; export declare function buildRSCActionUrl(_hydrationData: ClientRuntimeHydrationData | null): string; export declare function resolveReleaseAssetModuleUrl(releaseAssetModules: Record | null | undefined, path: string): string | null; export declare function buildClientModuleUrl(options: ClientModuleUrlOptions): string | null; export declare function getHydrationReactImportSpecifiers(doc?: Document, version?: string): { react: string; reactDomClient: string; }; /** * The import specifier for the framework router module, or `null` if the page's * import map does not own it. Returned as a value (not a literal) so callers can * `import(specifier)` and have the bundler leave it as a runtime import — the * module resolves to the app's React instance, which is required for the * provider's hooks to run under the same React as the hydrated component. */ export declare function getHydrationRouterImportSpecifier(doc?: Document): string | null; //# sourceMappingURL=client-module-strategy.d.ts.map