@1szx1/vite-plugin-swagger2ts 1.3.6 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters.d.cts +6 -6
- package/dist/adapters.d.mts +6 -6
- package/dist/adapters.d.ts +6 -6
- package/package.json +1 -1
package/dist/adapters.d.cts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
import * as luch_request from 'luch-request';
|
|
3
|
-
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
3
|
+
import luch_request__default, { HttpRequestConfig, HttpResponse } from 'luch-request';
|
|
4
4
|
|
|
5
5
|
type Get<T, K> = T[K & keyof T];
|
|
6
6
|
|
|
7
|
-
declare function axiosAdapter<T, AxiosRes = true
|
|
8
|
-
request: <U extends
|
|
7
|
+
declare function axiosAdapter<T extends Record<string, any> /**类型集合 */, AxiosRes = true /**返回类型是否包含Response */>(httpInstance: AxiosInstance): {
|
|
8
|
+
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
9
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
10
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
11
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
12
12
|
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
declare function LuchAdapter<T extends Record<string, any
|
|
16
|
-
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (HttpRequestConfig<luch_request.HttpTask> &
|
|
15
|
+
declare function LuchAdapter<T extends Record<string, any> /**类型集合 */, AxiosRes = true /**返回类型是否包含Response */>(httpInstance: luch_request__default): {
|
|
16
|
+
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (HttpRequestConfig<luch_request.HttpTask> & {
|
|
17
17
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
18
18
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
19
19
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
20
|
-
}) | undefined) => Promise<
|
|
20
|
+
}) | undefined) => Promise<AxiosRes extends true ? HttpResponse<T[U][M]["response" & keyof T[U][M]], luch_request.HttpTask> : T[U][M]["response" & keyof T[U][M]]>;
|
|
21
21
|
upload: <U_1 extends { [K in keyof T]: T[K] extends {
|
|
22
22
|
post: any;
|
|
23
23
|
} ? K : never; }[keyof T], P extends Get<T[U_1]["post"]["param" & keyof T[U_1]["post"]], "body" | "query">, N extends keyof P>(url: U_1 & string, config: HttpRequestConfig<UniApp.UploadTask> & {
|
package/dist/adapters.d.mts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
import * as luch_request from 'luch-request';
|
|
3
|
-
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
3
|
+
import luch_request__default, { HttpRequestConfig, HttpResponse } from 'luch-request';
|
|
4
4
|
|
|
5
5
|
type Get<T, K> = T[K & keyof T];
|
|
6
6
|
|
|
7
|
-
declare function axiosAdapter<T, AxiosRes = true
|
|
8
|
-
request: <U extends
|
|
7
|
+
declare function axiosAdapter<T extends Record<string, any> /**类型集合 */, AxiosRes = true /**返回类型是否包含Response */>(httpInstance: AxiosInstance): {
|
|
8
|
+
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
9
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
10
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
11
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
12
12
|
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
declare function LuchAdapter<T extends Record<string, any
|
|
16
|
-
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (HttpRequestConfig<luch_request.HttpTask> &
|
|
15
|
+
declare function LuchAdapter<T extends Record<string, any> /**类型集合 */, AxiosRes = true /**返回类型是否包含Response */>(httpInstance: luch_request__default): {
|
|
16
|
+
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (HttpRequestConfig<luch_request.HttpTask> & {
|
|
17
17
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
18
18
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
19
19
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
20
|
-
}) | undefined) => Promise<
|
|
20
|
+
}) | undefined) => Promise<AxiosRes extends true ? HttpResponse<T[U][M]["response" & keyof T[U][M]], luch_request.HttpTask> : T[U][M]["response" & keyof T[U][M]]>;
|
|
21
21
|
upload: <U_1 extends { [K in keyof T]: T[K] extends {
|
|
22
22
|
post: any;
|
|
23
23
|
} ? K : never; }[keyof T], P extends Get<T[U_1]["post"]["param" & keyof T[U_1]["post"]], "body" | "query">, N extends keyof P>(url: U_1 & string, config: HttpRequestConfig<UniApp.UploadTask> & {
|
package/dist/adapters.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
import * as luch_request from 'luch-request';
|
|
3
|
-
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
3
|
+
import luch_request__default, { HttpRequestConfig, HttpResponse } from 'luch-request';
|
|
4
4
|
|
|
5
5
|
type Get<T, K> = T[K & keyof T];
|
|
6
6
|
|
|
7
|
-
declare function axiosAdapter<T, AxiosRes = true
|
|
8
|
-
request: <U extends
|
|
7
|
+
declare function axiosAdapter<T extends Record<string, any> /**类型集合 */, AxiosRes = true /**返回类型是否包含Response */>(httpInstance: AxiosInstance): {
|
|
8
|
+
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
9
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
10
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
11
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
12
12
|
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
declare function LuchAdapter<T extends Record<string, any
|
|
16
|
-
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (HttpRequestConfig<luch_request.HttpTask> &
|
|
15
|
+
declare function LuchAdapter<T extends Record<string, any> /**类型集合 */, AxiosRes = true /**返回类型是否包含Response */>(httpInstance: luch_request__default): {
|
|
16
|
+
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (HttpRequestConfig<luch_request.HttpTask> & {
|
|
17
17
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
18
18
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
19
19
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
20
|
-
}) | undefined) => Promise<
|
|
20
|
+
}) | undefined) => Promise<AxiosRes extends true ? HttpResponse<T[U][M]["response" & keyof T[U][M]], luch_request.HttpTask> : T[U][M]["response" & keyof T[U][M]]>;
|
|
21
21
|
upload: <U_1 extends { [K in keyof T]: T[K] extends {
|
|
22
22
|
post: any;
|
|
23
23
|
} ? K : never; }[keyof T], P extends Get<T[U_1]["post"]["param" & keyof T[U_1]["post"]], "body" | "query">, N extends keyof P>(url: U_1 & string, config: HttpRequestConfig<UniApp.UploadTask> & {
|
package/package.json
CHANGED