@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/utils",
3
3
  "private": false,
4
- "version": "0.8.136",
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.31"
15
+ "@vtj/cli": "~0.8.33"
16
16
  },
17
17
  "exports": {
18
18
  ".": {
package/types/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  export { version as VTJ_UTILS_VERSION } from './version';
3
2
  export * from './base';
4
3
  export * from './request';
package/types/jsonp.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { default as fetchJsonp } from 'fetch-jsonp';
2
-
3
2
  export interface FetchJsonpOptions extends fetchJsonp.Options {
4
3
  query?: Record<string, any>;
5
4
  }
@@ -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 declare function useApi<R = any>(api: Promise<R>, transform?: (res: any) => R): {
127
- data: Ref< UnwrapRef<R> | null>;
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 };
@@ -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.136
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.136";
8
+ export declare const version = "0.8.137";