import { Server as HTTPServer } from "http"; import { IConsoleMessage } from "./console.interface.js"; import { RenderEngine } from "./render/render.types.js"; /** * Namespace for the Server Application. * @namespace Server * @public API */ export declare namespace Server { /** * Interface for the WebServer application implementation. */ interface IWebServer { listen(port: number | string, appInfo?: IConsoleMessage): Promise; setEngine(engine: RenderEngine.Engine, options?: T): Promise; } /** * Constructor type for IWebServer. */ interface IWebServerConstructor { new (): T; } /** * Interface for the WebServerBuilder. * @public API */ interface IWebServerBuilder { /** * Start listening on the given port. * @param port - The port number to listen on. * @param consoleMessage - Optional App info message to display on startup. */ listen(port: number | string, consoleMessage?: IConsoleMessage): Promise; } /** * Public Interface for the WebServer application. * @public API */ interface IWebServerPublic { /** * Get the underlying HTTP server. (default: Express.js) * @returns The underlying HTTP server after initialization. * @public API */ getHttpServer(): Promise; /** * Get the port the server is listening on. * Useful for dynamic port assignment (port: 0) in testing scenarios. * @returns The actual port number the server is bound to. * @public API */ getPort(): Promise; } } export type IWebServer = Server.IWebServer; export type IWebServerConstructor = Server.IWebServerConstructor; export type IWebServerBuilder = Server.IWebServerBuilder; export type IWebServerPublic = Server.IWebServerPublic;