ms-types 0.10.6 → 0.10.8

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 (54) hide show
  1. package/package.json +2 -2
  2. package/types/action.d.ts +7 -2
  3. package/types/ai.d.ts +5 -4
  4. package/types/appleocr.d.ts +4 -4
  5. package/types/cloud.d.ts +1 -2
  6. package/types/config.d.ts +1 -1
  7. package/types/cryptoUtils.d.ts +5 -2
  8. package/types/device.d.ts +1 -1
  9. package/types/dotocr.d.ts +3 -1
  10. package/types/file.d.ts +2 -2
  11. package/types/hotUpdate.d.ts +1 -2
  12. package/types/http.d.ts +6 -6
  13. package/types/image.d.ts +1 -1
  14. package/types/ime.d.ts +1 -1
  15. package/types/index.d.ts +1 -0
  16. package/types/logger.d.ts +2 -2
  17. package/types/media.d.ts +1 -1
  18. package/types/mysql.d.ts +1 -1
  19. package/types/netCard.d.ts +3 -0
  20. package/types/node.d.ts +1 -1
  21. package/types/paddleocr.d.ts +2 -5
  22. package/types/pip.d.ts +3 -0
  23. package/types/system.d.ts +1 -1
  24. package/types/tomatoocr.d.ts +3 -4
  25. package/types/tts.d.ts +2 -2
  26. package/types/ui.d.ts +1 -110
  27. package/types/utils.d.ts +1 -1
  28. package/types/web.d.ts +111 -0
  29. package/types/yolo.d.ts +1 -1
  30. package/types/yoloCls.d.ts +1 -1
  31. package/types/zh/HID/346/250/241/345/235/227.d.ts +1 -1
  32. package/types/zh/HTTP/346/250/241/345/235/227.d.ts +7 -6
  33. package/types/zh/MySql/346/250/241/345/235/227.d.ts +2 -1
  34. package/types/zh/PaddleOCR/346/250/241/345/235/227.d.ts +3 -5
  35. package/types/zh/YOLO/345/210/206/347/261/273/346/250/241/345/235/227.d.ts +1 -1
  36. package/types/zh/YOLO/346/250/241/345/235/227.d.ts +1 -1
  37. package/types/zh//344/272/221/346/216/247/346/250/241/345/235/227.d.ts +4 -1
  38. package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +7 -2
  39. package/types/zh//345/233/276/347/211/207/346/250/241/345/235/227.d.ts +2 -1
  40. package/types/zh//345/252/222/344/275/223/346/250/241/345/235/227.d.ts +1 -1
  41. package/types/zh//345/267/245/345/205/267/346/250/241/345/235/227.d.ts +1 -1
  42. package/types/zh//346/202/254/346/265/256/347/252/227/346/250/241/345/235/227.d.ts +2 -1
  43. package/types/zh//346/226/207/344/273/266/346/250/241/345/235/227.d.ts +3 -2
  44. 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 +3 -2
  45. package/types/zh//346/227/245/345/277/227/346/250/241/345/235/227.d.ts +2 -2
  46. package/types/zh//347/202/271/351/230/265OCR/346/250/241/345/235/227.d.ts +3 -1
  47. package/types/zh//347/263/273/347/273/237/346/250/241/345/235/227.d.ts +2 -1
  48. package/types/zh//347/272/277/347/250/213/346/250/241/345/235/227.d.ts +1 -0
  49. package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +1 -1
  50. package/types/zh//350/213/271/346/236/234OCR.d.ts +4 -4
  51. package/types/zh//350/247/206/345/233/276/346/250/241/345/235/227.d.ts +2 -2
  52. package/types/zh//350/256/276/345/244/207/346/250/241/345/235/227.d.ts +2 -1
  53. package/types/zh//350/276/223/345/205/245/346/263/225/346/250/241/345/235/227.d.ts +2 -1
  54. package/types/zh//351/205/215/347/275/256/346/250/241/345/235/227.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.10.6",
3
+ "version": "0.10.8",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -18,6 +18,6 @@
18
18
  "devDependencies": {
19
19
  "vitepress": "^1.6.4",
20
20
  "vitepress-theme-teek": "^1.6.2",
21
- "wrangler": "^4.130.0"
21
+ "wrangler": "^4.131.0"
22
22
  }
23
23
  }
package/types/action.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 动作模块 包含点击、滑动、长按滑动、返回首页等动作
2
+ * 动作模块
3
3
  */
4
4
  declare namespace action {
5
5
  /**
@@ -196,7 +196,12 @@ declare namespace action {
196
196
  * @example action.pressButton("home")
197
197
  */
198
198
  function pressButton(
199
- button: "home" | "volumeup" | "volumedown" | "brightnessup" | "brightnessdown",
199
+ button:
200
+ | "home"
201
+ | "volumeup"
202
+ | "volumedown"
203
+ | "brightnessup"
204
+ | "brightnessdown",
200
205
  ): boolean;
201
206
 
202
207
  /**
package/types/ai.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  /**
2
- * AI 模块 让脚本直接在手机上调用大模型:看图回答、是非判断、提取结构化数据、多轮对话。
3
- * 支持 openai 兼容 / anthropic / gemini 三种协议;模型配置写在脚本里,脚本开头 ai.setProvider 一次即可。
4
- * 所有方法同步阻塞,失败返回 null / false,原因用 ai.lastError() 查看。
2
+ * AI模块
5
3
  */
6
4
  declare namespace ai {
7
5
  /**
@@ -160,7 +158,10 @@ declare namespace ai {
160
158
  * @example
161
159
  * ai.chat([{ role: "system", content: "你是助手" }, { role: "user", content: "看下这是哪个页面", image: "screen" }])
162
160
  */
163
- function chat(messages: (AiMessage | string)[], options?: AiOptions): string | null;
161
+ function chat(
162
+ messages: (AiMessage | string)[],
163
+ options?: AiOptions,
164
+ ): string | null;
164
165
  /**
165
166
  * 从模型文本里解析 JSON,自动剥掉 Markdown 代码块和前后解释
166
167
  * @param text 模型输出
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Apple OCR模块 使用Apple Vision框架进行文本识别
2
+ * AppleOCR模块
3
3
  */
4
4
  declare namespace appleOcr {
5
5
  /**
@@ -49,7 +49,7 @@ declare namespace appleOcr {
49
49
  y?: number,
50
50
  ex?: number,
51
51
  ey?: number,
52
- languages?: string[]
52
+ languages?: string[],
53
53
  ): OCRResult[];
54
54
 
55
55
  /**
@@ -71,7 +71,7 @@ declare namespace appleOcr {
71
71
  x?: number,
72
72
  y?: number,
73
73
  ex?: number,
74
- ey?: number
74
+ ey?: number,
75
75
  ): OCRResult[];
76
76
 
77
77
  /**
@@ -99,6 +99,6 @@ declare namespace appleOcr {
99
99
  ex?: number,
100
100
  ey?: number,
101
101
  languages?: string[],
102
- exactMatch?: boolean
102
+ exactMatch?: boolean,
103
103
  ): OCRResult[];
104
104
  }
package/types/cloud.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  /**
2
- * 云控模块类型定义
3
- * 提供主脚本侧连接云控、断开连接、判断连接状态、上报 Object 数据和监听服务端事件的能力。
2
+ * 云控模块
4
3
  */
5
4
  declare namespace cloud {
6
5
  /**
package/types/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 配置模块 包含读取配置、更新配置、删除配置等功能
2
+ * 配置模块
3
3
  */
4
4
  declare namespace config {
5
5
  /**
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 加密工具模块
3
+ */
1
4
  declare namespace cryptoUtils {
2
5
  /// 使用AES ECB模式加密数据 默认使用PKCS7填充
3
6
  /// - Parameters:
@@ -8,7 +11,7 @@ declare namespace cryptoUtils {
8
11
  function encryptWithAES_ECB(
9
12
  data: string,
10
13
  aesKey: string,
11
- noPadding?: boolean
14
+ noPadding?: boolean,
12
15
  ): string;
13
16
 
14
17
  /// 使用AES ECB模式解密数据 默认使用PKCS7填充
@@ -20,7 +23,7 @@ declare namespace cryptoUtils {
20
23
  function decryptWithAES_ECB(
21
24
  data: string,
22
25
  aesKey: string,
23
- noPadding?: boolean
26
+ noPadding?: boolean,
24
27
  ): string;
25
28
 
26
29
  /// 使用RSA公钥加密数据 默认使用PKCS1填充
package/types/device.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 设备模块 包含获取设备信息、设备操作等功能
2
+ * 设备模块
3
3
  */
4
4
  declare namespace device {
5
5
  /**
package/types/dotocr.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- /** 固定像素尺寸的点阵 OCR(`kuaijs-dot-font` 字库)。 */
1
+ /**
2
+ * 点阵OCR模块
3
+ */
2
4
  declare namespace dotOcr {
3
5
  interface OCRChar {
4
6
  text: string;
package/types/file.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 文件模块 包含文件操作、文件内容读写等功能
2
+ * 文件模块
3
3
  */
4
4
  declare namespace file {
5
5
  /**
@@ -9,7 +9,7 @@ declare namespace file {
9
9
  * @example file.getInternalDir("documents")
10
10
  */
11
11
  function getInternalDir(
12
- type: "documents" | "library" | "temp" | "libraryCaches"
12
+ type: "documents" | "library" | "temp" | "libraryCaches",
13
13
  ): string;
14
14
  /**
15
15
  * 创建文件
@@ -1,6 +1,5 @@
1
1
  /**
2
- * 热更新模块类型定义
3
- * 提供应用热更新功能,包括检查更新、下载更新包、MD5校验等
2
+ * 热更新模块
4
3
  */
5
4
  declare namespace hotUpdate {
6
5
  /**
package/types/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * HTTP模块 包含发送HTTP请求、下载文件等功能、websocket等功能
2
+ * HTTP模块
3
3
  */
4
4
  declare namespace http {
5
5
  /**
@@ -131,7 +131,7 @@ declare namespace http {
131
131
  url: string,
132
132
  file: string,
133
133
  timeout?: number,
134
- headers?: Record<string, string>
134
+ headers?: Record<string, string>,
135
135
  ): boolean;
136
136
 
137
137
  /**
@@ -148,7 +148,7 @@ declare namespace http {
148
148
  url: string,
149
149
  params?: Record<string, string>,
150
150
  timeout?: number,
151
- headers?: Record<string, string>
151
+ headers?: Record<string, string>,
152
152
  ): string | null;
153
153
 
154
154
  /**
@@ -167,7 +167,7 @@ declare namespace http {
167
167
  params?: Record<string, string>,
168
168
  files?: Record<string, string>,
169
169
  timeout?: number,
170
- headers?: Record<string, string>
170
+ headers?: Record<string, string>,
171
171
  ): string | null;
172
172
 
173
173
  /**
@@ -187,7 +187,7 @@ declare namespace http {
187
187
  url: string,
188
188
  json?: Record<string, any>,
189
189
  timeout?: number,
190
- headers?: Record<string, string>
190
+ headers?: Record<string, string>,
191
191
  ): string | null;
192
192
 
193
193
  /**
@@ -206,7 +206,7 @@ declare namespace http {
206
206
  */
207
207
  function newWebsocket(
208
208
  url: string,
209
- header?: Record<string, string>
209
+ header?: Record<string, string>,
210
210
  ): WebSocket;
211
211
 
212
212
  /**
package/types/image.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 图片模块 包含图片操作、图片内容读写等功能
2
+ * 图片模块
3
3
  */
4
4
  declare namespace image {
5
5
  /**
package/types/ime.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 输入法模块 包含输入法操作、输入法内容读写等功能
2
+ * 输入法模块
3
3
  */
4
4
  declare namespace ime {
5
5
  /**
package/types/index.d.ts CHANGED
@@ -26,6 +26,7 @@
26
26
  /// <reference path="tomatoocr.d.ts" />
27
27
  /// <reference path="tts.d.ts" />
28
28
  /// <reference path="ui.d.ts" />
29
+ /// <reference path="web.d.ts" />
29
30
  /// <reference path="utils.d.ts" />
30
31
  /// <reference path="yolo.d.ts" />
31
32
  /// <reference path="yoloCls.d.ts" />
package/types/logger.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 日志模块 包含日志输出、日志等级设置等功能
2
+ * 日志模块
3
3
  */
4
4
  declare namespace logger {
5
5
  /**
@@ -9,7 +9,7 @@ declare namespace logger {
9
9
  * logger.setLoggerLevel("info");
10
10
  */
11
11
  function setLoggerLevel(
12
- level: "error" | "warn" | "debug" | "info" | "off"
12
+ level: "error" | "warn" | "debug" | "info" | "off",
13
13
  ): void;
14
14
  /**
15
15
  * 设置是否输出到文件 默认开启
package/types/media.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 媒体模块 包含媒体操作、媒体内容读写等功能
2
+ * 媒体模块
3
3
  */
4
4
  declare namespace media {
5
5
  /**
package/types/mysql.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * MySQL 数据库模块 - 提供 MySQL 数据库连接和操作功能
2
+ * MySQL数据库模块
3
3
  */
4
4
  declare namespace mysql {
5
5
  /**
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 卡密模块
3
+ */
1
4
  declare namespace netCard {
2
5
  /**
3
6
  * 卡密信息
package/types/node.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 节点模块 包含节点操作、节点内容读写等功能
2
+ * 节点模块
3
3
  */
4
4
  declare function createNodeSelector(params?: {
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 飞桨OCR模块 包含OCR识别、模型切换和资源释放等功能
2
+ * PaddleOCR模块
3
3
  */
4
4
  declare namespace paddleOcr {
5
5
  /**
@@ -46,10 +46,7 @@ declare namespace paddleOcr {
46
46
  * const ok = paddleOcr.loadModel("ppocr-v6-small", false)
47
47
  * logi(`PaddleOCR 模型加载结果: ${ok}`)
48
48
  */
49
- function loadModel(
50
- modelId: PaddleOCRModelId,
51
- useGpu?: boolean,
52
- ): boolean;
49
+ function loadModel(modelId: PaddleOCRModelId, useGpu?: boolean): boolean;
53
50
  /**
54
51
  * 单独设置检测阶段输入最大边长,不重新加载已加载的 PP-OCRv5/v6 模型。可在首次识别前调用,后续默认自动加载 PP-OCRv6 small 时会沿用该设置。
55
52
  * @param maxSideLen 最大边长,默认768;传 0 或负数时使用默认值 768
package/types/pip.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 悬浮窗模块
3
+ */
1
4
  declare namespace pip {
2
5
  /**
3
6
  * 判断悬浮窗是否打开
package/types/system.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 系统模块 包含系统操作、系统信息等功能
2
+ * 系统模块
3
3
  */
4
4
  declare namespace system {
5
5
  type AppInfo = {
@@ -1,6 +1,5 @@
1
1
  /**
2
- * TomatoOCR 模块
3
- * 提供基于 TomatoOCR 框架的文字识别和 YOLO 目标检测功能
2
+ * TomatoOCR模块
4
3
  */
5
4
  declare namespace tomatoOcr {
6
5
  /**
@@ -21,7 +20,7 @@ declare namespace tomatoOcr {
21
20
  function initializeWithConfig(
22
21
  mode: string,
23
22
  licenseData: string,
24
- remark?: string
23
+ remark?: string,
25
24
  ): {
26
25
  deviceId: string;
27
26
  expiryTime: string;
@@ -178,7 +177,7 @@ declare namespace tomatoOcr {
178
177
  x?: number,
179
178
  y?: number,
180
179
  ex?: number,
181
- ey?: number
180
+ ey?: number,
182
181
  ): string;
183
182
 
184
183
  /**
package/types/tts.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TTS(文本转语音)模块 包含语音合成、播放控制等功能
2
+ * TTS(文本转语音)模块
3
3
  */
4
4
  declare namespace tts {
5
5
  /**
@@ -32,7 +32,7 @@ declare namespace tts {
32
32
  rate?: number,
33
33
  pitch?: number,
34
34
  volume?: number,
35
- language?: string
35
+ language?: string,
36
36
  ): boolean;
37
37
 
38
38
  /**
package/types/ui.d.ts CHANGED
@@ -1,114 +1,5 @@
1
- declare namespace ms {
2
- /**
3
- * 注册UI函数 网页页面使用,给主进程调用
4
- * @param name 函数名称
5
- * @param func 函数
6
- */
7
- function registerUIFunc(
8
- name: string,
9
- func: (data: Record<string, any>) => void,
10
- ): void;
11
-
12
- /**
13
- * 发送事件 网页页面使用 给主进程发送事件
14
- * @param event 事件名称
15
- * @param data 事件参数
16
- */
17
- function emitEvent(event: string, data: Record<string, any>): void;
18
-
19
- /**
20
- * 启动脚本 网页页面使用
21
- * @returns 如果启动成功返回true,否则返回false
22
- */
23
- function startTask(): Promise<boolean>;
24
-
25
- /**
26
- * 停止脚本 网页页面使用
27
- * @returns 如果停止成功返回false,否则返回true
28
- */
29
- function stopTask(): Promise<boolean>;
30
-
31
- /**
32
- * 检查脚本是否正在运行 网页页面使用
33
- * @returns 如果脚本正在运行返回true,否则返回false
34
- */
35
- function isTaskRunning(): Promise<boolean>;
36
-
37
- /**
38
- * 设置配置项
39
- * @param key 配置项键
40
- * @param value 配置项值
41
- * @returns 如果设置成功返回true,否则返回false
42
- */
43
- function setConfig(key: string, value: any): Promise<boolean>;
44
-
45
- /**
46
- * 获取配置项
47
- * @param key 配置项键
48
- * @returns 配置项值
49
- */
50
- function getConfig(key: string): Promise<any>;
51
-
52
- /**
53
- * 移除配置项
54
- * @param key 配置项键
55
- * @returns 如果移除成功返回true,否则返回false
56
- */
57
- function removeConfig(key: string): Promise<boolean>;
58
-
59
- /**
60
- * 获取所有配置的字典
61
- * @returns 包含所有配置的字典
62
- */
63
- function getAllConfig(): Promise<Record<string, any>>;
64
-
65
- /**
66
- * 设置所有配置项
67
- * @param config 包含所有配置项的字典
68
- * @returns 如果设置成功返回true,否则返回false
69
- */
70
- function setAllConfig(config: Record<string, any>): Promise<boolean>;
71
-
72
- /**
73
- * 获取设备ID
74
- * @returns 设备的唯一标识符(IDFV)。卸载重装 APP 后会改变,更新 APP 后不会改变。
75
- */
76
- function getDeviceID(): Promise<string>;
77
-
78
- /**
79
- * 获取当前软件包缓存的授权卡密
80
- * @returns 有缓存的授权卡密时返回卡密字符串,没有缓存时返回空字符串
81
- */
82
- function getAuthCardNo(): Promise<string>;
83
-
84
- /**
85
- * 获取Agent状态
86
- * @returns 如果Agent正在运行返回true,否则返回false
87
- */
88
- function getAgentStatus(): Promise<boolean>;
89
-
90
- /**
91
- * 启动Agent服务
92
- * @returns 如果调用成功返回true,否则返回false。注意:返回值仅表示调用是否成功,不代表Agent服务是否启动成功
93
- */
94
- function startAgent(): Promise<boolean>;
95
-
96
- /**
97
- * 停止Agent服务
98
- * @returns 如果调用成功返回true,否则返回false。注意:返回值仅表示调用是否成功,不代表Agent服务是否停止成功
99
- */
100
- function stopAgent(): Promise<boolean>;
101
-
102
- /**
103
- * 打开URL
104
- * @param url URL地址
105
- * @returns 如果调用成功返回true,否则返回false
106
- */
107
- function openURL(url: string): Promise<boolean>;
108
- }
109
-
110
1
  /**
111
- * UI模块 提供WebView相关功能
2
+ * UI模块
112
3
  */
113
4
  declare namespace ui {
114
5
  /**
package/types/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 工具模块 包含工具函数等功能
2
+ * 工具模块
3
3
  */
4
4
  declare namespace utils {
5
5
  /**
package/types/web.d.ts ADDED
@@ -0,0 +1,111 @@
1
+ /**
2
+ * 网页模块
3
+ */
4
+ declare namespace ms {
5
+ /**
6
+ * 注册UI函数 网页页面使用,给主进程调用
7
+ * @param name 函数名称
8
+ * @param func 函数
9
+ */
10
+ function registerUIFunc(
11
+ name: string,
12
+ func: (data: Record<string, any>) => void,
13
+ ): void;
14
+
15
+ /**
16
+ * 发送事件 网页页面使用 给主进程发送事件
17
+ * @param event 事件名称
18
+ * @param data 事件参数
19
+ */
20
+ function emitEvent(event: string, data: Record<string, any>): void;
21
+
22
+ /**
23
+ * 启动脚本 网页页面使用
24
+ * @returns 如果启动成功返回true,否则返回false
25
+ */
26
+ function startTask(): Promise<boolean>;
27
+
28
+ /**
29
+ * 停止脚本 网页页面使用
30
+ * @returns 如果停止成功返回false,否则返回true
31
+ */
32
+ function stopTask(): Promise<boolean>;
33
+
34
+ /**
35
+ * 检查脚本是否正在运行 网页页面使用
36
+ * @returns 如果脚本正在运行返回true,否则返回false
37
+ */
38
+ function isTaskRunning(): Promise<boolean>;
39
+
40
+ /**
41
+ * 设置配置项
42
+ * @param key 配置项键
43
+ * @param value 配置项值
44
+ * @returns 如果设置成功返回true,否则返回false
45
+ */
46
+ function setConfig(key: string, value: any): Promise<boolean>;
47
+
48
+ /**
49
+ * 获取配置项
50
+ * @param key 配置项键
51
+ * @returns 配置项值
52
+ */
53
+ function getConfig(key: string): Promise<any>;
54
+
55
+ /**
56
+ * 移除配置项
57
+ * @param key 配置项键
58
+ * @returns 如果移除成功返回true,否则返回false
59
+ */
60
+ function removeConfig(key: string): Promise<boolean>;
61
+
62
+ /**
63
+ * 获取所有配置的字典
64
+ * @returns 包含所有配置的字典
65
+ */
66
+ function getAllConfig(): Promise<Record<string, any>>;
67
+
68
+ /**
69
+ * 设置所有配置项
70
+ * @param config 包含所有配置项的字典
71
+ * @returns 如果设置成功返回true,否则返回false
72
+ */
73
+ function setAllConfig(config: Record<string, any>): Promise<boolean>;
74
+
75
+ /**
76
+ * 获取设备ID
77
+ * @returns 设备的唯一标识符(IDFV)。卸载重装 APP 后会改变,更新 APP 后不会改变。
78
+ */
79
+ function getDeviceID(): Promise<string>;
80
+
81
+ /**
82
+ * 获取当前软件包缓存的授权卡密
83
+ * @returns 有缓存的授权卡密时返回卡密字符串,没有缓存时返回空字符串
84
+ */
85
+ function getAuthCardNo(): Promise<string>;
86
+
87
+ /**
88
+ * 获取Agent状态
89
+ * @returns 如果Agent正在运行返回true,否则返回false
90
+ */
91
+ function getAgentStatus(): Promise<boolean>;
92
+
93
+ /**
94
+ * 启动Agent服务
95
+ * @returns 如果调用成功返回true,否则返回false。注意:返回值仅表示调用是否成功,不代表Agent服务是否启动成功
96
+ */
97
+ function startAgent(): Promise<boolean>;
98
+
99
+ /**
100
+ * 停止Agent服务
101
+ * @returns 如果调用成功返回true,否则返回false。注意:返回值仅表示调用是否成功,不代表Agent服务是否停止成功
102
+ */
103
+ function stopAgent(): Promise<boolean>;
104
+
105
+ /**
106
+ * 打开URL
107
+ * @param url URL地址
108
+ * @returns 如果调用成功返回true,否则返回false
109
+ */
110
+ function openURL(url: string): Promise<boolean>;
111
+ }
package/types/yolo.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * YOLO目标检测模块 包含加载模型、目标检测等功能
2
+ * YOLO目标检测模块
3
3
  */
4
4
  declare namespace yolo {
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * YOLO 图像分类模块,提供 NCNN YOLO-cls 分类模型加载、分类和资源释放能力
2
+ * YOLO图像分类模块
3
3
  */
4
4
  declare namespace yoloCls {
5
5
  /**
@@ -39,7 +39,7 @@ declare const $HID按键: {
39
39
  };
40
40
 
41
41
  /**
42
- * HID模块 包含点击、滑动、长按滑动、返回首页等动作
42
+ * HID模块
43
43
  */
44
44
  declare namespace $HID {
45
45
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * HTTP模块 包含发送HTTP请求、下载文件等功能、websocket等功能
4
+ * HTTP模块
4
5
  */
5
6
  declare namespace $HTTP {
6
7
  /**
@@ -132,7 +133,7 @@ declare namespace $HTTP {
132
133
  请求地址: 字符串,
133
134
  保存的文件路径: 字符串,
134
135
  超时时间?: 数字,
135
- 请求头?: 字典<字符串>
136
+ 请求头?: 字典<字符串>,
136
137
  ): 布尔值;
137
138
 
138
139
  /**
@@ -149,7 +150,7 @@ declare namespace $HTTP {
149
150
  请求地址: 字符串,
150
151
  请求参数?: 字典<字符串>,
151
152
  超时时间?: 数字,
152
- 请求头?: 字典<字符串>
153
+ 请求头?: 字典<字符串>,
153
154
  ): 字符串 | null;
154
155
 
155
156
  /**
@@ -168,7 +169,7 @@ declare namespace $HTTP {
168
169
  请求参数?: 字典<任意类型>,
169
170
  请求文件?: 字典<字符串>,
170
171
  超时时间?: 数字,
171
- 请求头?: 字典<字符串>
172
+ 请求头?: 字典<字符串>,
172
173
  ): 字符串 | null;
173
174
 
174
175
  /**
@@ -188,7 +189,7 @@ declare namespace $HTTP {
188
189
  请求地址: 字符串,
189
190
  请求JSON数据?: 字典<任意类型>,
190
191
  超时时间?: 数字,
191
- 请求头?: 字典<字符串>
192
+ 请求头?: 字典<字符串>,
192
193
  ): 字符串 | null;
193
194
 
194
195
  /**
@@ -207,7 +208,7 @@ declare namespace $HTTP {
207
208
  */
208
209
  function 创建WebSocket连接(
209
210
  连接地址: 字符串,
210
- 连接头?: 字典<字符串>
211
+ 连接头?: 字典<字符串>,
211
212
  ): WebSocket连接;
212
213
 
213
214
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * MySQL 数据库模块 - 提供 MySQL 数据库连接和操作功能
4
+ * MySQL数据库模块
4
5
  */
5
6
  declare namespace $MySQL数据库 {
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * 飞桨OCR模块 包含OCR识别、模型切换和资源释放等功能
4
+ * PaddleOCR模块
4
5
  */
5
6
  declare namespace $PaddleOCR {
6
7
  /**
@@ -47,10 +48,7 @@ declare namespace $PaddleOCR {
47
48
  * const 加载成功 = $PaddleOCR.加载模型("ppocr-v6-small", false)
48
49
  * $打印信息日志(`PaddleOCR 模型加载结果: ${加载成功}`)
49
50
  */
50
- function 加载模型(
51
- 模型ID: PaddleOCR模型ID,
52
- useGpu?: 布尔值,
53
- ): 布尔值;
51
+ function 加载模型(模型ID: PaddleOCR模型ID, useGpu?: 布尔值): 布尔值;
54
52
  /**
55
53
  * 单独设置检测阶段输入最大边长,不重新加载已加载的 PP-OCRv5/v6 模型。可在首次识别前调用,后续默认自动加载 PP-OCRv6 small 时会沿用该设置。
56
54
  * @param 最大边长 最大边长,默认768;传 0 或负数时使用默认值 768
@@ -1,7 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
3
  /**
4
- * YOLO 图像分类模块,提供 NCNN YOLO-cls 分类模型加载、分类和资源释放能力
4
+ * YOLO图像分类模块
5
5
  */
6
6
  declare namespace $YOLO分类 {
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
3
  /**
4
- * YOLO目标检测模块 包含加载模型、目标检测等功能
4
+ * YOLO目标检测模块
5
5
  */
6
6
  declare namespace $YOLO {
7
7
  /**
@@ -1,5 +1,8 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
+ /**
4
+ * 云控模块
5
+ */
3
6
  declare namespace $云控 {
4
7
  /**
5
8
  * 连接云控服务器。
@@ -49,6 +52,6 @@ declare namespace $云控 {
49
52
  * });
50
53
  */
51
54
  function 监听事件回调(
52
- 回调: ((事件: 字符串, 数据: 字典<任意类型>) => 无返回值) | null
55
+ 回调: ((事件: 字符串, 数据: 字典<任意类型>) => 无返回值) | null,
53
56
  ): 无返回值;
54
57
  }
@@ -1,7 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
3
  /**
4
- * 动作模块 包含点击、滑动、长按滑动、返回首页等动作
4
+ * 动作模块
5
5
  */
6
6
  declare namespace $动作 {
7
7
  /**
@@ -198,7 +198,12 @@ declare namespace $动作 {
198
198
  * @example $动作.按键("home")
199
199
  */
200
200
  function 按键(
201
- 按键: "home" | "volumeup" | "volumedown" | "brightnessup" | "brightnessdown",
201
+ 按键:
202
+ | "home"
203
+ | "volumeup"
204
+ | "volumedown"
205
+ | "brightnessup"
206
+ | "brightnessdown",
202
207
  ): 布尔值;
203
208
 
204
209
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * 图片模块 包含图片操作、图片内容读写等功能
4
+ * 图片模块
4
5
  */
5
6
  declare namespace $图片 {
6
7
  /**
@@ -1,6 +1,6 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
  /**
3
- * 媒体模块 包含媒体操作、媒体内容读写等功能
3
+ * 媒体模块
4
4
  */
5
5
  declare namespace $媒体 {
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
3
  /**
4
- * 工具模块 包含工具函数等功能
4
+ * 工具模块
5
5
  */
6
6
  declare namespace $工具 {
7
7
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * 悬浮窗模块 包含悬浮窗日志窗口的显示、模式切换、状态查询等功能
4
+ * 悬浮窗模块
4
5
  */
5
6
  declare namespace $悬浮窗 {
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * 文件模块 包含文件操作、文件内容读写等功能
4
+ * 文件模块
4
5
  */
5
6
  declare namespace $文件 {
6
7
  /**
@@ -11,7 +12,7 @@ declare namespace $文件 {
11
12
  * @example $文件.获取内部目录("documents")
12
13
  */
13
14
  function 获取内部目录(
14
- 目录类型: "documents" | "library" | "temp" | "libraryCaches"
15
+ 目录类型: "documents" | "library" | "temp" | "libraryCaches",
15
16
  ): 字符串;
16
17
  /**
17
18
  * 创建文件
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * TTS(文本转语音)模块 包含语音合成、播放控制等功能
4
+ * TTS(文本转语音)模块
4
5
  */
5
6
  declare namespace $文字转语音 {
6
7
  /**
@@ -33,7 +34,7 @@ declare namespace $文字转语音 {
33
34
  rate?: 数字,
34
35
  pitch?: 数字,
35
36
  volume?: 数字,
36
- language?: 字符串
37
+ language?: 字符串,
37
38
  ): 布尔值;
38
39
 
39
40
  /**
@@ -1,6 +1,6 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
  /**
3
- * 日志模块 包含日志输出、日志等级设置等功能
3
+ * 日志模块
4
4
  */
5
5
  declare namespace $日志 {
6
6
  /**
@@ -10,7 +10,7 @@ declare namespace $日志 {
10
10
  * $日志.设置日志级别("info");
11
11
  */
12
12
  function 设置日志级别(
13
- 日志等级: "error" | "warn" | "debug" | "info" | "off"
13
+ 日志等级: "error" | "warn" | "debug" | "info" | "off",
14
14
  ): 无返回值;
15
15
  /**
16
16
  * 设置是否输出到文件 默认开启
@@ -1,6 +1,8 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
- /** 固定像素尺寸的点阵 OCR(`kuaijs-dot-font` 字库)。 */
3
+ /**
4
+ * 点阵OCR模块
5
+ */
4
6
  declare namespace $点阵OCR {
5
7
  interface OCR字符 {
6
8
  text: 字符串;
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * 系统模块 包含系统操作、系统信息等功能
4
+ * 系统模块
4
5
  */
5
6
  declare namespace $系统 {
6
7
  type APP信息 = {
@@ -1,4 +1,5 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
4
  * 线程模块 包含线程操作、线程回调等功能
4
5
  */
@@ -1,6 +1,6 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
  /**
3
- * 节点模块 包含节点操作、节点内容读写等功能
3
+ * 节点模块
4
4
  */
5
5
  declare function $创建节点选择器(params?: {
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
3
  /**
4
- * Apple OCR模块 使用Apple Vision框架进行文本识别
4
+ * AppleOCR模块
5
5
  */
6
6
  declare namespace $苹果OCR {
7
7
  /**
@@ -51,7 +51,7 @@ declare namespace $苹果OCR {
51
51
  图片边界框左上角y坐标?: 数字,
52
52
  图片边界框右下角x坐标?: 数字,
53
53
  图片边界框右下角y坐标?: 数字,
54
- 识别语言数组?: Array<字符串>
54
+ 识别语言数组?: Array<字符串>,
55
55
  ): 数组<OCR识别结果>;
56
56
 
57
57
  /**
@@ -73,7 +73,7 @@ declare namespace $苹果OCR {
73
73
  图片边界框左上角x坐标?: 数字,
74
74
  图片边界框左上角y坐标?: 数字,
75
75
  图片边界框右下角x坐标?: 数字,
76
- 图片边界框右下角y坐标?: 数字
76
+ 图片边界框右下角y坐标?: 数字,
77
77
  ): 数组<OCR识别结果>;
78
78
 
79
79
  /**
@@ -101,6 +101,6 @@ declare namespace $苹果OCR {
101
101
  图片边界框右下角x坐标?: 数字,
102
102
  图片边界框右下角y坐标?: 数字,
103
103
  识别语言数组?: 数组<字符串>,
104
- 是否完整匹配?: 布尔值
104
+ 是否完整匹配?: 布尔值,
105
105
  ): 数组<OCR识别结果>;
106
106
  }
@@ -1,7 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
3
  /**
4
- * UI模块 提供WebView相关功能
4
+ * UI模块
5
5
  */
6
6
  declare namespace $视图 {
7
7
  /**
@@ -24,7 +24,7 @@ declare namespace $视图 {
24
24
  * })
25
25
  */
26
26
  function 监听事件回调(
27
- 回调函数: ((事件名称: 字符串, 数据: 字典<任意类型>) => 无返回值) | null
27
+ 回调函数: ((事件名称: 字符串, 数据: 字典<任意类型>) => 无返回值) | null,
28
28
  ): 无返回值;
29
29
 
30
30
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * 设备模块 包含获取设备信息、设备操作等功能
4
+ * 设备模块
4
5
  */
5
6
  declare namespace $设备 {
6
7
  /**
@@ -1,6 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
+
2
3
  /**
3
- * 输入法模块 包含输入法操作、输入法内容读写等功能
4
+ * 输入法模块
4
5
  */
5
6
  declare namespace $输入法 {
6
7
  /**
@@ -1,7 +1,7 @@
1
1
  /// <reference path="全局模块.d.ts" />
2
2
 
3
3
  /**
4
- * 配置模块 包含读取配置、更新配置、删除配置等功能
4
+ * 配置模块
5
5
  */
6
6
  declare namespace $配置 {
7
7
  /**