import { type Duplex } from 'node:stream'; export type RelayHostOptions = { relayUrl: string; hostId: string; /** Local gateway, e.g. 127.0.0.1:8443. Must be loopback. */ gateway: string; bearer: () => Promise; maxStreams?: number; signal?: AbortSignal; log?: (message: string) => void; connectGateway?: (host: string, port: number) => Promise; openData?: (url: string, protocols: string[]) => Promise; }; export declare function parseLoopbackGateway(value: string): { host: string; port: number; }; export declare function listRelayHosts(relayUrl: string, bearer: () => Promise, fetcher?: typeof fetch): Promise<{ hostId: string; since: string; }[]>; /** Serves relay streams until `signal` aborts. Reconnects with backoff. */ export declare function runRelayHost(options: RelayHostOptions): Promise;