import type { WebSocketHandler } from 'bun'; import type { EcoPagesAppConfig } from '../../types/internal-types.js'; import type { ClientBridge } from './client-bridge.js'; import { InMemoryEntrypointDependencyGraph, type EntrypointDependencyGraph } from '../../services/runtime-state/entrypoint-dependency-graph.service.js'; import { SharedHmrManager } from '../shared/hmr/shared-hmr-manager.js'; type BunSocketHandler = WebSocketHandler; export interface HmrManagerParams { appConfig: EcoPagesAppConfig; bridge: ClientBridge; } /** * Bun development HMR manager. * * @remarks * Bun shares the same public contract as the Node manager: page entrypoints are * strict integration-owned registrations, while generic script assets use their * own explicit registration path. */ export declare class HmrManager extends SharedHmrManager { private wsHandler; /** * Creates the Bun HMR manager around the shared HMR orchestration pipeline. * * @remarks * Bun delegates route watching, rebuild dispatch, and runtime bundle * generation to `SharedHmrManager`. The Bun subclass only supplies the * transport-specific dependency graph policy and websocket hook surface. */ constructor({ appConfig, bridge }: HmrManagerParams); /** * Reuses the shared in-memory dependency graph when possible and otherwise * creates the Bun-compatible default graph implementation. */ protected createEntrypointDependencyGraph(existingEntrypointDependencyGraph: EntrypointDependencyGraph): InMemoryEntrypointDependencyGraph; /** * Returns the Bun websocket hooks that attach and detach live HMR subscribers. * * @remarks * `SharedHmrManager` stores the bridge behind the transport-agnostic * `IClientBridge` contract because most HMR coordination only needs broadcast * behavior. Bun connection lifecycle wiring is the point where that abstraction * intentionally narrows back to the concrete Bun bridge so websocket instances * can be tracked directly. */ getWebSocketHandler(): BunSocketHandler; } export {};