/**
 * One reachability resolver for the fleet render (RUSH-1965).
 *
 * "Is this device online?" had three disagreeing answers: the live SSH probe
 * (`DeviceStats.reachable`, display-only), the persisted registry verdict, and
 * the cached `tailscale.online` snapshot that the online/offline word actually
 * read. A box reachable every day but whose tailscale snapshot was stale (or a
 * `via:"manual"` device that never got a tailscale field at all) rendered
 * "offline forever". This module is the single ordering the render + the
 * write-back both go through, so the word and the persisted truth agree.
 */
import type { DeviceProfile, DeviceReachability, DeviceRegistry } from './registry.js';
import type { DeviceStats } from './health.js';
export type OnlineState = 'online' | 'offline' | 'unknown';
/**
 * Resolve a device's online/offline state, preferring the freshest signal.
 *
 * Precedence: a live stat from THIS run (the probe that just ran) > the
 * persisted reachability verdict written back by a prior probe > the cached
 * `tailscale.online` snapshot. 'unknown' only when nothing at all is known.
 */
export declare function deviceOnlineState(d: DeviceProfile, stats?: DeviceStats): OnlineState;
/** Build the reachability verdict to persist from a fresh probe stat. Pure. */
export declare function reachabilityFromStats(d: DeviceProfile, stats: DeviceStats): DeviceReachability;
/**
 * Collect the reachability verdicts to write back for a fleet's freshly-read
 * stats map. Only devices present in the registry are included (a stat for a
 * name we don't track is dropped rather than resurrected). Pure — the caller
 * hands the result to {@link writeReachability}.
 */
export declare function collectReachabilityWriteBacks(reg: DeviceRegistry, statsMap: Map<string, DeviceStats>): Record<string, DeviceReachability>;
