interface State { error: Error | null; data: D | null; stat: 'idle' | 'loading' | 'error' | 'success'; } declare const defaultConfig: { throwOnError: boolean; }; export declare const useAsync: (initialState?: State | undefined, initialConfig?: typeof defaultConfig) => { error: Error | null; data: D | null; stat: 'idle' | 'loading' | 'error' | 'success'; isIdle: boolean; isLoading: boolean; isError: boolean; isSuccess: boolean; run: (promise: Promise) => Promise; setData: (data: D) => void; setError: (error: Error) => void; }; export {};