/** * JavaScript HMR Strategy * * Handles hot module replacement for JavaScript and TypeScript entrypoints. * Invalidates dev-transform modules and decides whether the browser can hot-accept * the change or must reload. * * @module */ import { HmrStrategy, type HmrAction } from '../hmr-strategy.js'; import type { HmrRegisteredEntrypointsContext } from '../hmr-registered-entrypoints-context.js'; import type { EntrypointDependencyGraph } from '../../services/runtime-state/entrypoint-dependency-graph.service.js'; /** * Context interface providing access to HmrManager state. * Required for JsHmrStrategy to access registered entrypoints and configuration. */ export interface JsHmrContext extends HmrRegisteredEntrypointsContext { getWatchedFiles(): Map; getEntrypointDependencyGraph(): EntrypointDependencyGraph; getSrcDir(): string; getPagesDir(): string; getLayoutsDir(): string; getTemplateExtensions(): string[]; /** * @remarks * Integrations with higher-priority HMR strategies can use this to keep the * generic JS strategy from overwriting their emitted entrypoints when a shared * dependency changes. */ shouldProcessEntrypoint?(entrypointPath: string): boolean; invalidateDevTransformSource?(sourcePath: string): void; consumeRegisteredScriptReloadRequired?(filePath: string): boolean; } /** * Strategy for handling JavaScript/TypeScript file changes with hot reloading. */ export declare class JsHmrStrategy extends HmrStrategy { readonly type: 25; private context; constructor(context: JsHmrContext); matches(filePath: string): boolean; process(filePath: string): Promise; }