import { Dispatch, SetStateAction } from 'react'; export type Func = (...args: any[]) => R; export type Fetch>>> = (p?: { force?: boolean; clean?: boolean; }, ..._: Parameters) => ReturnType; export interface FetchParams { force?: boolean; clean?: boolean; } type ThenArg = T extends PromiseLike ? U : T; type FetcherResult = ThenArg>; export type UseFetcher>>, 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) => UseFetcher; export {};