@whitesev/utils 2.4.1 → 2.4.2

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.
@@ -1,4 +1,4 @@
1
- import type { HttpxHookErrorData, HttpxRequestOption, HttpxRequestOptionConfig, HttpxResponse, HttpxResponseData } from "./types/Httpx";
1
+ import type { HttpxHookErrorData, HttpxRequestOption, HttpxRequestOptionConfig, HttpxResponse, HttpxResponseData, HttpxPromise } from "./types/Httpx";
2
2
  declare class Httpx {
3
3
  #private;
4
4
  private GM_Api;
@@ -1314,3 +1314,10 @@ export declare interface HttpxHookErrorData {
1314
1314
  /** 请求的配置 */
1315
1315
  details: HttpxRequestOption;
1316
1316
  }
1317
+
1318
+ /**
1319
+ * httpx的自定义Promise,包含额外函数
1320
+ */
1321
+ export declare interface HttpxPromise<T> extends Promise<T> {
1322
+ abort: () => void;
1323
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/utils",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "一个常用的工具库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Httpx.ts CHANGED
@@ -6,6 +6,7 @@ import type {
6
6
  HttpxRequestOptionConfig,
7
7
  HttpxResponse,
8
8
  HttpxResponseData,
9
+ HttpxPromise,
9
10
  } from "./types/Httpx";
10
11
  import { Utils } from "./Utils";
11
12
  import { GenerateUUID } from "./UtilsCommon";
package/src/Utils.ts CHANGED
@@ -29,7 +29,7 @@ class Utils {
29
29
  this.windowApi = new WindowApi(option);
30
30
  }
31
31
  /** 版本号 */
32
- version = "2024.10.28";
32
+ version = "2024.10.29";
33
33
 
34
34
  /**
35
35
  * 在页面中增加style元素,如果html节点存在子节点,添加子节点第一个,反之,添加到html节点的子节点最后一个
@@ -1314,3 +1314,10 @@ export declare interface HttpxHookErrorData {
1314
1314
  /** 请求的配置 */
1315
1315
  details: HttpxRequestOption;
1316
1316
  }
1317
+
1318
+ /**
1319
+ * httpx的自定义Promise,包含额外函数
1320
+ */
1321
+ export declare interface HttpxPromise<T> extends Promise<T> {
1322
+ abort: () => void;
1323
+ }