ms-vite-plugin 1.5.12 → 1.5.14

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 (61) hide show
  1. package/dist/build/luaBundle.js +2 -2
  2. package/dist/build/scriptProtect.js +2 -2
  3. package/docs/api/ai.md +16 -16
  4. package/docs/api/config.md +3 -3
  5. package/docs/api/dotocr.md +2 -2
  6. package/docs/api/file.md +18 -18
  7. package/docs/api/hid.md +2 -2
  8. package/docs/api/hotUpdate.md +2 -2
  9. package/docs/api/http.md +4 -4
  10. package/docs/api/image.md +15 -15
  11. package/docs/api/jbclear.md +12 -12
  12. package/docs/api/jbdevice.md +25 -25
  13. package/docs/api/jbdraw.md +139 -0
  14. package/docs/api/jbdylib.md +6 -6
  15. package/docs/api/jbpower.md +134 -0
  16. package/docs/api/jbshell.md +2 -2
  17. package/docs/api/jbsystem.md +6 -6
  18. package/docs/api/jbvpn.md +7 -7
  19. package/docs/api/mysql.md +4 -4
  20. package/docs/api/netCard.md +4 -73
  21. package/docs/api/node.md +5 -3
  22. package/docs/api/opencv.md +116 -116
  23. package/docs/api/plist.md +2 -2
  24. package/docs/api/sqlite.md +231 -0
  25. package/docs/api/system.md +1 -1
  26. package/docs/api/thread.md +2 -2
  27. package/docs/api/tomatoocr.md +2 -2
  28. package/docs/api/yolo.md +2 -2
  29. package/docs/api/yolocls.md +6 -6
  30. package/docs/api/zipFile.md +113 -0
  31. package/docs/apicn/ai.md +16 -16
  32. package/docs/apicn/config.md +2 -2
  33. package/docs/apicn/dotocr.md +2 -2
  34. package/docs/apicn/file.md +16 -16
  35. package/docs/apicn/hid.md +4 -4
  36. package/docs/apicn/hotUpdate.md +2 -2
  37. package/docs/apicn/http.md +4 -4
  38. package/docs/apicn/image.md +13 -13
  39. package/docs/apicn/mysql.md +4 -4
  40. package/docs/apicn/netCard.md +4 -73
  41. package/docs/apicn/node.md +5 -3
  42. package/docs/apicn/sqlite.md +197 -0
  43. package/docs/apicn/system.md +3 -3
  44. package/docs/apicn/thread.md +2 -2
  45. package/docs/apicn/yolo.md +2 -2
  46. package/docs/apicn/yolocls.md +6 -6
  47. package/docs/apicn/zipFile.md +113 -0
  48. package/docs/apilua/jbdraw.md +141 -0
  49. package/docs/apilua/jbpower.md +136 -0
  50. package/docs/apilua/netCard.md +3 -77
  51. package/docs/apilua/node.md +3 -1
  52. package/docs/apilua/sqlite.md +204 -0
  53. package/docs/apilua/zipFile.md +123 -0
  54. package/docs/apipython/jbdraw.md +147 -0
  55. package/docs/apipython/jbpower.md +133 -0
  56. package/docs/apipython/netCard.md +3 -74
  57. package/docs/apipython/node.md +3 -1
  58. package/docs/apipython/overview.md +1 -1
  59. package/docs/apipython/sqlite.md +181 -0
  60. package/docs/apipython/zipFile.md +117 -0
  61. package/package.json +1 -1
@@ -71,14 +71,14 @@ jbsystem.restartSelf();
71
71
  对应 `设置 > 隐私与安全性 > 跟踪 > 允许 App 请求跟踪`。
72
72
 
73
73
  ```typescript
74
- function getUserTracking(): boolean | null;
74
+ function getUserTracking(): boolean | undefined;
75
75
  ```
76
76
 
77
77
  **返回值:**
78
78
 
79
79
  | 类型 | 描述 |
80
80
  | ------------------ | -------------------------------- |
81
- | `boolean \| null` | 当前是否允许;读失败返回 `null` |
81
+ | `boolean \| undefined` | 当前是否允许;读失败返回 `undefined` |
82
82
 
83
83
  **示例:**
84
84
 
@@ -119,14 +119,14 @@ jbsystem.setUserTracking(false);
119
119
  对应 `设置 > 隐私与安全性 > Apple 广告 > 个性化广告`。
120
120
 
121
121
  ```typescript
122
- function getPersonalizedAdvertising(): boolean | null;
122
+ function getPersonalizedAdvertising(): boolean | undefined;
123
123
  ```
124
124
 
125
125
  **返回值:**
126
126
 
127
127
  | 类型 | 描述 |
128
128
  | ------------------ | -------------------------------- |
129
- | `boolean \| null` | 当前是否允许;读失败返回 `null` |
129
+ | `boolean \| undefined` | 当前是否允许;读失败返回 `undefined` |
130
130
 
131
131
  **示例:**
132
132
 
@@ -167,14 +167,14 @@ jbsystem.setPersonalizedAdvertising(false);
167
167
  对应 `设置 > 隐私与安全性 > 定位服务` 总开关。
168
168
 
169
169
  ```typescript
170
- function getLocationServices(): boolean | null;
170
+ function getLocationServices(): boolean | undefined;
171
171
  ```
172
172
 
173
173
  **返回值:**
174
174
 
175
175
  | 类型 | 描述 |
176
176
  | ------------------ | -------------------------------- |
177
- | `boolean \| null` | 当前是否开启;读失败返回 `null` |
177
+ | `boolean \| undefined` | 当前是否开启;读失败返回 `undefined` |
178
178
 
179
179
  **示例:**
180
180
 
package/docs/api/jbvpn.md CHANGED
@@ -60,14 +60,14 @@ const ok = jbvpn.create({
60
60
  ### list - 列出当前系统 VPN 配置。
61
61
 
62
62
  ```typescript
63
- function list(): VpnItem[] | null;
63
+ function list(): VpnItem[] | undefined;
64
64
  ```
65
65
 
66
66
  **返回值:**
67
67
 
68
68
  | 类型 | 描述 |
69
69
  | -------------------- | ---------------------------------- |
70
- | `VpnItem[] \| null` | 配置列表;读失败返回 `null` |
70
+ | `VpnItem[] \| undefined` | 配置列表;读失败返回 `undefined` |
71
71
 
72
72
  没有配置时是空数组。每项含 `name`、`id`。
73
73
 
@@ -84,17 +84,17 @@ if (items) {
84
84
 
85
85
  ### current - 读取当前选中的 VPN 配置。
86
86
 
87
- 没有选中配置返回 `null`。
87
+ 没有选中配置返回 `undefined`。
88
88
 
89
89
  ```typescript
90
- function current(): VpnItem | null;
90
+ function current(): VpnItem | undefined;
91
91
  ```
92
92
 
93
93
  **返回值:**
94
94
 
95
95
  | 类型 | 描述 |
96
96
  | ------------------ | ----------------------------------------- |
97
- | `VpnItem \| null` | `{ name, id }`;没有选中配置返回 `null` |
97
+ | `VpnItem \| undefined` | `{ name, id }`;没有选中配置返回 `undefined` |
98
98
 
99
99
  **示例:**
100
100
 
@@ -200,14 +200,14 @@ jbvpn.disconnect();
200
200
  ### status - 读取当前选中 VPN 的状态。
201
201
 
202
202
  ```typescript
203
- function status(): VpnStatus | null;
203
+ function status(): VpnStatus | undefined;
204
204
  ```
205
205
 
206
206
  **返回值:**
207
207
 
208
208
  | 类型 | 描述 |
209
209
  | -------------------- | -------------------------------- |
210
- | `VpnStatus \| null` | `{ text, connected }`;没有选中配置返回 `null` |
210
+ | `VpnStatus \| undefined` | `{ text, connected }`;没有选中配置返回 `undefined` |
211
211
 
212
212
  **示例:**
213
213
 
package/docs/api/mysql.md CHANGED
@@ -50,9 +50,9 @@ interface MySQLConfig {
50
50
  interface MySQLResult {
51
51
  rows: Record<string, any>[]; // 查询结果数据行
52
52
  affectedRows: number; // 受影响的行数
53
- insertId?: number; // 插入ID(仅适用于INSERT操作)
53
+ insertId: number | null; // 插入ID(仅适用于INSERT操作);没有插入时为 null
54
54
  success: boolean; // 查询是否成功
55
- error?: string; // 错误信息
55
+ error: string | null; // 错误信息;成功时为 null
56
56
  }
57
57
  ```
58
58
 
@@ -62,9 +62,9 @@ interface MySQLResult {
62
62
  | -------------- | --------------------- | -------- | ------ | ------------------------------- |
63
63
  | `rows` | Record<string, any>[] | 否 | | 查询结果数据行 |
64
64
  | `affectedRows` | number | 否 | | 受影响的行数 |
65
- | `insertId` | number | 否 | | 插入 ID(仅适用于 INSERT 操作) |
65
+ | `insertId` | number \| null | 否 | | 插入 ID;没有插入时为 `null` |
66
66
  | `success` | boolean | 否 | | 查询是否成功 |
67
- | `error` | string | 否 | | 错误信息 |
67
+ | `error` | string \| null | 否 | | 错误信息;成功时为 `null` |
68
68
 
69
69
  ## API 参考
70
70
 
@@ -1,17 +1,16 @@
1
1
  # 卡密模块 (NetCard)
2
2
 
3
- 卡密模块提供了卡密验证、备注设置以及键值对存储功能,用于管理网络卡密相关的操作。
3
+ 卡密模块提供了卡密验证和备注设置功能,用于管理网络卡密相关的操作。
4
4
 
5
5
  ## 功能概览
6
6
 
7
7
  - **卡密验证**: 验证卡密的有效性
8
8
  - **备注管理**: 设置和管理卡密备注信息
9
- - **云变量存储**: 提供键值对形式的数据存储和读取功能
10
9
 
11
10
  ## 注意事项
12
11
 
13
12
  1. **卡密安全**: 卡密信息应当妥善保管,避免在日志中明文输出
14
- 2. **普通卡密模式**: 需要先调用 `netCard.verify(cardNo)` 验证卡密,验证通过后才能调用获取卡密信息、备注和云变量等接口
13
+ 2. **普通卡密模式**: 需要先调用 `netCard.verify(cardNo)` 验证卡密,验证通过后才能调用获取卡密信息和备注等接口
15
14
  3. **授权卡密模式**: App 打开加密 UI 或运行脚本前会完成授权和卡密验证,脚本中不需要重复让用户输入卡密,也不需要重复调用 `netCard.verify`
16
15
  4. **兼容旧脚本**: 授权卡密模式下调用 `netCard.verify` 会直接返回 `true`,用于兼容原来已经写了 `verify` 的脚本
17
16
 
@@ -73,7 +72,7 @@ function verify(cardNo: string): boolean;
73
72
 
74
73
  **说明:**
75
74
 
76
- 普通卡密模式下,该方法会请求普通卡密验证接口,验证成功后才能继续使用卡密信息、备注和云变量相关能力。
75
+ 普通卡密模式下,该方法会请求普通卡密验证接口,验证成功后才能继续使用卡密信息和备注相关能力。
77
76
 
78
77
  授权卡密模式下,App 层已经完成授权和卡密验证,脚本侧不需要重复调用该方法;如果旧脚本仍然调用,方法会直接返回 `true`。
79
78
 
@@ -110,7 +109,7 @@ if (!netCard.isAuthCardMode()) {
110
109
  #### getCardInfo - 获取卡密信息
111
110
 
112
111
  ```typescript
113
- function getCardInfo(): CardInfo | null;
112
+ function getCardInfo(): CardInfo | undefined;
114
113
  ```
115
114
 
116
115
  **返回值:**
@@ -168,71 +167,3 @@ if (success) {
168
167
  logger.error("备注设置失败");
169
168
  }
170
169
  ```
171
-
172
- ### 云变量
173
-
174
- #### setValue - 设置键值对
175
-
176
- ```typescript
177
- function setValue(key: string, value: string): string;
178
- ```
179
-
180
- **参数说明:**
181
-
182
- | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
183
- | ------- | ------ | -------- | ------ | ---------- |
184
- | `key` | string | 是 | | 存储的键名 |
185
- | `value` | string | 是 | | 存储的值 |
186
-
187
- **返回值:**
188
-
189
- | 类型 | 描述 |
190
- | -------- | --------------------------------------------- |
191
- | `string` | 成功时返回设置的 value 值,失败时返回空字符串 |
192
-
193
- **示例:**
194
-
195
- ```typescript
196
- // 设置键值对
197
- const key = "userConfig";
198
- const value = "enableNotification";
199
- const result = netCard.setValue(key, value);
200
-
201
- if (result === value) {
202
- logi(`成功设置 ${key}: ${value}`);
203
- } else {
204
- logger.error("设置失败");
205
- }
206
- ```
207
-
208
- #### getValue - 获取键值对
209
-
210
- ```typescript
211
- function getValue(key: string): string;
212
- ```
213
-
214
- **参数说明:**
215
-
216
- | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
217
- | ------ | ------ | -------- | ------ | ------------ |
218
- | `key` | string | 是 | | 要获取的键名 |
219
-
220
- **返回值:**
221
-
222
- | 类型 | 描述 |
223
- | -------- | ------------------------------------------------ |
224
- | `string` | 成功时返回对应的值,失败或键不存在时返回空字符串 |
225
-
226
- **示例:**
227
-
228
- ```typescript
229
- // 获取键值对
230
- const key = "userConfig";
231
- const value = netCard.getValue(key);
232
-
233
- if (value) {
234
- logi(`获取到配置: ${key} = ${value}`);
235
- } else {
236
- logw(`配置 ${key} 不存在或获取失败");
237
- }
238
- ```
package/docs/api/node.md CHANGED
@@ -100,9 +100,9 @@ const listPage = createNodeSelector({ mode: 2 });
100
100
  | `releaseNode()` | 释放内存 |
101
101
  | `loadNode(timeout?)` | 重新加载界面节点,默认超时 5000ms |
102
102
  | `clearSelector()` | 清除已设置的筛选条件 |
103
- | `xml(timeout?)` | 获取界面 XML,失败返回 `null` |
103
+ | `xml(timeout?)` | 获取界面 XML,失败返回 `undefined` |
104
104
  | `getNodeInfo(timeout?)` | 获取所有匹配节点 |
105
- | `getOneNodeInfo(timeout?)` | 获取第一个匹配节点,没有则 `null` |
105
+ | `getOneNodeInfo(timeout?)` | 获取第一个匹配节点,没有则 `undefined` |
106
106
 
107
107
  `timeout` 单位均为毫秒,默认 `5000`。
108
108
 
@@ -144,9 +144,11 @@ selector.releaseNode();
144
144
  | `depth` | 层级 |
145
145
  | `childCount` | 子节点数,支持数字或如 `">0"` |
146
146
  | `bounds(x, y, width, height)` | 区域 |
147
- | `xpath` | XPath |
147
+ | `xpath` | XPath 1.0 路径 |
148
148
  | `id` | 按节点 ID |
149
149
 
150
+ `xpath` 只支持 [XPath 1.0](https://www.w3.org/TR/1999/REC-xpath-19991116/)。`matches()` 等 XPath 2.0 函数不可用;属性上的正则用 `identifierMatch` 等带 `Match` 的方法。
151
+
150
152
  ```typescript
151
153
  // 精确
152
154
  selector.label("确定").type("XCUIElementTypeButton").getOneNodeInfo(3000);