ms-types 0.5.5 → 0.5.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "vitepress": "^1.6.4",
20
- "vitepress-theme-teek": "^1.5.5",
21
- "wrangler": "^4.71.0"
20
+ "vitepress-theme-teek": "^1.5.6",
21
+ "wrangler": "^4.81.0"
22
22
  }
23
23
  }
package/types/global.d.ts CHANGED
@@ -2,6 +2,10 @@
2
2
  * 是否内置内置Agent
3
3
  */
4
4
  declare const __isSupportBuiltAgent__: boolean;
5
+ /**
6
+ * 运行模式
7
+ */
8
+ declare const __runMode__: "agent" | "hid";
5
9
  /**
6
10
  * 是否是调试模式
7
11
  */
@@ -35,31 +35,14 @@ declare namespace hotUpdate {
35
35
  md5?: string;
36
36
  }
37
37
 
38
- /**
39
- * 热更新配置选项
40
- */
41
- interface HotUpdateOptions {
42
- /** 检查更新的服务器URL,未提供时从 package.json 的 update.url 读取 */
43
- url?: string;
44
- /** 当前版本号,未提供时从 package.json 的 appVersion 读取 */
45
- version?: number;
46
- /** 超时时间(毫秒),未提供时从 package.json 的 update.timeout 读取,默认10000毫秒 */
47
- timeout?: number;
48
- }
49
38
  /**
50
39
  * 检查更新(同步调用)
51
- * @param options 更新配置选项(可选,不传则从package.json读取配置)
52
40
  * @returns 检查结果
53
41
  *
54
42
  * @example
55
- * // 检查更新(使用默认配置)
43
+ * // 检查更新
56
44
  * const result = hotUpdate.checkUpdate();
57
45
  *
58
- * // 或者传入自定义配置
59
- * const result2 = hotUpdate.checkUpdate({
60
- * url: 'https://api.example.com/check-update'
61
- * });
62
- *
63
46
  * if (result.needUpdate) {
64
47
  * logi('发现新版本');
65
48
  * // 手动决定是否更新
@@ -69,7 +52,7 @@ declare namespace hotUpdate {
69
52
  * loge('检查更新失败:', result.error);
70
53
  * }
71
54
  */
72
- function checkUpdate(options?: HotUpdateOptions): HotUpdateResult;
55
+ function checkUpdate(): HotUpdateResult;
73
56
 
74
57
  /**
75
58
  * 手动下载并安装更新, 执行成功后会自动重启脚本
@@ -11,6 +11,10 @@ declare type 无返回值 = void;
11
11
  * 是否内置内置Agent
12
12
  */
13
13
  declare const $是否内置Agent: 布尔值;
14
+ /**
15
+ * 运行模式
16
+ */
17
+ declare const $运行模式: "agent" | "hid";
14
18
  /**
15
19
  * 是否是调试模式
16
20
  */
@@ -33,32 +33,14 @@ declare namespace $热更新 {
33
33
  md5?: 字符串;
34
34
  }
35
35
 
36
- /**
37
- * 热更新配置选项
38
- */
39
- interface 热更新参数 {
40
- /** 检查更新的服务器URL,未提供时从 package.json 的 update.url 读取 */
41
- url?: 字符串;
42
- /** 当前版本号,未提供时从 package.json 的 appVersion 读取 */
43
- version?: 数字;
44
- /** 超时时间(毫秒),未提供时从 package.json 的 update.timeout 读取,默认10000毫秒 */
45
- timeout?: 数字;
46
- }
47
-
48
36
  /**
49
37
  * 检查更新(同步调用)
50
- * @param options 更新配置选项(可选,不传则从package.json读取配置)
51
38
  * @returns 检查结果
52
39
  *
53
40
  * @example
54
- * // 检查更新(使用默认配置)
41
+ * // 检查更新
55
42
  * const 热更新检查结果 = $热更新.检查更新();
56
43
  *
57
- * // 或者传入自定义配置
58
- * const 热更新检查结果2 = $热更新.检查更新({
59
- * url: 'https://api.example.com/check-update'
60
- * });
61
- *
62
44
  * if (热更新检查结果.needUpdate) {
63
45
  * $打印信息日志('发现新版本');
64
46
  * // 手动决定是否更新
@@ -68,7 +50,7 @@ declare namespace $热更新 {
68
50
  * $打印错误日志('检查更新失败:', 热更新检查结果.error);
69
51
  * }
70
52
  */
71
- function 检查更新(参数?: 热更新参数): 热更新检查结果;
53
+ function 检查更新(): 热更新检查结果;
72
54
 
73
55
  /**
74
56
  * 手动下载并安装更新, 执行成功后会自动重启脚本