ms-vite-plugin 1.5.13 → 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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  仅越狱包可用。免越狱包没有 `jbpower`。
4
4
 
5
- `info` 读取电量百分比、电流、电压和充电状态。`stopCharging` 停止充电并保持,直到调用 `startCharging`。
5
+ `info` 读取电量百分比、电流、电压和充电状态。`stopCharging` 停止充电并保持,直到调用 `startCharging`。`setSmartCharging` 到上限停止充电,降到下限再充,中间保持。
6
6
 
7
7
  电流单位是毫安,正数表示正在进电。电压单位是毫伏。
8
8
 
@@ -83,3 +83,52 @@ function startCharging(): boolean;
83
83
  ```javascript
84
84
  jbpower.startCharging();
85
85
  ```
86
+
87
+ ### setSmartCharging - 打开智能充电。
88
+
89
+ 电量到 `max` 停止充电,降到 `min` 再充。窗口中间保持上次的决定,不会在停充和充电之间来回切。
90
+
91
+ 上限会收到 2 到 100,下限至少为 1,并且必须小于上限。
92
+
93
+ ```typescript
94
+ function setSmartCharging(min: number, max: number): boolean;
95
+ ```
96
+
97
+ **参数:**
98
+
99
+ | 参数 | 类型 | 描述 |
100
+ | ----- | -------- | -------------------- |
101
+ | `min` | `number` | 再充下限,百分比 |
102
+ | `max` | `number` | 停充上限,百分比 |
103
+
104
+ **返回值:**
105
+
106
+ | 类型 | 描述 |
107
+ | --------- | -------------- |
108
+ | `boolean` | 保存成功为 `true` |
109
+
110
+ **示例:**
111
+
112
+ ```javascript
113
+ jbpower.setSmartCharging(20, 80);
114
+ ```
115
+
116
+ ### clearSmartCharging - 关掉智能充电。
117
+
118
+ 如果当前正按窗口停充,会恢复充电。
119
+
120
+ ```typescript
121
+ function clearSmartCharging(): boolean;
122
+ ```
123
+
124
+ **返回值:**
125
+
126
+ | 类型 | 描述 |
127
+ | --------- | -------------- |
128
+ | `boolean` | 保存成功为 `true` |
129
+
130
+ **示例:**
131
+
132
+ ```javascript
133
+ jbpower.clearSmartCharging();
134
+ ```
package/docs/api/node.md CHANGED
@@ -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);
@@ -144,9 +144,11 @@ selector.释放内存();
144
144
  | `层级` | 层级 |
145
145
  | `子节点数量` | 子节点数,支持数字或如 `">0"` |
146
146
  | `范围(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 函数不可用;属性上的正则用 `标识符匹配` 等带「匹配」的方法。
151
+
150
152
  ```typescript
151
153
  // 精确
152
154
  selector.标签("确定").类型("XCUIElementTypeButton").获取一个节点信息(3000);
@@ -4,7 +4,7 @@
4
4
 
5
5
  仅越狱包可用。免越狱包没有 `jbpower`。
6
6
 
7
- `info` 读取电量百分比、电流、电压和充电状态。`stopCharging` 停止充电并保持,直到调用 `startCharging`。
7
+ `info` 读取电量百分比、电流、电压和充电状态。`stopCharging` 停止充电并保持,直到调用 `startCharging`。`setSmartCharging` 到上限停止充电,降到下限再充,中间保持。
8
8
 
9
9
  电流单位是毫安,正数表示正在进电。电压单位是毫伏。
10
10
 
@@ -85,3 +85,52 @@ function startCharging()
85
85
  ```lua
86
86
  jbpower.startCharging()
87
87
  ```
88
+
89
+ ### setSmartCharging - 打开智能充电。
90
+
91
+ 电量到 `max` 停止充电,降到 `min` 再充。窗口中间保持上次的决定,不会在停充和充电之间来回切。
92
+
93
+ 上限会收到 2 到 100,下限至少为 1,并且必须小于上限。
94
+
95
+ ```lua
96
+ function setSmartCharging(min, max)
97
+ ```
98
+
99
+ **参数:**
100
+
101
+ | 参数 | 类型 | 描述 |
102
+ | ----- | --------- | ---------------- |
103
+ | `min` | `integer` | 再充下限,百分比 |
104
+ | `max` | `integer` | 停充上限,百分比 |
105
+
106
+ **返回值:**
107
+
108
+ | 类型 | 描述 |
109
+ | --------- | --------------- |
110
+ | `boolean` | 保存成功为 `true` |
111
+
112
+ **示例:**
113
+
114
+ ```lua
115
+ jbpower.setSmartCharging(20, 80)
116
+ ```
117
+
118
+ ### clearSmartCharging - 关掉智能充电。
119
+
120
+ 如果当前正按窗口停充,会恢复充电。
121
+
122
+ ```lua
123
+ function clearSmartCharging()
124
+ ```
125
+
126
+ **返回值:**
127
+
128
+ | 类型 | 描述 |
129
+ | --------- | --------------- |
130
+ | `boolean` | 保存成功为 `true` |
131
+
132
+ **示例:**
133
+
134
+ ```lua
135
+ jbpower.clearSmartCharging()
136
+ ```
@@ -155,9 +155,11 @@ selector:releaseNode() -- 手动释放
155
155
  | `depth` | 层级 |
156
156
  | `childCount` | 子节点数,支持数字或如 `">0"` |
157
157
  | `bounds(x, y, width, height)` | 区域 |
158
- | `xpath` | XPath |
158
+ | `xpath` | XPath 1.0 路径 |
159
159
  | `id` | 按节点 ID |
160
160
 
161
+ `xpath` 只支持 [XPath 1.0](https://www.w3.org/TR/1999/REC-xpath-19991116/)。`matches()` 等 XPath 2.0 函数不可用;属性上的正则用 `identifierMatch` 等带 `Match` 的方法。
162
+
161
163
  ```lua
162
164
  -- 精确
163
165
  selector:label("确定"):type("XCUIElementTypeButton"):getOneNodeInfo(3000)
@@ -2,7 +2,7 @@
2
2
 
3
3
  仅越狱包可用。免越狱包没有 `jbpower`。
4
4
 
5
- `info` 读取电量百分比、电流、电压和充电状态。`stopCharging` 停止充电并保持,直到调用 `startCharging`。
5
+ `info` 读取电量百分比、电流、电压和充电状态。`stopCharging` 停止充电并保持,直到调用 `startCharging`。`setSmartCharging` 到上限停止充电,降到下限再充,中间保持。
6
6
 
7
7
  电流单位是毫安,正数表示正在进电。电压单位是毫伏。
8
8
 
@@ -82,3 +82,52 @@ def startCharging() -> bool
82
82
  ```python
83
83
  jbpower.startCharging()
84
84
  ```
85
+
86
+ ### setSmartCharging - 打开智能充电。
87
+
88
+ 电量到 `max` 停止充电,降到 `min` 再充。窗口中间保持上次的决定,不会在停充和充电之间来回切。
89
+
90
+ 上限会收到 2 到 100,下限至少为 1,并且必须小于上限。
91
+
92
+ ```python
93
+ def setSmartCharging(min: int, max: int) -> bool
94
+ ```
95
+
96
+ **参数:**
97
+
98
+ | 参数 | 类型 | 描述 |
99
+ | ----- | ----- | ---------------- |
100
+ | `min` | `int` | 再充下限,百分比 |
101
+ | `max` | `int` | 停充上限,百分比 |
102
+
103
+ **返回值:**
104
+
105
+ | 类型 | 描述 |
106
+ | ------ | ----------------- |
107
+ | `bool` | 保存成功为 `True` |
108
+
109
+ **示例:**
110
+
111
+ ```python
112
+ jbpower.setSmartCharging(20, 80)
113
+ ```
114
+
115
+ ### clearSmartCharging - 关掉智能充电。
116
+
117
+ 如果当前正按窗口停充,会恢复充电。
118
+
119
+ ```python
120
+ def clearSmartCharging() -> bool
121
+ ```
122
+
123
+ **返回值:**
124
+
125
+ | 类型 | 描述 |
126
+ | ------ | ----------------- |
127
+ | `bool` | 保存成功为 `True` |
128
+
129
+ **示例:**
130
+
131
+ ```python
132
+ jbpower.clearSmartCharging()
133
+ ```
@@ -157,7 +157,9 @@ xml = selector.xml()
157
157
  | --- | --- |
158
158
  | 文本 | `label` / `labelMatch`、`title` / `titleMatch`、`identifier` / `identifierMatch`、`value` / `valueMatch`、`placeholderValue` / `placeholderValueMatch` |
159
159
  | 类型状态 | `type` / `typeMatch`、`enabled` |
160
- | 结构位置 | `index`、`depth`、`childCount`(支持 `">0"`)、`bounds`、`xpath`、`id` |
160
+ | 结构位置 | `index`、`depth`、`childCount`(支持 `">0"`)、`bounds`、`xpath`(XPath 1.0)、`id` |
161
+
162
+ `xpath` 只支持 [XPath 1.0](https://www.w3.org/TR/1999/REC-xpath-19991116/)。`matches()` 等 XPath 2.0 函数不可用;属性上的正则用 `identifierMatch` 等带 `Match` 的方法。
161
163
 
162
164
  ```python
163
165
  selector.label("确定").type("XCUIElementTypeButton").getOneNodeInfo(3000)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "1.5.13",
3
+ "version": "1.5.14",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {