import type { EcoPagesAppConfig, RegisteredScriptEntrypointChangeHandler } from '../../types/internal-types.js'; export type { RegisteredScriptEntrypointChangeHandler }; export type DevelopmentInvalidationCategory = 'public-asset' | 'additional-watch' | 'include-source' | 'explicit-server-view' | 'route-source' | 'processor-owned-asset' | 'server-source' | 'other'; /** * Framework-owned invalidation plan for one changed file. * * @remarks * This is the explicit invalidation matrix Workstream 4 needs. Watchers and * runtime adapters consume this plan instead of encoding file-category rules in * host-specific control flow. */ export interface DevelopmentInvalidationPlan { category: DevelopmentInvalidationCategory; invalidateServerModules: boolean; refreshRoutes: boolean; reloadBrowser: boolean; delegateToHmr: boolean; processorHandledAsset: boolean; } /** * Framework-owned development invalidation service. * * @remarks * This service centralizes two responsibilities: * - file-change classification for watcher behavior * - app-owned server-module invalidation versioning backed by the dev graph * * Hosts and watchers should ask this service what a file change means instead * of deciding invalidation semantics inline. */ export declare class DevelopmentInvalidationService { private readonly appConfig; constructor(appConfig: EcoPagesAppConfig); /** * Returns the current app-owned server-module invalidation version. */ getServerModuleInvalidationVersion(): number; /** * Invalidates the app-owned server-module graph. */ invalidateServerModules(changedFiles?: string[]): void; /** * Registers an integration-owned handler for registered script entrypoint edits. */ registerRegisteredScriptEntrypointChangeHandler(handler: RegisteredScriptEntrypointChangeHandler): void; /** * Notifies integration handlers that a registered script entrypoint changed. */ notifyRegisteredScriptEntrypointChange(filePath: string): Promise; /** * Resets runtime-owned graph state and invalidates server modules. */ resetRuntimeState(changedFiles?: string[]): void; /** * Classifies one changed file into an explicit framework invalidation plan. */ planFileChange(filePath: string): DevelopmentInvalidationPlan; /** * Returns whether the file lives under the public directory. */ isPublicDirFile(filePath: string): boolean; /** * Returns whether the file matches `additionalWatchPaths`. */ matchesAdditionalWatchPaths(filePath: string): boolean; /** * Returns whether the file is a route source file. */ isRouteSourceFile(filePath: string): boolean; /** * Returns whether the file is an include/template source file. */ isIncludeSourceFile(filePath: string): boolean; /** * Returns whether the file is an explicit server-rendered view module. * * @remarks * These modules are typically registered through `renderServerModule` in * `app.ts` rather than the filesystem router. They need a full browser reload * because their HTML is produced on the server, not through client HMR entrypoints. */ isExplicitServerViewFile(filePath: string): boolean; /** * Returns whether the file is a server-executed source module outside the * special route/include buckets. */ isServerModuleSourceFile(filePath: string): boolean; /** * Returns whether a processor owns the changed file as an asset input. * * @remarks * Watch config drives processor notifications only. Asset ownership requires * declared capabilities so dependency-only watches (for example content * collection MDX scans) do not skip server invalidation and HMR. */ isProcessorOwnedAsset(filePath: string): boolean; }