import type { EcoPagesAppConfig } from '../../types/internal-types.js'; import { type ServerInvalidationState } from './server-invalidation-state.service.js'; import { type EntrypointDependencyGraph } from './entrypoint-dependency-graph.service.js'; /** * Tracks development-time dependency relationships and invalidation state for * one Ecopages app instance. * * @remarks * The current contract stays intentionally small. It supports today's needs for * server-module cache invalidation and entrypoint-to-dependency lookups without * forcing the rest of the runtime to know about one specific graph * implementation. */ export interface DevGraphService extends ServerInvalidationState, EntrypointDependencyGraph { } /** * Minimal dev-graph implementation used when an app has no selective graph * metadata available. * * @remarks * This preserves correct behavior by using coarse invalidation version bumps. * Callers still pass changed-file information through the interface now so a * richer graph can become more selective later without changing call sites. */ export declare class NoopDevGraphService implements DevGraphService { private readonly invalidationState; private readonly dependencyGraph; /** * Returns the current coarse invalidation version. */ getServerInvalidationVersion(): number; /** * Invalidates all server-side module state by incrementing the shared version. */ invalidateServerModules(changedFiles?: string[]): void; /** * Indicates that this graph cannot target invalidation to one entrypoint set. */ supportsSelectiveInvalidation(): boolean; /** * Returns an empty entrypoint set because this implementation stores no * dependency graph metadata. */ getDependencyEntrypoints(filePath: string): Set; /** * Accepts dependency updates to preserve interface compatibility, but stores no * graph state in the noop implementation. */ setEntrypointDependencies(entrypointPath: string, dependencies: string[]): void; /** * Clears one entrypoint from the graph. * * @remarks * There is no stored graph state in this implementation, so this is a no-op. */ clearEntrypointDependencies(entrypointPath: string): void; /** * Resets graph-owned state for a fresh runtime cycle. */ reset(): void; } /** * In-memory development graph with entrypoint-to-dependency reverse lookups. * * @remarks * This is the current selective graph implementation used by development flows * that need to answer which entrypoints depend on a changed file while still * keeping invalidation state app-local. */ export declare class InMemoryDevGraphService implements DevGraphService { private readonly invalidationState; private readonly dependencyGraph; /** * Returns the current app-local server invalidation version. */ getServerInvalidationVersion(): number; /** * Invalidates the current server-module cache generation. * * @remarks * The current implementation still uses a coarse generation bump for server * modules. Selective dependency lookups are used by callers that need to limit * browser rebuild work. */ invalidateServerModules(changedFiles?: string[]): void; /** * Indicates that this graph can answer dependency-to-entrypoint lookups. */ supportsSelectiveInvalidation(): boolean; /** * Returns all known entrypoints that currently depend on the given file. */ getDependencyEntrypoints(filePath: string): Set; /** * Replaces the stored dependency set for one entrypoint. * * @remarks * The entrypoint itself is always included in its own dependency set so reverse * lookups can map a changed entry file back to that same entrypoint. */ setEntrypointDependencies(entrypointPath: string, dependencies: string[]): void; /** * Removes one entrypoint and all of its reverse dependency edges. */ clearEntrypointDependencies(entrypointPath: string): void; /** * Clears all graph state and starts a fresh invalidation generation. */ reset(): void; } /** * Returns the dev-graph service owned by one app instance. */ export declare function getAppDevGraphService(appConfig: EcoPagesAppConfig): DevGraphService; /** * Installs the dev-graph service that should back one app/runtime instance. */ export declare function setAppDevGraphService(appConfig: EcoPagesAppConfig, devGraphService: DevGraphService): void;