import { createServer, type Server as NodeServerInstance } from 'node:http'; import type { RuntimeHost, RuntimeHostStartOptions } from '../shared/runtime/runtime-host.js'; import { NodeHttpRequestBridge } from './http-request-bridge.js'; type NodeServerFactory = typeof createServer; /** * Node runtime host that binds the shared Web-request pipeline onto a concrete * Node HTTP server. * * @remarks * The host owns only transport concerns: creating the Node listener, converting * requests through `NodeHttpRequestBridge`, and handling socket-level failures. * Routing and rendering remain in the shared server adapter. */ export declare class NodeRuntimeHost implements RuntimeHost { private readonly requestBridge; private readonly serverFactory; /** * Creates a Node runtime host with injectable request bridging and server * creation seams for tests and alternate hosts. */ constructor(requestBridge: NodeHttpRequestBridge, serverFactory?: NodeServerFactory); /** * Starts the Node HTTP server and wires each request through the shared Web * request pipeline. * * @remarks * Client disconnects are treated as normal aborts and do not trigger adapter * error logging or the runtime host's `onError` callback. */ start(options: RuntimeHostStartOptions<{ port?: number; hostname?: string; }>): Promise; /** * Stops the Node HTTP server and, by default, force-closes any remaining open * connections. */ stop(server: NodeServerInstance, options?: { force?: boolean; }): Promise; /** * Resolves the public runtime origin from the bound Node listener. * * @remarks * The host preserves the configured hostname rather than echoing the raw socket * address because users care about the requested host contract, not the local * bind interface that Node chose internally. */ getOrigin(server: NodeServerInstance, fallbackServeOptions: { port?: number; hostname?: string; }): string; } export {};