ms-vite-plugin 1.4.21 → 1.4.24
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/dist/build.js +10 -1
- package/docs/apipython/appleocr.md +3 -3
- package/docs/apipython/device.md +9 -5
- package/docs/apipython/g.md +10 -8
- package/docs/apipython/hid.md +10 -3
- package/docs/apipython/hotUpdate.md +9 -6
- package/docs/apipython/image.md +3 -2
- package/docs/apipython/mysql.md +6 -5
- package/docs/apipython/netCard.md +3 -2
- package/docs/apipython/paddleocr.md +2 -2
- package/docs/apipython/system.md +9 -3
- package/docs/apipython/tomatoocr.md +2 -2
- package/docs/apipython/tts.md +3 -3
- package/docs/apipython/yolo.md +3 -3
- package/docs/apipython/yolocls.md +4 -3
- package/docs/httpapi/api.md +4 -4
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -202,6 +202,8 @@ const buildAll = async (isDev = true, workspacePath) => {
|
|
|
202
202
|
emptyOutDir: false, // 不要每次清空输出目录
|
|
203
203
|
sourcemap: isDev,
|
|
204
204
|
minify: !isDev, // 开发环境不压缩变量名
|
|
205
|
+
// 目标 JSC 最低兼容 iOS 15,钉死语法降级基线(不超纲到 iOS 15 不支持的语法)
|
|
206
|
+
target: "safari15",
|
|
205
207
|
},
|
|
206
208
|
plugins: [
|
|
207
209
|
(0, stopGuardPlugin_1.createStopGuardPlugin)(),
|
|
@@ -211,7 +213,14 @@ const buildAll = async (isDev = true, workspacePath) => {
|
|
|
211
213
|
(0, vite_plugin_bundle_obfuscator_1.default)({
|
|
212
214
|
autoExcludeNodeModules: true,
|
|
213
215
|
threadPool: true,
|
|
214
|
-
options:
|
|
216
|
+
options: {
|
|
217
|
+
...obfuscatorConfig,
|
|
218
|
+
target: "browser",
|
|
219
|
+
debugProtection: false,
|
|
220
|
+
disableConsoleOutput: false,
|
|
221
|
+
domainLock: [],
|
|
222
|
+
selfDefending: false,
|
|
223
|
+
},
|
|
215
224
|
}),
|
|
216
225
|
]),
|
|
217
226
|
],
|
|
@@ -28,12 +28,12 @@ AppleOCR 模块基于 Apple Vision 框架,提供原生的光学字符识别(
|
|
|
28
28
|
|
|
29
29
|
### OCRResult
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
识别结果对象,包含以下字段:
|
|
32
32
|
|
|
33
33
|
```python
|
|
34
|
-
from
|
|
34
|
+
from kuaijs._types import KuaiJSNamespace
|
|
35
35
|
|
|
36
|
-
class OCRResult(
|
|
36
|
+
class OCRResult(KuaiJSNamespace):
|
|
37
37
|
text: str # 识别的文本内容
|
|
38
38
|
confidence: float # 识别置信度 (0-1)
|
|
39
39
|
x: int # 文本区域左上角 x 坐标
|
package/docs/apipython/device.md
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
### getBatteryInfo - 获取设备的电池信息。
|
|
8
8
|
|
|
9
9
|
```python
|
|
10
|
-
from typing import
|
|
10
|
+
from typing import Literal
|
|
11
|
+
from kuaijs._types import KuaiJSNamespace
|
|
11
12
|
|
|
12
|
-
class BatteryInfo(
|
|
13
|
+
class BatteryInfo(KuaiJSNamespace):
|
|
13
14
|
level: int # 电池电量(0-100)
|
|
14
15
|
isCharging: bool # 是否正在充电
|
|
15
16
|
|
|
@@ -38,9 +39,10 @@ if info.level < 20:
|
|
|
38
39
|
### getStorageSpace - 获取设备存储空间信息。
|
|
39
40
|
|
|
40
41
|
```python
|
|
41
|
-
from typing import
|
|
42
|
+
from typing import Literal
|
|
43
|
+
from kuaijs._types import KuaiJSNamespace
|
|
42
44
|
|
|
43
|
-
class StorageSpaceInfo(
|
|
45
|
+
class StorageSpaceInfo(KuaiJSNamespace):
|
|
44
46
|
total: float # 总存储空间(GB,十进制)
|
|
45
47
|
free: float # 剩余存储空间(GB,十进制)
|
|
46
48
|
unit: Literal["GB"] # 单位,固定 GB
|
|
@@ -198,7 +200,9 @@ print(device.getDeviceModel())
|
|
|
198
200
|
- 返回尺寸为设备分辨率除以缩放比例计算结果;仅返回竖屏分辨率
|
|
199
201
|
|
|
200
202
|
```python
|
|
201
|
-
|
|
203
|
+
from kuaijs._types import KuaiJSNamespace
|
|
204
|
+
|
|
205
|
+
class ScreenSize(KuaiJSNamespace):
|
|
202
206
|
width: float # 屏幕宽度(像素)
|
|
203
207
|
height: float # 屏幕高度(像素)
|
|
204
208
|
|
package/docs/apipython/g.md
CHANGED
|
@@ -158,7 +158,7 @@ if g.getCpuAutoThrottle():
|
|
|
158
158
|
设置 CPU 限流单次 sleep 延迟范围(毫秒)。默认 `min_ms=3`、`max_ms=30`。仅在 CPU 自动限流开启且触发限流时生效。
|
|
159
159
|
|
|
160
160
|
```python
|
|
161
|
-
def setCpuThrottleDelay(min_ms: int, max_ms: int) ->
|
|
161
|
+
def setCpuThrottleDelay(min_ms: int, max_ms: int) -> CpuThrottleDelay
|
|
162
162
|
```
|
|
163
163
|
|
|
164
164
|
**参数:**
|
|
@@ -170,9 +170,10 @@ def setCpuThrottleDelay(min_ms: int, max_ms: int) -> dict
|
|
|
170
170
|
|
|
171
171
|
**返回值:**
|
|
172
172
|
|
|
173
|
-
| 类型
|
|
174
|
-
|
|
|
175
|
-
| `
|
|
173
|
+
| 字段名 | 类型 | 描述 |
|
|
174
|
+
| ------- | ----- | -------------- |
|
|
175
|
+
| `minMs` | `int` | 实际最低延迟 |
|
|
176
|
+
| `maxMs` | `int` | 实际最高延迟 |
|
|
176
177
|
|
|
177
178
|
**示例:**
|
|
178
179
|
|
|
@@ -188,14 +189,15 @@ print(f"CPU 限流延迟: {delay['minMs']}~{delay['maxMs']}ms")
|
|
|
188
189
|
获取 CPU 限流延迟范围(毫秒)。
|
|
189
190
|
|
|
190
191
|
```python
|
|
191
|
-
def getCpuThrottleDelay() ->
|
|
192
|
+
def getCpuThrottleDelay() -> CpuThrottleDelay
|
|
192
193
|
```
|
|
193
194
|
|
|
194
195
|
**返回值:**
|
|
195
196
|
|
|
196
|
-
| 类型
|
|
197
|
-
|
|
|
198
|
-
| `
|
|
197
|
+
| 字段名 | 类型 | 描述 |
|
|
198
|
+
| ------- | ----- | ------------ |
|
|
199
|
+
| `minMs` | `int` | 当前最低延迟 |
|
|
200
|
+
| `maxMs` | `int` | 当前最高延迟 |
|
|
199
201
|
|
|
200
202
|
**示例:**
|
|
201
203
|
|
package/docs/apipython/hid.md
CHANGED
|
@@ -1109,15 +1109,22 @@ hid.takeMeToFront()
|
|
|
1109
1109
|
获取当前打开应用的信息(仅 iOS 18.2+)。
|
|
1110
1110
|
|
|
1111
1111
|
```python
|
|
1112
|
-
|
|
1112
|
+
from typing import Optional
|
|
1113
|
+
from kuaijs._types import KuaiJSNamespace
|
|
1114
|
+
|
|
1115
|
+
class AppInfo(KuaiJSNamespace):
|
|
1116
|
+
name: str
|
|
1117
|
+
bundleId: str
|
|
1118
|
+
|
|
1119
|
+
def currentAppInfo() -> Optional[AppInfo]
|
|
1113
1120
|
```
|
|
1114
1121
|
|
|
1115
1122
|
**返回值:**
|
|
1116
1123
|
| 类型 | 描述 |
|
|
1117
1124
|
| ---- | ---- |
|
|
1118
|
-
|
|
|
1125
|
+
| AppInfo \| None | 当前应用信息或 None(如果不可用) |
|
|
1119
1126
|
|
|
1120
|
-
|
|
1127
|
+
**返回属性:**
|
|
1121
1128
|
| 属性 | 类型 | 描述 |
|
|
1122
1129
|
| ---- | ---- | ---- |
|
|
1123
1130
|
| `name` | str | 应用程序名称 |
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
服务器响应数据结构。
|
|
14
14
|
|
|
15
15
|
```python
|
|
16
|
-
from typing import
|
|
16
|
+
from typing import Optional
|
|
17
|
+
from kuaijs._types import KuaiJSNamespace
|
|
17
18
|
|
|
18
|
-
class HotUpdateResponse(
|
|
19
|
+
class HotUpdateResponse(KuaiJSNamespace):
|
|
19
20
|
download_url: str # 新包的下载地址
|
|
20
21
|
version: int # 新包的版本号
|
|
21
22
|
download_timeout: int # 下载超时时间(秒)
|
|
@@ -30,9 +31,10 @@ class HotUpdateResponse(TypedDict):
|
|
|
30
31
|
热更新检查结果。
|
|
31
32
|
|
|
32
33
|
```python
|
|
33
|
-
from typing import
|
|
34
|
+
from typing import Optional
|
|
35
|
+
from kuaijs._types import KuaiJSNamespace
|
|
34
36
|
|
|
35
|
-
class HotUpdateResult(
|
|
37
|
+
class HotUpdateResult(KuaiJSNamespace):
|
|
36
38
|
needUpdate: bool # 是否需要更新
|
|
37
39
|
error: Optional[str] # 错误信息(当检查失败时)
|
|
38
40
|
data: Optional[HotUpdateResponse] # 服务器返回的更新数据(当 needUpdate 为 True 时)
|
|
@@ -43,9 +45,10 @@ class HotUpdateResult(TypedDict):
|
|
|
43
45
|
安装结果。
|
|
44
46
|
|
|
45
47
|
```python
|
|
46
|
-
from typing import
|
|
48
|
+
from typing import Optional
|
|
49
|
+
from kuaijs._types import KuaiJSNamespace
|
|
47
50
|
|
|
48
|
-
class InstallResult(
|
|
51
|
+
class InstallResult(KuaiJSNamespace):
|
|
49
52
|
updated: bool # 是否安装成功
|
|
50
53
|
error: Optional[str] # 安装失败时的错误信息
|
|
51
54
|
```
|
package/docs/apipython/image.md
CHANGED
|
@@ -182,9 +182,10 @@ if imageId:
|
|
|
182
182
|
### getSize - 获取图片尺寸。
|
|
183
183
|
|
|
184
184
|
```python
|
|
185
|
-
from typing import
|
|
185
|
+
from typing import Optional
|
|
186
|
+
from kuaijs._types import KuaiJSNamespace
|
|
186
187
|
|
|
187
|
-
class Size(
|
|
188
|
+
class Size(KuaiJSNamespace):
|
|
188
189
|
width: int
|
|
189
190
|
height: int
|
|
190
191
|
|
package/docs/apipython/mysql.md
CHANGED
|
@@ -45,12 +45,13 @@ class MySQLConfig(TypedDict):
|
|
|
45
45
|
|
|
46
46
|
### MySQLResult
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
查询结果。
|
|
49
49
|
|
|
50
50
|
```python
|
|
51
|
-
from typing import
|
|
51
|
+
from typing import Any, Dict, List, Optional
|
|
52
|
+
from kuaijs._types import KuaiJSNamespace
|
|
52
53
|
|
|
53
|
-
class MySQLResult(
|
|
54
|
+
class MySQLResult(KuaiJSNamespace):
|
|
54
55
|
rows: List[Dict[str, Any]] # 查询结果数据行
|
|
55
56
|
affectedRows: int # 受影响的行数
|
|
56
57
|
insertId: Optional[int] # 插入ID(仅适用于INSERT操作)
|
|
@@ -60,8 +61,8 @@ class MySQLResult(TypedDict):
|
|
|
60
61
|
|
|
61
62
|
**参数说明:**
|
|
62
63
|
|
|
63
|
-
| 参数名 | 类型
|
|
64
|
-
| -------------- |
|
|
64
|
+
| 参数名 | 类型 | 描述 |
|
|
65
|
+
| -------------- | ---------------- | ------------------------------- |
|
|
65
66
|
| `rows` | List[Dict[str, Any]] | 查询结果数据行 |
|
|
66
67
|
| `affectedRows` | int | 受影响的行数 |
|
|
67
68
|
| `insertId` | int | 插入 ID(仅适用于 INSERT 操作) |
|
|
@@ -76,9 +76,10 @@ else:
|
|
|
76
76
|
#### getCardInfo - 获取卡密信息
|
|
77
77
|
|
|
78
78
|
```python
|
|
79
|
-
from typing import
|
|
79
|
+
from typing import Optional
|
|
80
|
+
from kuaijs._types import KuaiJSNamespace
|
|
80
81
|
|
|
81
|
-
class CardInfo(
|
|
82
|
+
class CardInfo(KuaiJSNamespace):
|
|
82
83
|
cardNo: str
|
|
83
84
|
batchCard: str
|
|
84
85
|
remark: str
|
|
@@ -19,9 +19,9 @@ PaddleOCR 模块基于百度飞桨 PaddleOCR 技术,提供强大的光学字
|
|
|
19
19
|
识别结果的数据结构,包含完整的文本信息和位置数据。
|
|
20
20
|
|
|
21
21
|
```python
|
|
22
|
-
from
|
|
22
|
+
from kuaijs._types import KuaiJSNamespace
|
|
23
23
|
|
|
24
|
-
class OCRResult(
|
|
24
|
+
class OCRResult(KuaiJSNamespace):
|
|
25
25
|
text: str # 识别的文本内容
|
|
26
26
|
confidence: float # 识别置信度 (0-1)
|
|
27
27
|
x: int # 文本区域左上角 x 坐标
|
package/docs/apipython/system.md
CHANGED
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
前台应用信息结构。
|
|
21
21
|
|
|
22
22
|
```python
|
|
23
|
-
|
|
23
|
+
from kuaijs._types import KuaiJSNamespace
|
|
24
|
+
|
|
25
|
+
class ActivateAppInfo(KuaiJSNamespace):
|
|
24
26
|
bundleId: str
|
|
25
27
|
name: str
|
|
26
28
|
pid: int
|
|
@@ -31,7 +33,9 @@ class ActivateAppInfo(TypedDict):
|
|
|
31
33
|
已安装应用信息结构。
|
|
32
34
|
|
|
33
35
|
```python
|
|
34
|
-
|
|
36
|
+
from kuaijs._types import KuaiJSNamespace
|
|
37
|
+
|
|
38
|
+
class InstalledAppInfo(KuaiJSNamespace):
|
|
35
39
|
bundleVersion: str
|
|
36
40
|
appName: str
|
|
37
41
|
bundleIdentifier: str
|
|
@@ -42,7 +46,9 @@ class InstalledAppInfo(TypedDict):
|
|
|
42
46
|
内存信息结构。
|
|
43
47
|
|
|
44
48
|
```python
|
|
45
|
-
|
|
49
|
+
from kuaijs._types import KuaiJSNamespace
|
|
50
|
+
|
|
51
|
+
class MemoryInfo(KuaiJSNamespace):
|
|
46
52
|
used: int # 当前应用占用(MB)
|
|
47
53
|
available: int # 系统可用内存(MB)
|
|
48
54
|
total: int # 系统总内存(MB)
|
|
@@ -20,9 +20,9 @@ TomatoOCR 模块提供基于 TomatoOCR 框架的文字识别和 YOLO 目标检
|
|
|
20
20
|
初始化结果结构。
|
|
21
21
|
|
|
22
22
|
```python
|
|
23
|
-
from
|
|
23
|
+
from kuaijs._types import KuaiJSNamespace
|
|
24
24
|
|
|
25
|
-
class TomatoInitResult(
|
|
25
|
+
class TomatoInitResult(KuaiJSNamespace):
|
|
26
26
|
deviceId: str # 设备 ID
|
|
27
27
|
expiryTime: str # 过期时间
|
|
28
28
|
message: str # 消息
|
package/docs/apipython/tts.md
CHANGED
|
@@ -6,12 +6,12 @@ TTS(文本转语音)模块提供了语音合成、播放控制等功能,
|
|
|
6
6
|
|
|
7
7
|
### VoiceInfo - 语音信息结构
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
语音信息对象。
|
|
10
10
|
|
|
11
11
|
```python
|
|
12
|
-
from
|
|
12
|
+
from kuaijs._types import KuaiJSNamespace
|
|
13
13
|
|
|
14
|
-
class VoiceInfo(
|
|
14
|
+
class VoiceInfo(KuaiJSNamespace):
|
|
15
15
|
identifier: str # 语音的唯一标识符,用于设置特定语音
|
|
16
16
|
name: str # 语音显示名称
|
|
17
17
|
language: str # 语言代码(如 "zh-CN", "en-US")
|
package/docs/apipython/yolo.md
CHANGED
|
@@ -27,12 +27,12 @@ YOLO 模块基于 YOLOV8/YOLO11/YOLO26 算法和 NCNN 框架,提供高性能
|
|
|
27
27
|
|
|
28
28
|
### YoloResult
|
|
29
29
|
|
|
30
|
-
YOLO
|
|
30
|
+
YOLO 检测结果对象,包含检测到的物体的完整信息。
|
|
31
31
|
|
|
32
32
|
```python
|
|
33
|
-
from
|
|
33
|
+
from kuaijs._types import KuaiJSNamespace
|
|
34
34
|
|
|
35
|
-
class YoloResult(
|
|
35
|
+
class YoloResult(KuaiJSNamespace):
|
|
36
36
|
x: int # 检测框的左上角x坐标
|
|
37
37
|
y: int # 检测框的左上角y坐标
|
|
38
38
|
ex: int # 检测框的右下角x坐标
|
|
@@ -20,12 +20,13 @@ YOLO 图像分类模块基于 YOLOv8-cls / YOLO11-cls / YOLO26-cls 分类模型
|
|
|
20
20
|
|
|
21
21
|
### YoloClsProbs
|
|
22
22
|
|
|
23
|
-
YOLO
|
|
23
|
+
YOLO 分类概率结果对象,字段命名与 Ultralytics `Probs` 保持一致。
|
|
24
24
|
|
|
25
25
|
```python
|
|
26
|
-
from typing import List, Optional
|
|
26
|
+
from typing import List, Optional
|
|
27
|
+
from kuaijs._types import KuaiJSNamespace
|
|
27
28
|
|
|
28
|
-
class YoloClsProbs(
|
|
29
|
+
class YoloClsProbs(KuaiJSNamespace):
|
|
29
30
|
data: List[float] # 所有类别概率,下标即类别 ID
|
|
30
31
|
top1: Optional[int] # 概率最高的类别 ID
|
|
31
32
|
top5: List[int] # 概率最高的 5 个类别 ID
|
package/docs/httpapi/api.md
CHANGED
|
@@ -770,10 +770,10 @@ GET /mirror/image
|
|
|
770
770
|
|
|
771
771
|
### 请求参数
|
|
772
772
|
|
|
773
|
-
| 名称
|
|
774
|
-
|
|
|
775
|
-
| fps
|
|
776
|
-
| quality
|
|
773
|
+
| 名称 | 位置 | 类型 | 必选 | 中文名 | 说明 |
|
|
774
|
+
| ------------- | ----- | ------- | ---- | ------ | ---------------------------- |
|
|
775
|
+
| fps | query | integer | 否 | | 帧率,默认 10,范围 1-30 |
|
|
776
|
+
| quality | query | number | 否 | | 质量,默认 0.25,范围 0.1-1.0 |
|
|
777
777
|
|
|
778
778
|
> 返回示例
|
|
779
779
|
|