import { Server } from "http"; /** * Starts an HTTP server on the specified port using Node's built-in `http` module. * All incoming requests are delegated to the custom `handleRequest` router. * * @param port - The port number on which the server should listen. * @param options - Optional configuration including cleanup callback */ export declare function serve(port: number, options?: { onShutdown?: () => Promise; }): void; /** * Sets up graceful shutdown handling for the provided HTTP server. * Ensures that the server stops accepting new connections and waits for active requests to finish before exiting. * Optionally, a timeout can be specified to force shutdown if requests do not complete in time. * * @param server - The HTTP server instance to manage. * @param opts - Optional configuration for shutdown behavior. * @param opts.timeoutMs - Maximum time in milliseconds to wait for active requests before forcing shutdown (default: 10000ms). * @param opts.onShutdown - Optional cleanup callback to run before shutdown (e.g., close database connections, clear caches) */ export declare function setupGracefulShutdown(server: Server, opts?: { timeoutMs?: number; onShutdown?: () => Promise; }): void; //# sourceMappingURL=server.d.ts.map