import type { AsyncStorage } from '@tanstack/query-persist-client-core'; import type { MaybePromise } from '@tanstack/query-persist-client-core'; import type { PersistedClient } from '@tanstack/query-persist-client-core'; import type { Persister } from '@tanstack/query-persist-client-core'; import type { Promisable } from '@tanstack/query-persist-client-core'; export declare type AsyncPersistRetryer = (props: { persistedClient: PersistedClient; error: Error; errorCount: number; }) => Promisable; export declare function asyncThrottle>(func: (...args: TArgs) => Promise, { interval, onError }?: AsyncThrottleOptions): (...args: TArgs) => Promise; declare interface AsyncThrottleOptions { interval?: number; onError?: (error: unknown) => void; } export declare const createAsyncStoragePersister: ({ storage, key, throttleTime, serialize, deserialize, retry, }: CreateAsyncStoragePersisterOptions) => Persister; declare interface CreateAsyncStoragePersisterOptions { /** The storage client used for setting and retrieving items from cache. * For SSR pass in `undefined`. Note that window.localStorage can be * `null` in Android WebViews depending on how they are configured. */ storage: AsyncStorage | undefined | null; /** The key to use when storing the cache */ key?: string; /** To avoid spamming, * pass a time in ms to throttle saving the cache to disk */ throttleTime?: number; /** * How to serialize the data to storage. * @default `JSON.stringify` */ serialize?: (client: PersistedClient) => MaybePromise; /** * How to deserialize the data from storage. * @default `JSON.parse` */ deserialize?: (cachedString: string) => MaybePromise; retry?: AsyncPersistRetryer; } export declare function noop(): void; export declare function noop(): undefined; export { }