import { type IncomingMessage, type Server, type ServerResponse } from 'node:http'; import type { AddressInfo } from 'node:net'; import * as Pool from './Pool.js'; export type CreateServerParameters = Pool.define.Parameters & ({ /** Host to run the server on. */ host?: string | undefined; /** Port to run the server on. */ port: number; } | { host?: undefined; port?: undefined; }); export type CreateServerReturnType = Omit, 'address'> & { address(): AddressInfo | null; start(): Promise<() => Promise>; stop(): Promise; }; /** * Creates a server that manages a pool of instances via a proxy. * * @example * ``` * import { Instance, Server } from 'prool' * * const server = Server.create({ * instance: Instance.anvil(), * }) * * const server = await server.start() * // Instances accessible at: * // "http://localhost:8545/1" * // "http://localhost:8545/2" * // "http://localhost:8545/3" * // "http://localhost:8545/n" * // "http://localhost:8545/n/start" * // "http://localhost:8545/n/stop" * // "http://localhost:8545/n/restart" * // "http://localhost:8545/healthcheck" * ``` */ export declare function create(parameters: CreateServerParameters): CreateServerReturnType; //# sourceMappingURL=Server.d.ts.map