export declare type AsyncStatus = 'idle' | 'loading' | 'error' | 'success'; export interface AsyncResponse { data: T | null; error: Error | null; status: AsyncStatus; } export declare const DefaultAsyncState: AsyncResponse; /** * 简易版异步请求封装,旨在拿到各种实时异步状态和错误信息 * * 状态有 'idle' | 'loading' | 'error' | 'success'; * @param initialState 可选-初始数据 * @returns AsyncResponse */ export declare function useAsync(initialState?: AsyncResponse): { execute: (promise: Promise) => Promise; setData: (payload: D) => void; setError: (error: Error) => void; state: AsyncResponse; };