import { Dispatch, SetStateAction } from 'react'; export declare type Func = (...args: any[]) => R; export declare type Fetch>>> = (p?: { force?: boolean; clean?: boolean; }, ..._: Parameters) => ReturnType; export interface FetchParams { force?: boolean; clean?: boolean; } declare type ThenArg = T extends PromiseLike ? U : T; declare type FetcherResult = ThenArg>; export declare type UseFetchers>>, E = any> = { entity?: FetcherResult; loading: boolean; error?: E; fetch: Fetch; setEntity: Dispatch | undefined>>; clearCache: () => void; }; /** * Factorize fetching logic which goal is to prevent unneeded fetchs and expose loading indicator + error status. */ export declare const useFetcher: >, E = any>(fetcher: F, initialValue?: ThenArg> | undefined, mapError?: (_: any) => E) => UseFetchers; export {};