import { Dispatch, SetStateAction } from 'react' declare type DataTuple = [ /** * Data * */ T, /** * A wrapped function for fetch data * It realized auto-updating of `data` and auto-updating of `isFetching` * */ (...args: Args) => Promise, /** * Is fetching * */ boolean, /** * Be used to update data manually * */ Dispatch>, ] declare type TruthyOrFalsy = any declare type ShouldResetData = PromiseLike | TruthyOrFalsy declare function useAsyncData( api: (...args: Args) => PromiseLike, initialValue: T | (() => T), errorCb: (err: any) => ShouldResetData, ): DataTuple declare function useAsyncData< T extends any, ApiRes extends any, Args extends any[] = [] >( api: (...args: Args) => PromiseLike, initialValue: T | (() => T), errorCb: (err: any) => ShouldResetData, dealFn: (result: ApiRes, preData: T) => T, ): DataTuple export default useAsyncData export { DataTuple, ShouldResetData, TruthyOrFalsy }