/** * Cross-platform port introspection for the ports extension. * * Zero external dependencies. We shell out to the OS's native tooling and * parse its output, so a machine with many projects/services can be inspected * without requiring `lsof` from JS bindings or admin privileges. * * Detection order per platform: * - darwin: lsof -nP -iTCP -sTCP:LISTEN * - linux: ss -ltnp (fallback: netstat -ltnp) * - win32: netstat -ano (pids are resolved in a second best-effort pass) */ export interface PortEntry { port: number; protocol: "tcp" | "udp"; address: string; pid: number | null; process: string | null; } export interface PortScanResult { platform: string; command: string; entries: PortEntry[]; } /** Well-known services so the report can label ports humans recognize. */ export declare const KNOWN_PORTS: Record; export declare function knownPortLabel(port: number): string | undefined; export declare function scanPorts(): Promise; /** * Check a single port using a real bind attempt, which is the only reliable * cross-platform way to know whether a port is actually free (a service may be * listening only on a specific interface, so a "scan" alone is not enough). */ export declare function isPortFree(port: number, host?: string): Promise; /** * Find the first free port at or after `start`, bounded by `max`. */ export declare function findFreePort(start: number, max?: number, host?: string): Promise; //# sourceMappingURL=platform.d.ts.map