import type { Server } from "node:http"; export type PortHolder = "humanish" | "other"; export declare class PortInUseError extends Error { readonly port: number; readonly holder: PortHolder; constructor(port: number, holder: PortHolder); } /** * Is the process on this port one of ours? humanish's serve and observer servers answer * `/_humanish/history.json` (serve) or `/observer-data.json` (observer) as JSON with a humanish * schema; anything else is somebody's app. Bounded to half a second and never throws: a probe * that cannot decide says "other", which is the answer that suggests the safer action. */ export declare function probePortHolder(port: number, fetchFn?: typeof fetch): Promise; /** Bind on loopback only; resolve the port that was actually bound; name a taken port. */ export declare function listenOnLoopback(server: Server, port: number, probe?: (port: number) => Promise): Promise;