import type { AddressInfo } from 'node:net'; import type { EcoPagesAppConfig } from '../../types/internal-types.js'; import type { StaticPreviewHost, StaticPreviewHostStartOptions } from '../shared/runtime/static-preview-host.js'; type NodeStaticPreviewServer = { start(): Promise<{ address(): AddressInfo | string | null; }>; stop(force?: boolean): Promise; }; type NodeStaticPreviewServerFactory = new (args: { appConfig: EcoPagesAppConfig; options?: { hostname?: string; port?: number; }; }) => NodeStaticPreviewServer; /** * Node preview-host wrapper that manages the lifecycle of the static preview * server used after a build. * * @remarks * The host separates preview-server construction from lifecycle control so the * Node server adapter can restart preview serving safely across repeated build * and preview flows. */ export declare class NodeStaticPreviewHost implements StaticPreviewHost { private readonly previewServerFactory; private previewServer; private stopPromise; /** * Creates the preview host with an injectable preview-server constructor. */ constructor(previewServerFactory?: NodeStaticPreviewServerFactory); /** * Starts the Node preview host after fully draining any previous preview server * shutdown that may still be in flight. * * @remarks * The host only publishes a new preview server after `start()` succeeds. That * keeps failed startup attempts from replacing the last known-good server with a * half-initialized instance. */ start(options: StaticPreviewHostStartOptions): Promise; /** * Stops the active preview server and coalesces overlapping stop requests onto * the same shutdown promise. * * @remarks * The host keeps the server reference until shutdown succeeds. If shutdown * fails, callers can still retry `stop()` or inspect the same live instance * instead of losing the handle during a rejected async stop. */ stop(force?: boolean): Promise; } export {};