import { DependencyList } from 'react'; export interface IOptions { apiType?: ApiType; fastLogin?: boolean; ignoreError?: boolean; description?: any; useCors?: boolean; url?: string; baseURL?: string; requestStartTime?: number; originParams?: any; originData?: any; mock?: boolean; region?: string; rawResponseData?: boolean; extraData?: any; /** * 在请求失败的时候不 throw Error 而是直接返回请求对象 */ disableThrowResponseError?: boolean; throwDoubleConfirmError?: boolean; } export declare enum ApiType { plugin = "plugin", inner = "inner", app = "app", open = "open", roa = "roa", custom = "custom", roaInner = "roaInner" } interface IParams { [key: string]: any; } interface IProps extends Partial { code?: string; disableErrorPrompt?: boolean; ignoreError?: boolean; manual?: boolean; service?: (p: IParams) => Promise; pollingInterval?: number; onSuccess?: (d: T) => void; onError?: (e: Error) => void; useNewRisk?: boolean; autoMulti?: boolean; } export declare const useService: (service: (p: P) => Promise, params?: P | undefined, opt?: IProps, deps?: DependencyList) => import("./async").ReturnValue; export declare const useOpenApi: (code: string, action: string, params: P, opt?: IProps) => import("./async").ReturnValue; export declare const useInnerApi: (code: string, action: string, params: P, opt?: IProps) => import("./async").ReturnValue; export declare const usePluginApi: (code: string, action: string, params: P, opt?: IProps) => import("./async").ReturnValue; export declare const useAppApi: (code: string, action: string, params: P, opt?: IProps) => import("./async").ReturnValue; export declare const useRoaApi: (code: string, action: string, params: P, opt?: IProps) => import("./async").ReturnValue; export default useService;