import { type Server as NodeHttpServer } from 'node:http'; import type { EcoPagesAppConfig } from '../../types/internal-types.js'; type NodeStaticContentServerOptions = { hostname?: string; port?: number; }; /** * Serves prebuilt static Ecopages output through Node's HTTP server. * * @remarks * This server is used by the Node preview/build path once the app has already * emitted its static output. It intentionally stays small: path sanitization, * content-type selection, optional gzip serving, and 404 handling. */ export declare class NodeStaticContentServer { private readonly appConfig; private readonly options; private server; /** * Creates the Node static-content server for one built app output directory. */ constructor({ appConfig, options }: { appConfig: EcoPagesAppConfig; options?: NodeStaticContentServerOptions; }); /** * Returns whether the given content type should be served from a pre-gzipped * companion file when available. */ private shouldServeGzip; /** * Normalizes a request pathname and rejects directory traversal attempts. */ private sanitizePath; /** * Writes one HTTP response with the provided headers and optional body. */ private sendResponse; /** * Serves the generated 404 page when present, or a plain-text fallback. */ private sendNotFoundPage; /** * Serves one concrete file path, honoring gzip and HEAD semantics. */ private serveFile; /** * Handles one incoming Node HTTP request against the built static output tree. */ private handleRequest; /** * Starts the static preview server. */ start(): Promise; /** * Stops the static preview server and optionally closes active connections. */ stop(force?: boolean): Promise; [Symbol.asyncDispose](): Promise; } export {};