/** * The address a phone on the same network can reach this machine at. * * `bitmagic dev --mobile` has to put a URL on screen that a creator scans and their phone resolves, * and the only thing that can answer "which of my addresses is that" is the host's own interface * list. There is no discovery here and no mDNS: a `.local` name works on Apple devices and fails * quietly on many Android ones, whereas a literal IPv4 works everywhere and is what the certificate * has to name anyway (`dev-cert.ts` puts it in the SAN). * * Only PRIVATE IPv4 addresses are offered. A machine with a public address on an interface would * still bind it — the bridge listens on 0.0.0.0 — but printing it, and drawing a QR of it, would * invite a creator to hand out a URL that is not merely LAN-visible. Loopback is excluded for the * obvious reason, and 169.254/16 because an interface that self-assigned has no network to be on. */ import type * as os from 'os'; export interface LanAddress { /** The interface it was found on, so a machine with several can be told which is which. */ name: string; address: string; } /** What `os.networkInterfaces()` returns, as a parameter so the pick is testable off a fixture. */ export type NetworkInterfaces = ReturnType; /** * Every address a phone could plausibly reach, best candidate first. * * Returns all of them rather than one, because a laptop on Wi-Fi and Ethernet at once has two right * answers and only the creator knows which network the phone is on — `dev` prints the rest under * the one it drew a QR for. */ export declare function lanAddresses(interfaces: NetworkInterfaces): LanAddress[];