import type { GroupedGraphScope } from './route-instance-key.js'; import type { EcoPagesAppConfig } from '../../../types/internal-types.js'; import type { PageBrowserGraphContribution, PageBrowserGraphResult } from '../../../types/public-types.js'; import type { ProcessedAsset } from '../../../services/assets/asset-processing-service/assets.types.js'; export type GraphPolicy = 'development' | 'production'; export type GraphKey = { integrationName: string; routeFile: string; dependencyInstanceKey: string; entryFingerprint: string; policy: GraphPolicy; }; export type GraphRecord = { key: GraphKey; result: PageBrowserGraphResult; dependencyPaths: ReadonlySet; committedAt: number; generation: number; }; export type GraphBuildResult = { result: PageBrowserGraphResult; dependencyPaths: ReadonlySet; /** * @remarks * When false, the build result is returned to callers but not committed to the session cache. */ cacheable?: boolean; }; type GroupedGraphRecord = { assetsByRoute: Map; dependencyPaths: ReadonlySet; generation: number; }; export type GroupedGraphBuildOutcome = GroupedGraphRecord | { skipCache: true; assetsByRoute: Map; dependencyPaths: ReadonlySet; }; export type AffectedGraphIdentity = { integrationName: string; routeFile: string; dependencyInstanceKey: string; policy: GraphPolicy; entryFingerprint: string; }; /** * Reverse index from dependency paths to graph cache keys. */ export declare class GraphDependencyIndex { private readonly dependencyToGraphKeys; bindRecord(record: GraphRecord): void; unbindRecord(record: GraphRecord): void; bindGroupedRecord(cacheKey: string, record: GroupedGraphRecord): void; unbindGroupedRecord(cacheKey: string, record: GroupedGraphRecord): void; bindPaths(serializedKey: string, dependencyPaths: ReadonlySet): void; unbindPaths(serializedKey: string, dependencyPaths: ReadonlySet): void; getAffectedKeys(filePath: string): Set; resetForTests(): void; private addDependencyBinding; private removeDependencyBinding; } /** * Session-local Page Browser Graph cache with precise dependency invalidation. */ export declare class SessionPageBrowserGraphCache { private readonly records; private readonly inFlight; private readonly inFlightDependencyPaths; private readonly inFlightGenerations; private readonly groupedRecords; private readonly groupedInFlight; private readonly dependencyIndex; private readonly graphGenerations; private readonly groupedGenerations; private buildCount; /** * Page Browser Graph compilations in this dev-server session. */ getBuildCount(): number; getGraphByRoute(integrationName: string, routeFile: string, policy: GraphPolicy, dependencyInstanceKey?: string): PageBrowserGraphResult | undefined; getDependencyPathsByRoute(integrationName: string, routeFile: string, policy: GraphPolicy, dependencyInstanceKey?: string): ReadonlySet | undefined; getAffectedGraphIdentities(filePath: string): AffectedGraphIdentity[]; resolveGraph(key: GraphKey, provisionalDependencyPaths: ReadonlySet, build: () => Promise): Promise; resolveGroupedGraph(scope: GroupedGraphScope, build: () => Promise): Promise>; peekGroupedGraph(scope: GroupedGraphScope): Map | undefined; invalidateByFilePath(filePath: string): number; invalidateRoute(integrationName: string, routeFile: string): void; invalidateByRouteFile(routeFile: string): void; resetForTests(): void; exportRecords(policy: GraphPolicy): GraphRecord[]; clearPolicyRecords(policy: GraphPolicy): void; private pruneStaleRouteRecords; private bumpGraphGeneration; private bumpGroupedGeneration; private invalidateSerializedGraphKey; private invalidateGroupedRecord; private runGraphBuild; private runGroupedBuild; private canCommitGraphBuild; private canCommitGroupedBuild; private bindDependencyPaths; private unbindDependencyPaths; private clearInFlightBuild; private releaseInFlightDependencyPaths; } /** * Returns the session graph cache for one app instance. */ export declare function getAppPageBrowserGraphSession(appConfig: EcoPagesAppConfig): SessionPageBrowserGraphCache; /** * Invalidates graph records that depend on the changed file path. */ export declare function invalidatePageBrowserGraphSession(appConfig: EcoPagesAppConfig, filePath: string): number; /** * Returns graph identities affected by a source file change. */ export declare function getAffectedPageBrowserGraphIdentities(appConfig: EcoPagesAppConfig, filePath: string): AffectedGraphIdentity[]; /** * Builds a stable fingerprint from declared browser-entry dependencies and assets. */ export declare function createPageBrowserGraphEntryFingerprint(contribution: PageBrowserGraphContribution): string; /** * Collects dependency paths used for graph invalidation. */ export declare function collectPageBrowserGraphDependencyPaths(routeFile: string, contribution: PageBrowserGraphContribution, processedAssets: ProcessedAsset[]): ReadonlySet; export {};