diff --git a/tsconfig.json b/tsconfig.json index 0506075..bac5abb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,8 @@ "module": "es2015", "moduleResolution": "node", "lib": [ - "es2017", - "dom" + "es2017", + "dom" ], "declaration": true, "experimentalDecorators": true, @@ -21,11 +21,21 @@ "noFallthroughCasesInSwitch": true, "skipLibCheck": false, "paths": { - "ui": ["./src/ui"], - "ReportCst": ["./private/constants"], - "types": ["./types/index.d.ts"], - "@core/*": ["./src/modules/core/*"], - "@constants/*": ["./src/modules/constants/*"] + "ui": [ + "./src/ui" + ], + "ReportCst": [ + "./private/constants" + ], + "types": [ + "./types/index.d.ts" + ], + "@core/*": [ + "./src/modules/core/*" + ], + "@constants/*": [ + "./src/modules/constants/*" + ] } }, "include": [ @@ -33,6 +43,6 @@ "src/**/*.ts", "private/*.ts", "private/**/*.ts", - "types/globals.d.ts" + "types" ] } \ No newline at end of file diff --git a/types/globals.d.ts b/types/globals.d.ts index 6dcba21..f868d4b 100644 --- a/types/globals.d.ts +++ b/types/globals.d.ts @@ -1,4 +1,3 @@ -import type { Method, AxiosRequestConfig } from 'axios'; interface Obj { [key: string]: any; } @@ -17,7 +16,7 @@ declare const Dec: { personal: { username: string; }; - reqByEncrypt: (method: Method, url: string, data?: any, config?: AxiosRequestConfig) => {}, + reqByEncrypt: (method: AxiosType.X_Method, url: string, data?: any, config?: AxiosType.X_AxiosRequestConfig) => {}, socketEmit: (type: string, name: string, callback: (re: any) => void) => void; // req reqGet: RequestFunction; diff --git a/types/request.d.ts b/types/request.d.ts new file mode 100644 index 0000000..4042317 --- /dev/null +++ b/types/request.d.ts @@ -0,0 +1,9 @@ +import { Method, AxiosRequestConfig } from 'axios'; + +declare namespace AxiosType { + type X_Method = Method + interface X_AxiosRequestConfig extends AxiosRequestConfig { } +} + +export = AxiosType; +export as namespace AxiosType; \ No newline at end of file