import { Factory } from '../types'; export interface PingService { /** * Check if the network is reachable. * Default: 300ms delay, returns true (optimistic). */ ping(): Promise; } export interface OnlineService { /** * Get current online status. * Default: uses navigator.onLine if available. */ isOnline(): boolean; /** * Subscribe to online/offline events. * Default: uses window 'online'/'offline' events. * * @returns Unsubscribe function */ subscribe(listener: (online: boolean) => void): VoidFunction; } /** * Service for checking network reachability. * * Default implementation: 300ms delay, always returns true (optimistic). * * Override for real connectivity check: * ```ts * container.set(pingService, () => ({ * ping: async () => { * try { * await fetch('/api/health', { method: 'HEAD' }); * return true; * } catch { return false; } * }, * })); * ``` */ export declare const pingService: Factory; /** * Service for online/offline event subscription. * * Default implementation: uses browser's navigator.onLine and window events. * * Override for React Native: * ```ts * import NetInfo from '@react-native-community/netinfo'; * * container.set(onlineService, () => ({ * isOnline: () => true, * subscribe: (listener) => NetInfo.addEventListener(s => listener(!!s.isConnected)), * })); * ``` */ export declare const onlineService: Factory; //# sourceMappingURL=services.d.ts.map