import { type Ref, type WritableComputedRef } from 'vue'; import { type ReturnOf } from '../utils'; import { type UseDisableReturn, type UseLoadingReturn } from './'; export interface UseRequestHandleApiDefaultOptions { apiParams: T; api?: (params: T) => Promise<{ data: K; [k: string]: any; }>; /** 返回 true 继续执行;返回 T 代表修改后的 apiparams,用其继续执行;返回其他则退出请求*/ beforeApi?: (params: T) => Promise; afterApi?: (params: K) => Promise; catchError?: (params: K) => Promise; /** 是否将参数全部转换为 formdata */ transformApiParamsToFormData?: { fileFiledName?: string; filterNames?: string[]; }; /** 成功提示 */ successMessage?: (...args: any[]) => string; /** 失败提示 */ failureMessage?: (...args: any[]) => string; /** 只用 success 判断接口成功,默认使用 success + data */ useSuccessPassRes?: boolean; callback?: () => void; responseDataType?: 'object' | 'array'; } export declare function useRequest(options: { setLoading: UseLoadingReturn['setLoading']; setDisable: UseDisableReturn['setDisable']; loading?: WritableComputedRef>; }): { result: import("vue").ComputedRef; error: import("vue").ComputedRef; handleApi: , T extends Record, K extends Record | Record[]>(options: O & UseRequestHandleApiDefaultOptions) => Promise; }; export declare type UseRequestReturn = ReturnOf;