@vtj/utils 0.8.136 → 0.8.138
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 +10 -10
- package/dist/index.iife.js +30 -30
- package/dist/index.mjs +969 -907
- package/dist/index.umd.js +30 -30
- package/package.json +2 -2
- package/types/index.d.ts +0 -1
- package/types/jsonp.d.ts +0 -1
- package/types/request.d.ts +5 -5
- 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.8.
|
|
4
|
+
"version": "0.8.138",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@vtj/base": "~0.8.11"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"fetch-jsonp": "~1.3.0",
|
|
13
13
|
"js-cookie": "~3.0.5",
|
|
14
14
|
"load-script": "~2.0.0",
|
|
15
|
-
"@vtj/cli": "~0.8.
|
|
15
|
+
"@vtj/cli": "~0.8.33"
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
package/types/index.d.ts
CHANGED
package/types/jsonp.d.ts
CHANGED
package/types/request.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
1
2
|
import { default as axios, AxiosInstance, CreateAxiosDefaults, AxiosResponse, AxiosRequestConfig, RawAxiosRequestHeaders, InternalAxiosRequestConfig, CancelTokenSource } from 'axios';
|
|
2
|
-
import { Ref, UnwrapRef } from 'vue';
|
|
3
|
-
|
|
4
3
|
declare const LOCAL_REQUEST_ID = "Local-Request-Id";
|
|
5
4
|
export interface IRequestSkipWarn {
|
|
6
5
|
executor: (resolve: (value: unknown) => void, reject: (reason?: any) => void) => void;
|
|
@@ -123,9 +122,10 @@ export interface IApiMap {
|
|
|
123
122
|
[name: string]: string | IRequestConfig;
|
|
124
123
|
}
|
|
125
124
|
export declare function createApis(map: IApiMap): Record<string, (data?: unknown, opts?: IRequestConfig) => Promise<unknown>>;
|
|
126
|
-
export
|
|
127
|
-
data: Ref<
|
|
125
|
+
export interface UseApiReturn<R = any> {
|
|
126
|
+
data: Ref<R | null>;
|
|
128
127
|
error: Ref<any>;
|
|
129
128
|
loading: Ref<boolean>;
|
|
130
|
-
}
|
|
129
|
+
}
|
|
130
|
+
export declare function useApi<R = any>(api: Promise<R>, transform?: (res: any) => R): UseApiReturn<R>;
|
|
131
131
|
export { axios, LOCAL_REQUEST_ID, type AxiosRequestConfig, type AxiosResponse, type RawAxiosRequestHeaders };
|
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.8.
|
|
5
|
+
* @version 0.8.137
|
|
6
6
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
7
7
|
*/
|
|
8
|
-
export declare const version = "0.8.
|
|
8
|
+
export declare const version = "0.8.137";
|