@whitesev/utils 2.5.9 → 2.6.0

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.
@@ -57,10 +57,11 @@ declare class Utils {
57
57
  * + 来源:https://bbs.tampermonkey.net.cn/thread-3284-1-1.html
58
58
  * + 作者:cxxjackie
59
59
  * + 版本:1.4.3
60
+ * + 旧版本:1.2.4
60
61
  * + 文档:https://scriptcat.org/zh-CN/script-show-page/637/
61
62
  * @param useOldVersion 是否使用旧版本,默认false
62
63
  */
63
- ajaxHooker: () => UtilsAjaxHookResult;
64
+ ajaxHooker: (useOldVersion?: boolean) => UtilsAjaxHookResult;
64
65
  /**
65
66
  * 根据坐标点击canvas元素的内部位置
66
67
  * @param canvasElement 画布元素
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/utils",
3
- "version": "2.5.9",
3
+ "version": "2.6.0",
4
4
  "description": "一个常用的工具库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Utils.ts CHANGED
@@ -2,6 +2,7 @@ import { ColorConversion } from "./ColorConversion";
2
2
  import { GBKEncoder } from "./GBKEncoder";
3
3
  import { UtilsGMCookie } from "./UtilsGMCookie";
4
4
  import { AjaxHooker } from "./ajaxHooker/ajaxHooker.js";
5
+ import { AjaxHooker1_2_4 } from "./ajaxHooker/ajaxHooker1.2.4";
5
6
  import { GMMenu } from "./UtilsGMMenu";
6
7
  import { Hooks } from "./Hooks";
7
8
  import { Httpx } from "./Httpx";
@@ -23,7 +24,6 @@ import {
23
24
  } from "./types/global";
24
25
  import type { WindowApiOption } from "./types/WindowApi";
25
26
  import { ModuleRaid } from "./ModuleRaid";
26
- import { AjaxHooker1_2_4 } from "./ajaxHooker/ajaxHooker1.2.4";
27
27
 
28
28
  class Utils {
29
29
  private windowApi: typeof WindowApi.prototype;
@@ -210,10 +210,11 @@ class Utils {
210
210
  * + 来源:https://bbs.tampermonkey.net.cn/thread-3284-1-1.html
211
211
  * + 作者:cxxjackie
212
212
  * + 版本:1.4.3
213
+ * + 旧版本:1.2.4
213
214
  * + 文档:https://scriptcat.org/zh-CN/script-show-page/637/
214
215
  * @param useOldVersion 是否使用旧版本,默认false
215
216
  */
216
- ajaxHooker: () => UtilsAjaxHookResult = (useOldVersion: boolean = false) => {
217
+ ajaxHooker = (useOldVersion: boolean = false): UtilsAjaxHookResult => {
217
218
  if (useOldVersion) {
218
219
  return AjaxHooker1_2_4();
219
220
  } else {