import { ErrorLevel } from '../core/Http/types';
export interface State<T> {
    data?: T;
    error?: Error;
    isFetching: boolean;
    refetch: () => void;
}
type FetchOptions<ReturnType> = {
    enabled: boolean;
    errorLevel: ErrorLevel;
    keepPrevData: boolean;
    onSuccess?: (data: ReturnType) => void;
    onError?: (error: Error) => void;
};
type UseFetchConfig<QueryFn extends (...args: any) => Promise<any>> = {
    loadingContext?: string;
    params?: Record<string, string | number | Date>;
    requestOptions?: RequestInit;
    fetchOptions?: Partial<FetchOptions<Awaited<ReturnType<QueryFn>>>>;
    queryFn: QueryFn;
};
export declare function useFetch<QueryFn extends (...args: any) => Promise<any>, T extends Awaited<ReturnType<QueryFn>>>({ fetchOptions: { keepPrevData, onSuccess, onError, enabled }, queryFn, }: UseFetchConfig<QueryFn>): State<T>;
export {};
//# sourceMappingURL=useFetch.d.ts.map