import { networkInterfaces } from 'node:os'; export type StableHostKind = 'tailscale-magicdns' | 'mdns-local' | 'gateway-interface' | 'loopback'; export interface TailscaleState { /** BackendState === 'Running'. */ readonly up: boolean; /** Self.DNSName from `tailscale status --json`, trailing dot stripped. */ readonly magicDnsName?: string | undefined; } export interface StableHostInputs { /** os.hostname(), possibly an FQDN, the `.local` name derives from its first label. */ readonly hostname: string; /** The routable IPv4 on the default-route interface, when known. */ readonly gatewayInterfaceIp?: string | undefined; /** First non-internal IPv4 in enumeration order, the last-resort address. */ readonly firstNonInternalIp?: string | undefined; /** Tailscale state, when the CLI is present and answered in time. */ readonly tailscale?: TailscaleState | undefined; } export interface ResolvedStableHost { readonly host: string; readonly kind: StableHostKind; /** True when `host` is a name that survives a DHCP lease change. */ readonly stable: boolean; } /** `.local` from the first label of a hostname, or null when there is no usable label. */ export declare function mdnsLocalName(host: string): string | null; /** * Resolve the stable host from injected inputs. Pure, no I/O, so the ladder is * exercised directly under mocked interface / tailscale states. */ export declare function resolveStableHost(inputs: StableHostInputs): ResolvedStableHost; /** First non-internal IPv4 in enumeration order, the last-resort address. */ export declare function firstNonInternalIpv4(nets: ReturnType): string | undefined; /** Parse the `src ` field out of a Linux `ip route get` line. */ export declare function parseIpRouteSrc(output: string): string | undefined; /** Parse `Self.DNSName` + running state out of `tailscale status --json` output. */ export declare function parseTailscaleStatus(json: string): TailscaleState | undefined; /** Gather the impure inputs the resolver needs, each bounded and failure-tolerant. */ export declare function probeStableHostInputs(): StableHostInputs; /** * The stable host for a printed/QR link given the endpoint's bind host. A * wildcard bind (0.0.0.0 / ::) resolves through the ladder; an explicit bind * host is honored as-is (loopback stays loopback). `probe` is injectable for * tests. */ export declare function stableUrlHostForBindHost(host: string, probe?: () => StableHostInputs): ResolvedStableHost; //# sourceMappingURL=stable-host.d.ts.map