/** * AppState + NetInfo observers for AzureEngine. Best-effort — missing native * modules degrade to a no-op + warning so we don't crash outside RN. */ import { ClarionError, type ClarionWarning } from '@clarionhq/core'; export interface AppStateObserverCallbacks { /** Fired when app moves to background ('background' or 'inactive'). */ onBackground: () => void; /** Fired when app returns to foreground ('active'). */ onForeground: () => void; warn: (w: ClarionWarning) => void; } /** * Observes RN's AppState. Useful to auto-stop sessions when the user * backgrounds the app (the audio session deactivates anyway; better to fail * loudly than to keep accumulating finals that will never arrive). */ export declare class AppStateObserver { private readonly cb; private subscription; private appState; constructor(cb: AppStateObserverCallbacks); start(): void; stop(): void; } export interface NetworkObserverCallbacks { /** * Fired when connectivity is confirmed gone for at least * `gracePeriodMs` — gives flaky networks a chance to recover before we * surface a hard error. */ onDrop: (error: ClarionError) => void; /** Fired when connectivity returns. */ onReconnect: () => void; /** Fired for brief blips that recovered within the grace period. */ warn: (w: ClarionWarning) => void; } export interface NetworkObserverOptions { /** Wait this long before classifying a drop as a real error. Default: 2000 ms. */ gracePeriodMs?: number; } /** * Observes network connectivity via the optional `@react-native-community/netinfo` * package. If NetInfo isn't installed, the observer is a no-op (and emits a * warning at start so devs know). */ export declare class NetworkObserver { private readonly cb; private readonly options; private unsub; private graceTimer; private wasConnected; constructor(cb: NetworkObserverCallbacks, options?: NetworkObserverOptions); start(): void; stop(): void; private cancelGrace; } //# sourceMappingURL=AzureEngineObservers.d.ts.map