/** * Connectivity auto-tracker. Subscribes to * `@react-native-community/netinfo` (when installed) and emits: * * - INTERNET_CONNECTED when `state.isConnected` flips to `true`. * - INTERNET_DISCONNECTED when it flips to `false`. * * The tracker degrades gracefully to a no-op when NetInfo is not * installed - it is an optional peer dependency. Whether the host * sees an initial baseline event depends on the underlying NetInfo * implementation: `@react-native-community/netinfo` >= 6 fires the * listener once on subscribe with the current state, in which case * a boot-offline launch emits one `INTERNET_DISCONNECTED` baseline; * older NetInfo builds and custom mocks may not. The tracker does * not call `NetInfo.fetch()` itself - it would require widening the * minimal `NetInfoLike` contract and most realistic NetInfo builds * already deliver the baseline through `addEventListener`. * * `isConnected === null` (the "unknown" RN state) is treated as a * no-op so the tracker does not emit a misleading * `INTERNET_DISCONNECTED` for the brief window before the OS reports * a real value. */ import type { KeewanoTracker } from '../types/config'; import type { NetworkTrackerArgs } from './types/NetworkTracker'; declare class NetworkTracker implements KeewanoTracker { readonly name = "NetworkTracker"; private readonly args; constructor(args: NetworkTrackerArgs); /** * Subscribe to NetInfo connectivity transitions. Returns a no-op * detach when NetInfo is absent or its `addEventListener` is not * a function (broken shim). */ attach(): () => void; } export type { NetworkTrackerArgs } from './types/NetworkTracker'; export { NetworkTracker };