import { MutationListener, MutationResult, } from './cache/mutation-cache'; export type SWRCompare = (a: T, b: T) => boolean; export type SWRTrigger

= (args: P, shouldRevalidate?: boolean) => void; export type SWRMutate = (args: P, data: MutationResult, shouldRevalidate?: boolean, compare?: SWRCompare) => void; export interface SWRGetOptions { shouldRevalidate?: boolean; initialData?: T; hydrate?: boolean; } export type SWRGet = (args: P, options?: SWRGetOptions) => MutationResult; export type SWRSubscribe = (args: P, listener: MutationListener) => () => void; export interface SWRStoreBaseOptions { get: (...args: P) => Promise; initialData?: T; refreshInterval?: number; maxRetryCount?: number; } export interface SWRStoreExtendedOptions { key: (...args: P) => string; revalidateOnFocus: boolean; revalidateOnVisibility: boolean; revalidateOnNetwork: boolean; refreshWhenOffline: boolean; refreshWhenHidden: boolean; refreshWhenBlurred: boolean; freshAge: number; staleAge: number; compare: SWRCompare; maxRetryInterval: number; } export type SWRStorePartialOptions = Partial>; export interface SWRStoreOptions extends SWRStorePartialOptions, SWRStoreBaseOptions { } export interface SWRFullOptions extends SWRStoreExtendedOptions, SWRStoreBaseOptions { } export interface SWRStore { id: string; trigger: SWRTrigger

; mutate: SWRMutate; get: SWRGet; subscribe: SWRSubscribe; }