/** * Server Readiness Polling * Issue #1195: Guided quickstart for `npx commandmate` * * Polls a TCP endpoint until it accepts a connection or the timeout elapses. * Never throws: a timeout is reported as `false` so callers can degrade * gracefully (e.g. print the URL anyway) instead of failing the command. * * @module server-ready */ export interface WaitForServerOptions { /** Total time to wait before giving up (ms) */ timeoutMs?: number; /** Delay between connection attempts (ms) */ intervalMs?: number; } export declare const DEFAULT_TIMEOUT_MS = 30000; export declare const DEFAULT_INTERVAL_MS = 300; /** * Wait until a TCP endpoint accepts a connection. * * @param host - Host to connect to * @param port - Port to connect to * @param options - Timeout and polling interval overrides * @returns true if the server accepted a connection, false on timeout */ export declare function waitForServer(host: string, port: number, options?: WaitForServerOptions): Promise; /** * Whether something is accepting TCP connections on host:port right now. * * Issue #3087: a single attempt, used where "the port is free" has to be proven * (before `start` spawns a server, after `stop` claims to have stopped one) * rather than waited for. * * @param host - Host to connect to * @param port - Port to connect to * @param timeoutMs - How long one connection attempt may take * @returns true if a connection was accepted */ export declare function isPortInUse(host: string, port: number, timeoutMs?: number): Promise; //# sourceMappingURL=server-ready.d.ts.map