@vtj/utils 0.7.29 → 0.7.31
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/index.cjs +6 -6
- package/dist/index.iife.js +26 -26
- package/dist/index.mjs +281 -265
- package/dist/index.umd.js +26 -26
- package/package.json +4 -4
- package/types/index.d.ts +1 -0
- package/types/jsonp.d.ts +2 -1
- package/types/request.d.ts +3 -3
- package/types/util.d.ts +6 -0
- package/types/version.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtj/utils",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.31",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "vue-tsc && vite build && npm run build:umd",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"coverage": "vitest run --coverage"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@vtj/base": "^0.7.
|
|
14
|
+
"@vtj/base": "^0.7.8"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/js-cookie": "~3.0.6",
|
|
18
|
-
"@vtj/cli": "^0.7.
|
|
18
|
+
"@vtj/cli": "^0.7.21",
|
|
19
19
|
"axios": "~1.6.8",
|
|
20
20
|
"fetch-jsonp": "~1.3.0",
|
|
21
21
|
"js-cookie": "~3.0.5",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dist",
|
|
36
36
|
"types"
|
|
37
37
|
],
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "eec8b5817a66b57a3d068eae6a9912a9b199346e",
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
}
|
package/types/index.d.ts
CHANGED
package/types/jsonp.d.ts
CHANGED
package/types/request.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref, UnwrapRef } from 'vue';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
|
|
2
|
+
import { default as axios, AxiosInstance, CreateAxiosDefaults, AxiosResponse, AxiosRequestConfig, RawAxiosRequestHeaders, InternalAxiosRequestConfig, CancelTokenSource } from 'axios';
|
|
3
|
+
|
|
4
4
|
declare const LOCAL_REQUEST_ID = "Local-Request-Id";
|
|
5
5
|
export interface IRequestSkipWarn {
|
|
6
6
|
executor: (resolve: (value: unknown) => void, reject: (reason?: any) => void) => void;
|
|
@@ -123,7 +123,7 @@ export interface IApiMap {
|
|
|
123
123
|
}
|
|
124
124
|
export declare function createApis(map: IApiMap): Record<string, (data?: unknown, opts?: IRequestConfig<any> | undefined) => Promise<unknown>>;
|
|
125
125
|
export declare function useApi<R = any>(api: Promise<R>, transform?: (res: any) => R): {
|
|
126
|
-
data: Ref<UnwrapRef<R> | null>;
|
|
126
|
+
data: Ref< UnwrapRef<R> | null>;
|
|
127
127
|
error: Ref<any>;
|
|
128
128
|
loading: Ref<boolean>;
|
|
129
129
|
};
|
package/types/util.d.ts
CHANGED
|
@@ -8,3 +8,9 @@ export declare const isClient: boolean;
|
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
10
|
export declare const fileToBase64: (file: File) => Promise<unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* FormData 转换为json
|
|
13
|
+
* @param data
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function formDataToJson(data: FormData): Record<string, any>;
|
package/types/version.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
3
3
|
* @name @vtj/utils
|
|
4
4
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
5
|
-
* @version 0.7.
|
|
5
|
+
* @version 0.7.31
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "0.7.
|
|
8
|
+
export declare const version = "0.7.31";
|