export declare type ValueKey = string | any[]; export declare type Key = ValueKey | (() => ValueKey | null); export declare type Fetcher = (...args: any[]) => Data | Promise; export declare type RevalidateOption = { retryCount: number; }; export interface PublicConfiguration { compare: (a: Data | undefined, b: Data | undefined) => boolean; dedupingInterval: number; fallbackData: Data | undefined; onSuccess: (data: Data, key: string, config: Readonly) => any; onError: (err: Error, key: string, config: Readonly) => any; shouldRetryOnError: boolean; errorRetryInterval: number; errorRetryCount: number; onErrorRetry?: (err: Error, key: string, config: Readonly, revalidate: () => void, revalidateOpts: RevalidateOption) => any; refreshInterval: number; revalidateOnWatch: boolean; revalidateOnFocus: boolean; revalidateOnReconnect: boolean; refreshWhenHidden: boolean; refreshWhenOffline: boolean; } export declare type SWRConfiguration = Partial>; export declare type SWRResponse = { data: Data | undefined; error: Error | undefined; isValidating: boolean; }; export declare type watchCallback = (response: SWRResponse) => any; export interface SWRWatcher { unwatch(): void; } export interface SWRObservable { watch(fn: watchCallback): SWRWatcher; mutate(options?: SWRConfiguration): void; setFetcher(fetcher: Fetcher, override?: boolean): void; } export declare type Cache = { get(key: Key): Data | null | undefined; set(key: Key, value: Data): void; delete(key: Key): void; };