import type { PortProvider } from "./port-provider.js"; /** The highest port there is; a range naming one past it cannot be served. */ export declare const MAX_PORT = 65535; /** Where the port will be bound, when that is narrower than every interface. */ export interface PortHost { /** * The address the port is for, such as 127.0.0.1. Set it when that is where * the port will be bound: a port something holds on that one address can * still look open on every interface, so it is probed there as well. */ host?: string; } /** The ports to consider, `to` included; `to` left out means `from` alone. */ export interface PortRange extends PortHost { from: number; to?: number; } /** How many ports to consider, counting `from` itself. */ export interface PortSpan extends PortHost { from: number; span: number; } /** * Finds an open port by binding one and letting it go again, which is the only * way to ask the machine rather than guess at what it is running. */ export declare class OpenPortProvider implements PortProvider { private readonly from; private readonly to; private readonly host; constructor({ from, to, host }: PortRange); /** `span` ports from `from` on, which is what a dev server wants. */ static span({ from, span, host }: PortSpan): OpenPortProvider; /** Any port at all: 0 comes back, and whatever binds it is what chooses. */ static any(): OpenPortProvider; get(): Promise; private open; }