소스 검색

Signed-off-by: zhaobao <528046418@qq.com>

zhaobao 3 년 전
부모
커밋
8482c231a4
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      src/types/shims.d.ts

+ 13 - 0
src/types/shims.d.ts

@@ -1,3 +1,4 @@
+import axios from 'axios'
 declare interface Window {
   webkitDevicePixelRatio: any
   mozDevicePixelRatio: any
@@ -17,3 +18,15 @@ declare const __SYSTEM_INFO__: {
   }
   lastBuildTime: string
 }
+declare module 'axios' {
+  export interface AxiosInstance {
+    <T = any>(config: AxiosRequestConfig): Promise<T>;
+    request<T = any> (config: AxiosRequestConfig): Promise<T>;
+    get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
+    delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
+    head<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>;
+    post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
+    put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
+    patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>;
+  }
+}