@1szx1/vite-plugin-swagger2ts 1.3.5 → 1.3.6
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 +3 -4
- package/dist/adapters.d.mts +3 -4
- package/dist/adapters.d.ts +3 -4
- package/package.json +1 -1
package/dist/adapters.d.cts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
2
|
import * as luch_request from 'luch-request';
|
|
4
3
|
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
5
4
|
|
|
6
5
|
type Get<T, K> = T[K & keyof T];
|
|
7
6
|
|
|
8
|
-
declare function axiosAdapter<T>(httpInstance: AxiosInstance): {
|
|
7
|
+
declare function axiosAdapter<T, AxiosRes = true>(httpInstance: AxiosInstance): {
|
|
9
8
|
request: <U extends string & keyof T, M extends string & keyof T[U]>(url: U, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
10
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
11
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
12
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
13
|
-
}) | undefined) => Promise<
|
|
12
|
+
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
declare function LuchAdapter<T extends Record<string, any>, C extends HttpRequestConfig = HttpRequestConfig>(httpInstance: luch_request__default): {
|
package/dist/adapters.d.mts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
2
|
import * as luch_request from 'luch-request';
|
|
4
3
|
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
5
4
|
|
|
6
5
|
type Get<T, K> = T[K & keyof T];
|
|
7
6
|
|
|
8
|
-
declare function axiosAdapter<T>(httpInstance: AxiosInstance): {
|
|
7
|
+
declare function axiosAdapter<T, AxiosRes = true>(httpInstance: AxiosInstance): {
|
|
9
8
|
request: <U extends string & keyof T, M extends string & keyof T[U]>(url: U, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
10
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
11
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
12
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
13
|
-
}) | undefined) => Promise<
|
|
12
|
+
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
declare function LuchAdapter<T extends Record<string, any>, C extends HttpRequestConfig = HttpRequestConfig>(httpInstance: luch_request__default): {
|
package/dist/adapters.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
2
|
import * as luch_request from 'luch-request';
|
|
4
3
|
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
5
4
|
|
|
6
5
|
type Get<T, K> = T[K & keyof T];
|
|
7
6
|
|
|
8
|
-
declare function axiosAdapter<T>(httpInstance: AxiosInstance): {
|
|
7
|
+
declare function axiosAdapter<T, AxiosRes = true>(httpInstance: AxiosInstance): {
|
|
9
8
|
request: <U extends string & keyof T, M extends string & keyof T[U]>(url: U, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
10
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
11
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
12
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
13
|
-
}) | undefined) => Promise<
|
|
12
|
+
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
declare function LuchAdapter<T extends Record<string, any>, C extends HttpRequestConfig = HttpRequestConfig>(httpInstance: luch_request__default): {
|
package/package.json
CHANGED