import type { ServeOptions, Server } from "../../base.js"; type RequestHandler = (request: Request) => Promise | Response; type ServerFactory = (handler: RequestHandler, options: ServeOptions) => Promise; /** * Own every server started by a runtime adapter. * * Startups that race with shutdown are retired before their promises reject. * Successful direct `Server.stop()` calls unregister themselves, concurrent * shutdown callers share one attempt, and failed stops remain tracked so a * later shutdown can retry only the unfinished resources. */ export declare class ManagedServerRegistry { private readonly servers; private readonly pendingStarts; private shuttingDown; private shutdownPromise; start(createServer: ServerFactory, handler: RequestHandler, options: ServeOptions): Promise; shutdown(): Promise; private track; private stopAll; } export declare function createServeHandler(createServer: ServerFactory, registry: ManagedServerRegistry): (handler: RequestHandler, options?: ServeOptions) => Promise; export {}; //# sourceMappingURL=server-lifecycle.d.ts.map