export declare function isWildcardHost(host: string | undefined): boolean; /** Loopback: correct on this machine, unreachable from any other one. */ export declare function isLoopbackHost(host: string | undefined): boolean; /** * Is the control plane answering on an address other machines can reach? * * True for a wildcard bind and for an explicit LAN/hostname bind; false for * loopback and for an unset host (the shipped default is loopback). */ export declare function isOffHostBind(bindHost: string | undefined): boolean; export interface NetworkInterfaceAddress { readonly address: string; readonly family: string | number; readonly internal: boolean; } export type NetworkInterfaceReader = () => Record; /** * The first non-internal IPv4 address on this host, or null. IPv4 only: an * IPv6 literal in a notification click target is far more likely to be * unroutable from a phone than helpful. */ export declare function findRoutableHostAddress(readInterfaces?: NetworkInterfaceReader): string | null; /** * Normalize one candidate base URL. Returns null when the URL is unusable as a * click destination and no substitute host is available. */ /** * The two answers there are. One run has exactly one of these, because it has * exactly one effective bind. */ export type ClickTargetMode = 'network' | 'local'; /** * Where the link is GOING, the discriminator, per the owner's ruling. * * - `off-host` the link will be opened somewhere else: a notification tapped * on a phone, a manifest handed to Home Assistant, an attachment URL posted * into a chat. Loopback is meaningless there. * - `local` the link will be opened on this machine. * * The bind mode alone cannot answer this. A loopback-only daemon used to put * `127.0.0.1` in the `Click` header of a notification read on a phone, which * is a dead link every time. */ export type ClickTargetDestination = 'off-host' | 'local'; /** * The bind mode in force, from the address the control plane is bound to. * * `network` means the daemon answers on every interface (or on a specific LAN * address); `local` means it answers only on loopback. Nothing else is a mode. */ export declare function resolveClickTargetMode(bindHost: string | undefined): ClickTargetMode; /** * The ONE host a click target may carry, given the bind mode and where the * link is going: * * | bind mode | destination | host | * |-----------|-------------|---------------------------------------------| * | network | off-host | this machine's routable LAN address, or null | * | network | local | loopback | * | local | off-host | **null**, nothing off-host can reach it | * | local | local | loopback | * * Never the wildcard: `0.0.0.0` is a bind address, not a destination, and is * not emitted in any mode. Null means the caller OMITS the link, a missing * link beats a broken one. * * Note the `network` + `local` cell: loopback is served by a wildcard bind, so * it is correct there. A daemon bound to one specific LAN address and nothing * else does not answer on loopback; that posture has no in-tree caller today * (every current caller is off-host) and is called out here rather than * silently assumed away. */ export declare function resolveClickTargetHost(mode: ClickTargetMode, destination: ClickTargetDestination, readInterfaces?: NetworkInterfaceReader): string | null; /** * Normalize one candidate base URL. * * A URL carrying a REAL host (a hostname, a LAN address, a tunnel) is the * operator's declared destination and passes through untouched in either mode. * A loopback or wildcard host is derived, not declared, and the mode decides * it, see {@link resolveClickTargetHost}. Returns null when the result would * not be reachable, and the caller omits the click target. */ export declare function normalizeReachableBaseUrl(raw: string | undefined, destination: ClickTargetDestination, readInterfaces?: NetworkInterfaceReader, /** * The address the control plane is BOUND to (`controlPlane.host`, or the * wildcard when `controlPlane.hostMode` is 'network'). Omitted, the URL's own * host states the intent: a wildcard URL is network intent, loopback is local. */ bindHost?: string | undefined): string | null; export interface ReachableBaseUrlReader { get(key: string): unknown; } export declare function resolveReachableBaseUrl(reader: ReachableBaseUrlReader, destination: ClickTargetDestination, readInterfaces?: NetworkInterfaceReader): string | undefined; //# sourceMappingURL=reachable-base-url.d.ts.map