import { Resolver } from '../types'; import { IdentityWrapper } from '../async'; /** * Service for handling network detection and retry logic. * * Provides: * - `isOnline()` - Check current connectivity * - `subscribe()` - Listen to online/offline changes * - `waitForOnline()` - Promise that resolves when online * - `offlineRetry()` - Wrapper for automatic retry on reconnection * * @example * ```ts * import { abortable, retry } from "storion/async"; * import { networkService } from "storion/network"; * * setup({ get, focus }) { * const network = get(networkService); * * const fetchUsers = abortable(async ({ signal }) => { * const res = await fetch("/api/users", { signal }); * return res.json(); * }); * * // Chain wrappers: retry 3 times, then wait for network * const robustFetch = fetchUsers * .use(retry(3)) * .use(network.offlineRetry()); * * const usersQuery = async.action(focus("users"), robustFetch); * * return { fetchUsers: usersQuery.dispatch }; * } * ``` */ export declare const networkService: ({ get }: Resolver) => { isOnline: () => boolean; subscribe: { (listeners: import('..').SingleOrMultipleListeners): VoidFunction; (map: (value: boolean) => { value: TValue; } | undefined, listeners: import('..').SingleOrMultipleListeners): VoidFunction; }; waitForOnline: () => Promise; offlineRetry: () => IdentityWrapper; dispose: () => void; }; /** * Type of the network service instance. */ export type NetworkService = ReturnType; //# sourceMappingURL=retry.d.ts.map