You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
605 B

import { RequestOptionsInit } from 'umi-request';
import { BaseOptions, BaseResult, OptionsWithFormat } from './types';
export declare type RequestService = string | ({
url: string;
} & RequestOptionsInit);
export declare type Service<P extends any[]> = RequestService | ((...args: P) => RequestService);
declare function useRequest<R, P extends any[], U, UU extends U = any>(service: Service<P>, options: OptionsWithFormat<R, P, U, UU>): BaseResult<U, P>;
declare function useRequest<R, P extends any[]>(service: Service<P>, options?: BaseOptions<R, P>): BaseResult<R, P>;
export default useRequest;