ms-types 0.1.23 → 0.1.25

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.
Files changed (45) hide show
  1. package/package.json +20 -20
  2. package/types/action.d.ts +298 -298
  3. package/types/{appleocr.d.ts → appleOcr.d.ts} +102 -102
  4. package/types/config.d.ts +54 -54
  5. package/types/device.d.ts +105 -105
  6. package/types/global.d.ts +185 -185
  7. package/types/hid.d.ts +289 -289
  8. package/types/hotUpdate.d.ts +104 -104
  9. package/types/http.d.ts +300 -300
  10. package/types/ime.d.ts +99 -99
  11. package/types/index.d.ts +26 -26
  12. package/types/media.d.ts +90 -90
  13. package/types/mysql.d.ts +174 -174
  14. package/types/netCard.d.ts +77 -42
  15. package/types/node.d.ts +279 -279
  16. package/types/{paddleocr.d.ts → paddleOcr.d.ts} +73 -73
  17. package/types/pip.d.ts +51 -51
  18. package/types/system.d.ts +195 -195
  19. package/types/thread.d.ts +101 -101
  20. package/types/{tomatoocr.d.ts → tomatoOcr.d.ts} +199 -199
  21. package/types/tts.d.ts +91 -91
  22. package/types/ui.d.ts +165 -165
  23. package/types/yolo.d.ts +98 -98
  24. package/types/zh/HID/346/250/241/345/235/227.d.ts +293 -293
  25. package/types/zh/HTTP/346/250/241/345/235/227.d.ts +301 -301
  26. package/types/zh/{MySql → MySQL}/346/250/241/345/235/227.d.ts +175 -175
  27. package/types/zh/PaddleOCR/346/250/241/345/235/227.d.ts +74 -74
  28. package/types/zh/YOLO/346/250/241/345/235/227.d.ts +101 -101
  29. package/types/zh/index.d.ts +24 -24
  30. package/types/zh//345/205/250/345/261/200/346/250/241/345/235/227.d.ts +180 -180
  31. package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +300 -300
  32. package/types/zh//345/215/241/345/257/206/346/250/241/345/235/227.d.ts +90 -55
  33. package/types/zh//345/252/222/344/275/223/346/250/241/345/235/227.d.ts +91 -91
  34. package/types/zh//345/267/245/345/205/267/346/250/241/345/235/227.d.ts +30 -30
  35. package/types/zh//346/202/254/346/265/256/347/252/227/346/250/241/345/235/227.d.ts +55 -55
  36. package/types/zh//346/226/207/345/255/227/350/275/254/350/257/255/351/237/263/346/250/241/345/235/227.d.ts +92 -92
  37. package/types/zh//347/203/255/346/233/264/346/226/260/346/250/241/345/235/227.d.ts +105 -105
  38. package/types/zh//347/263/273/347/273/237/346/250/241/345/235/227.d.ts +194 -194
  39. package/types/zh//347/272/277/347/250/213/346/250/241/345/235/227.d.ts +102 -102
  40. package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +280 -280
  41. package/types/zh//350/213/271/346/236/234OCR.d.ts +104 -104
  42. package/types/zh//350/247/206/345/233/276/346/250/241/345/235/227.d.ts +167 -167
  43. package/types/zh//350/256/276/345/244/207/346/250/241/345/235/227.d.ts +106 -106
  44. package/types/zh//350/276/223/345/205/245/346/263/225/346/250/241/345/235/227.d.ts +100 -100
  45. package/types/zh//351/205/215/347/275/256/346/250/241/345/235/227.d.ts +56 -56
@@ -1,104 +1,104 @@
1
- /**
2
- * 热更新模块类型定义
3
- * 提供应用热更新功能,包括检查更新、下载更新包、MD5校验等
4
- */
5
- declare namespace hotUpdate {
6
- /**
7
- * 热更新检查结果
8
- */
9
- interface HotUpdateResult {
10
- /** 是否需要更新 */
11
- needUpdate: boolean;
12
- /** 错误信息(当检查失败时) */
13
- error?: string;
14
- /** 服务器返回的更新数据(当 needUpdate 为 true 时) */
15
- data?: HotUpdateResponse;
16
- }
17
-
18
- /**
19
- * 热更新服务器响应数据结构
20
- */
21
- interface HotUpdateResponse {
22
- /** 新包的下载地址 */
23
- download_url: string;
24
- /** 新包的版本号 */
25
- version: number;
26
- /** 下载msbundle文件超时时间(秒) */
27
- download_timeout: number;
28
- /** 是否用对话框的形式展示 */
29
- dialog: boolean;
30
- /** 对话框中要显示的消息 */
31
- msg: string;
32
- /** 对话框模式下是否强制更新 */
33
- force: boolean;
34
- /** 更新包文件的MD5值,用于校验文件完整性 */
35
- md5?: string;
36
- }
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
- /**
50
- * 检查更新(同步调用)
51
- * @param options 更新配置选项(可选,不传则从package.json读取配置)
52
- * @returns 检查结果
53
- *
54
- * @example
55
- * // 检查更新(使用默认配置)
56
- * const result = hotUpdate.checkUpdate();
57
- *
58
- * // 或者传入自定义配置
59
- * const result2 = hotUpdate.checkUpdate({
60
- * url: 'https://api.example.com/check-update'
61
- * });
62
- *
63
- * if (result.needUpdate) {
64
- * logi('发现新版本');
65
- * // 手动决定是否更新
66
- * const installResult = hotUpdate.downloadAndInstall();
67
- * logi('安装结果:', installResult);
68
- * } else {
69
- * loge('检查更新失败:', result.error);
70
- * }
71
- */
72
- function checkUpdate(options?: HotUpdateOptions): HotUpdateResult;
73
-
74
- /**
75
- * 手动下载并安装更新, 执行成功后会自动重启脚本
76
- * @returns 安装结果
77
- * @example
78
- * ```javascript
79
- * const checkResult = hotUpdate.checkUpdate();
80
- * if (checkResult.needUpdate) {
81
- * const installResult = hotUpdate.downloadAndInstall();
82
- * if (installResult.updated) {
83
- * logi('更新安装成功');
84
- * } else {
85
- * loge('更新安装失败:', installResult.error);
86
- * }
87
- * }
88
- * ```
89
- */
90
- function downloadAndInstall(): {
91
- updated: boolean;
92
- error?: string;
93
- };
94
-
95
- /**
96
- * 获取当前应用版本号
97
- * 从 package.json 文件中读取 appVersion 字段并返回数字类型版本号
98
- * @returns {number} 当前版本号,如果获取失败则返回 0
99
- * @example
100
- * const version = hotUpdate.getCurrentVersion();
101
- * logi('当前版本:', version); // 输出: 当前版本: 123
102
- */
103
- function getCurrentVersion(): number;
104
- }
1
+ /**
2
+ * 热更新模块类型定义
3
+ * 提供应用热更新功能,包括检查更新、下载更新包、MD5校验等
4
+ */
5
+ declare namespace hotUpdate {
6
+ /**
7
+ * 热更新检查结果
8
+ */
9
+ interface HotUpdateResult {
10
+ /** 是否需要更新 */
11
+ needUpdate: boolean;
12
+ /** 错误信息(当检查失败时) */
13
+ error?: string;
14
+ /** 服务器返回的更新数据(当 needUpdate 为 true 时) */
15
+ data?: HotUpdateResponse;
16
+ }
17
+
18
+ /**
19
+ * 热更新服务器响应数据结构
20
+ */
21
+ interface HotUpdateResponse {
22
+ /** 新包的下载地址 */
23
+ download_url: string;
24
+ /** 新包的版本号 */
25
+ version: number;
26
+ /** 下载msbundle文件超时时间(秒) */
27
+ download_timeout: number;
28
+ /** 是否用对话框的形式展示 */
29
+ dialog: boolean;
30
+ /** 对话框中要显示的消息 */
31
+ msg: string;
32
+ /** 对话框模式下是否强制更新 */
33
+ force: boolean;
34
+ /** 更新包文件的MD5值,用于校验文件完整性 */
35
+ md5?: string;
36
+ }
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
+ /**
50
+ * 检查更新(同步调用)
51
+ * @param options 更新配置选项(可选,不传则从package.json读取配置)
52
+ * @returns 检查结果
53
+ *
54
+ * @example
55
+ * // 检查更新(使用默认配置)
56
+ * const result = hotUpdate.checkUpdate();
57
+ *
58
+ * // 或者传入自定义配置
59
+ * const result2 = hotUpdate.checkUpdate({
60
+ * url: 'https://api.example.com/check-update'
61
+ * });
62
+ *
63
+ * if (result.needUpdate) {
64
+ * logi('发现新版本');
65
+ * // 手动决定是否更新
66
+ * const installResult = hotUpdate.downloadAndInstall();
67
+ * logi('安装结果:', installResult);
68
+ * } else {
69
+ * loge('检查更新失败:', result.error);
70
+ * }
71
+ */
72
+ function checkUpdate(options?: HotUpdateOptions): HotUpdateResult;
73
+
74
+ /**
75
+ * 手动下载并安装更新, 执行成功后会自动重启脚本
76
+ * @returns 安装结果
77
+ * @example
78
+ * ```javascript
79
+ * const checkResult = hotUpdate.checkUpdate();
80
+ * if (checkResult.needUpdate) {
81
+ * const installResult = hotUpdate.downloadAndInstall();
82
+ * if (installResult.updated) {
83
+ * logi('更新安装成功');
84
+ * } else {
85
+ * loge('更新安装失败:', installResult.error);
86
+ * }
87
+ * }
88
+ * ```
89
+ */
90
+ function downloadAndInstall(): {
91
+ updated: boolean;
92
+ error?: string;
93
+ };
94
+
95
+ /**
96
+ * 获取当前应用版本号
97
+ * 从 package.json 文件中读取 appVersion 字段并返回数字类型版本号
98
+ * @returns {number} 当前版本号,如果获取失败则返回 0
99
+ * @example
100
+ * const version = hotUpdate.getCurrentVersion();
101
+ * logi('当前版本:', version); // 输出: 当前版本: 123
102
+ */
103
+ function getCurrentVersion(): number;
104
+ }