mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
18 lines
1.5 KiB
TypeScript
18 lines
1.5 KiB
TypeScript
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
import { Router } from 'vue-router';
|
|
export declare const initRequest: (router?: Router) => void;
|
|
declare const useRequest: () => {
|
|
request: <R = any>(opts: AxiosRequestConfig) => Promise<R>;
|
|
get: <T = any, R = ResponseWithData<T>, PM = any>(url: string, params?: PM, opts?: AxiosRequestConfig) => Promise<R>;
|
|
post: <T = any, R = ResponseWithData<T>, PM = any>(url: string, data?: T, params?: PM, opts?: AxiosRequestConfig) => Promise<R>;
|
|
put: <T = any, R = ResponseWithData<T>, PM = any>(url: string, data?: T, params?: PM, opts?: AxiosRequestConfig) => Promise<R>;
|
|
del: <T = any, R = ResponseWithData<T>, PM = any>(url: string, data?: T, params?: PM, opts?: AxiosRequestConfig) => Promise<R>;
|
|
getList: <T = any>(url: string, params?: ListRequestParams, opts?: AxiosRequestConfig) => Promise<ResponseWithListData<any>>;
|
|
postList: <T = any, R = ResponseWithListData<any>, PM = any>(url: string, data?: T[], params?: PM, opts?: AxiosRequestConfig) => Promise<R>;
|
|
putList: <T = any, R = Response, PM = any>(url: string, data?: BatchRequestPayloadWithJsonStringData, params?: PM, opts?: AxiosRequestConfig) => Promise<R>;
|
|
delList: <T = any, R = Response, PM = any>(url: string, data?: BatchRequestPayload, params?: PM, opts?: AxiosRequestConfig) => Promise<R>;
|
|
requestRaw: <R = any>(opts: AxiosRequestConfig) => Promise<AxiosResponse>;
|
|
getRaw: <T = any, PM = any>(url: string, params?: PM, opts?: AxiosRequestConfig) => Promise<AxiosResponse>;
|
|
};
|
|
export default useRequest;
|