ms-vite-plugin 1.4.20 → 1.4.22

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.
@@ -12,57 +12,53 @@
12
12
 
13
13
  ## API 参考
14
14
 
15
- ### 配置读取
16
-
17
- #### get - 读取配置项的值。
15
+ ### all - 获取所有配置的 JSON 格式数据。
18
16
 
19
17
  ```typescript
20
- function get(key: string): any | null;
18
+ function all(): Record<string, any>;
21
19
  ```
22
20
 
23
- **参数:**
24
-
25
- | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
26
- | ------ | ------ | -------- | ------ | -------- |
27
- | `key` | string | 是 | - | 配置键名 |
28
-
29
21
  **返回值:**
30
22
 
31
- | 类型 | 描述 |
32
- | ------------- | ------ |
33
- | `any \| null` | 配置值 |
23
+ | 类型 | 描述 |
24
+ | --------------------- | ------------------ |
25
+ | `Record<string, any>` | 包含所有配置的对象 |
34
26
 
35
27
  **示例:**
36
28
 
37
29
  ```javascript
38
- const maxRetries = config.get("maxRetries");
39
- if (maxRetries !== null) {
40
- logi(`最大重试次数: ${maxRetries}`);
41
- }
30
+ const allConfigs = config.all();
31
+ logi(`所有配置: ${JSON.stringify(allConfigs, null, 2)}`);
42
32
  ```
43
33
 
44
- ### 配置管理
45
-
46
- #### all - 获取所有配置的 JSON 格式数据。
34
+ ### setAll - 设置所有配置项。
47
35
 
48
36
  ```typescript
49
- function all(): Record<string, any>;
37
+ function setAll(config: Record<string, any>): boolean;
50
38
  ```
51
39
 
40
+ **参数:**
41
+
42
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
43
+ | -------- | --------------------- | -------- | ------ | ---------------- |
44
+ | `config` | `Record<string, any>` | 是 | - | 完整配置对象 |
45
+
52
46
  **返回值:**
53
47
 
54
- | 类型 | 描述 |
55
- | --------------------- | ------------------ |
56
- | `Record<string, any>` | 包含所有配置的对象 |
48
+ | 类型 | 描述 |
49
+ | --------- | ------------ |
50
+ | `boolean` | 设置是否成功 |
57
51
 
58
52
  **示例:**
59
53
 
60
54
  ```javascript
61
- const allConfigs = config.all();
62
- logi(`所有配置: ${JSON.stringify(allConfigs, null, 2)}`);
55
+ const success = config.setAll({ maxRetries: 5, debugEnabled: true });
56
+ if (success) {
57
+ logi("所有配置已更新");
58
+ }
63
59
  ```
64
60
 
65
- #### set - 更新或设置配置项的值。
61
+ ### set - 更新或设置配置项的值。
66
62
 
67
63
  ```typescript
68
64
  function set(key: string, value: any): boolean;
@@ -94,7 +90,53 @@ if (success1 && success2 && success3) {
94
90
  }
95
91
  ```
96
92
 
97
- #### remove - 删除指定的配置项。
93
+ ### get - 读取配置项的值。
94
+
95
+ ```typescript
96
+ function get(key: string): any | null;
97
+ ```
98
+
99
+ **参数:**
100
+
101
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
102
+ | ------ | ------ | -------- | ------ | -------- |
103
+ | `key` | string | 是 | - | 配置键名 |
104
+
105
+ **返回值:**
106
+
107
+ | 类型 | 描述 |
108
+ | ------------- | ------ |
109
+ | `any \| null` | 配置值 |
110
+
111
+ **示例:**
112
+
113
+ ```javascript
114
+ const maxRetries = config.get("maxRetries");
115
+ if (maxRetries !== null) {
116
+ logi(`最大重试次数: ${maxRetries}`);
117
+ }
118
+ ```
119
+
120
+ ### getKuiConfig - 获取 KUI 的配置。
121
+
122
+ ```typescript
123
+ function getKuiConfig(): Record<string, any>;
124
+ ```
125
+
126
+ **返回值:**
127
+
128
+ | 类型 | 描述 |
129
+ | --------------------- | -------------------------------------------------------- |
130
+ | `Record<string, any>` | `KUI_CONFIG` 对应的对象,配置不存在或无法转换时返回空对象 |
131
+
132
+ **示例:**
133
+
134
+ ```javascript
135
+ const kuiConfig = config.getKuiConfig();
136
+ logi(`KUI 配置: ${JSON.stringify(kuiConfig, null, 2)}`);
137
+ ```
138
+
139
+ ### remove - 删除指定的配置项。
98
140
 
99
141
  ```typescript
100
142
  function remove(key: string): boolean;
@@ -12,55 +12,53 @@
12
12
 
13
13
  ## API 参考
14
14
 
15
- ### 配置读取
16
-
17
- #### 获取
15
+ ### 所有配置
18
16
 
19
17
  ```typescript
20
- function 获取(配置键: 字符串): 任意类型 | null;
18
+ function 所有配置(): 字典<任意类型>;
21
19
  ```
22
20
 
23
- **参数:**
24
-
25
- | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
26
- | -------- | ------ | -------- | ------ | -------- |
27
- | `配置键` | 字符串 | 是 | - | 配置键名 |
28
-
29
21
  **返回值:**
30
22
 
31
- | 类型 | 描述 |
32
- | ------------------ | ------ |
33
- | `任意类型 \| null` | 配置值 |
23
+ | 类型 | 描述 |
24
+ | ---------------- | ------------------ |
25
+ | `字典<任意类型>` | 包含所有配置的对象 |
34
26
 
35
27
  **示例:**
36
28
 
37
29
  ```javascript
38
- const maxRetries = $配置.获取("maxRetries");
39
- $打印信息日志(`最大重试次数: ${maxRetries}`);
30
+ const allConfigs = $配置.所有配置();
31
+ $打印信息日志(`所有配置: ${JSON.stringify(allConfigs, null, 2)}`);
40
32
  ```
41
33
 
42
- ### 配置管理
43
-
44
- #### 所有配置
34
+ ### 设置所有
45
35
 
46
36
  ```typescript
47
- function 所有配置(): 字典<任意类型>;
37
+ function 设置所有(config: 字典<任意类型>): 布尔值;
48
38
  ```
49
39
 
40
+ **参数:**
41
+
42
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
43
+ | -------- | ---------------- | -------- | ------ | ------------ |
44
+ | `config` | 字典<任意类型> | 是 | - | 完整配置对象 |
45
+
50
46
  **返回值:**
51
47
 
52
- | 类型 | 描述 |
53
- | ---------------- | ------------------ |
54
- | `字典<任意类型>` | 包含所有配置的对象 |
48
+ | 类型 | 描述 |
49
+ | -------- | ------------ |
50
+ | `布尔值` | 设置是否成功 |
55
51
 
56
52
  **示例:**
57
53
 
58
54
  ```javascript
59
- const allConfigs = $配置.所有配置();
60
- $打印信息日志(`所有配置: ${JSON.stringify(allConfigs, null, 2)}`);
55
+ const 是否设置成功 = $配置.设置所有({ maxRetries: 5, debugEnabled: true });
56
+ if (是否设置成功) {
57
+ $打印信息日志("所有配置已更新");
58
+ }
61
59
  ```
62
60
 
63
- #### 设置
61
+ ### 设置
64
62
 
65
63
  ```typescript
66
64
  function 设置(配置键: 字符串, 配置值: 任意类型): 布尔值;
@@ -92,7 +90,51 @@ if (是否更新成功1 && 是否更新成功2 && 是否更新成功3) {
92
90
  }
93
91
  ```
94
92
 
95
- #### 删除
93
+ ### 获取
94
+
95
+ ```typescript
96
+ function 获取(配置键: 字符串): 任意类型 | null;
97
+ ```
98
+
99
+ **参数:**
100
+
101
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
102
+ | -------- | ------ | -------- | ------ | -------- |
103
+ | `配置键` | 字符串 | 是 | - | 配置键名 |
104
+
105
+ **返回值:**
106
+
107
+ | 类型 | 描述 |
108
+ | ------------------ | ------ |
109
+ | `任意类型 \| null` | 配置值 |
110
+
111
+ **示例:**
112
+
113
+ ```javascript
114
+ const maxRetries = $配置.获取("maxRetries");
115
+ $打印信息日志(`最大重试次数: ${maxRetries}`);
116
+ ```
117
+
118
+ ### 获取KUI配置 - 获取 KUI 的配置。
119
+
120
+ ```typescript
121
+ function 获取KUI配置(): 字典<任意类型>;
122
+ ```
123
+
124
+ **返回值:**
125
+
126
+ | 类型 | 描述 |
127
+ | ---------------- | -------------------------------------------------------- |
128
+ | `字典<任意类型>` | `KUI_CONFIG` 对应的对象,配置不存在或无法转换时返回空对象 |
129
+
130
+ **示例:**
131
+
132
+ ```javascript
133
+ const kuiConfig = $配置.获取KUI配置();
134
+ $打印信息日志(`KUI 配置: ${JSON.stringify(kuiConfig, null, 2)}`);
135
+ ```
136
+
137
+ ### 删除
96
138
 
97
139
  ```typescript
98
140
  function 删除(配置键: 字符串): 布尔值;
@@ -28,12 +28,12 @@ AppleOCR 模块基于 Apple Vision 框架,提供原生的光学字符识别(
28
28
 
29
29
  ### OCRResult
30
30
 
31
- 识别结果字典,包含以下键:
31
+ 识别结果对象,包含以下字段:
32
32
 
33
33
  ```python
34
- from typing import TypedDict
34
+ from kuaijs._types import KuaiJSNamespace
35
35
 
36
- class OCRResult(TypedDict):
36
+ class OCRResult(KuaiJSNamespace):
37
37
  text: str # 识别的文本内容
38
38
  confidence: float # 识别置信度 (0-1)
39
39
  x: int # 文本区域左上角 x 坐标
@@ -12,61 +12,57 @@
12
12
 
13
13
  ## API 参考
14
14
 
15
- ### 配置读取
16
-
17
- #### get - 读取配置项的值。
15
+ ### all - 获取所有配置的 JSON 格式数据。
18
16
 
19
17
  ```python
20
- from typing import Any, Optional, Dict
18
+ from typing import Any, Dict
21
19
 
22
- def get(key: str) -> Any | None:
20
+ def all() -> Dict[str, Any]:
23
21
  ```
24
22
 
25
- **参数:**
26
-
27
- | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
28
- | ------ | ------ | -------- | ------ | -------- |
29
- | `key` | string | 是 | - | 配置键名 |
30
-
31
23
  **返回值:**
32
24
 
33
- | 类型 | 描述 |
34
- | ------------- | ------ |
35
- | `Any \| None` | 配置值 |
25
+ | 类型 | 描述 |
26
+ | ---------------- | ------------------ |
27
+ | `Dict[str, Any]` | 包含所有配置的对象 |
36
28
 
37
29
  **示例:**
38
30
 
39
31
  ```python
40
32
  from kuaijs import config
41
- maxRetries = config.get("maxRetries")
42
- if maxRetries:
43
- print(f"最大重试次数: {maxRetries}")
33
+ import json
34
+ allConfigs = config.all()
35
+ print(f"所有配置: {json.dumps(allConfigs, indent=2)}")
44
36
  ```
45
37
 
46
- ### 配置管理
47
-
48
- #### all - 获取所有配置的 JSON 格式数据。
38
+ ### setAll - 设置所有配置项。
49
39
 
50
40
  ```python
51
- def all() -> Dict[str, Any]:
41
+ def setAll(config: Dict[str, Any]) -> bool:
52
42
  ```
53
43
 
44
+ **参数:**
45
+
46
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
47
+ | -------- | ---------------- | -------- | ------ | ------------ |
48
+ | `config` | `Dict[str, Any]` | 是 | - | 完整配置字典 |
49
+
54
50
  **返回值:**
55
51
 
56
- | 类型 | 描述 |
57
- | ---------------- | ------------------ |
58
- | `Dict[str, Any]` | 包含所有配置的对象 |
52
+ | 类型 | 描述 |
53
+ | ------ | ------------ |
54
+ | `bool` | 设置是否成功 |
59
55
 
60
56
  **示例:**
61
57
 
62
58
  ```python
63
59
  from kuaijs import config
64
- import json
65
- allConfigs = config.all()
66
- print(f"所有配置: {json.dumps(allConfigs, indent=2)}")
60
+ success = config.setAll({"maxRetries": 5, "debugEnabled": True})
61
+ if success:
62
+ print("所有配置已更新")
67
63
  ```
68
64
 
69
- #### set - 更新或设置配置项的值。
65
+ ### set - 更新或设置配置项的值。
70
66
 
71
67
  ```python
72
68
  def set(key: str, value: Any) -> bool:
@@ -98,7 +94,54 @@ if success1 and success2 and success3:
98
94
  print("配置更新成功")
99
95
  ```
100
96
 
101
- #### remove - 删除指定的配置项。
97
+ ### get - 读取配置项的值。
98
+
99
+ ```python
100
+ def get(key: str) -> Any | None:
101
+ ```
102
+
103
+ **参数:**
104
+
105
+ | 参数名 | 类型 | 是否必填 | 默认值 | 描述 |
106
+ | ------ | ------ | -------- | ------ | -------- |
107
+ | `key` | string | 是 | - | 配置键名 |
108
+
109
+ **返回值:**
110
+
111
+ | 类型 | 描述 |
112
+ | ------------- | ------ |
113
+ | `Any \| None` | 配置值 |
114
+
115
+ **示例:**
116
+
117
+ ```python
118
+ from kuaijs import config
119
+ maxRetries = config.get("maxRetries")
120
+ if maxRetries:
121
+ print(f"最大重试次数: {maxRetries}")
122
+ ```
123
+
124
+ ### getKuiConfig - 获取 KUI 的配置。
125
+
126
+ ```python
127
+ def getKuiConfig() -> Dict[str, Any]:
128
+ ```
129
+
130
+ **返回值:**
131
+
132
+ | 类型 | 描述 |
133
+ | ---------------- | -------------------------------------------------------- |
134
+ | `Dict[str, Any]` | `KUI_CONFIG` 对应的字典,配置不存在或无法转换时返回空字典 |
135
+
136
+ **示例:**
137
+
138
+ ```python
139
+ from kuaijs import config
140
+ kui_config = config.getKuiConfig()
141
+ print(f"KUI 配置: {kui_config}")
142
+ ```
143
+
144
+ ### remove - 删除指定的配置项。
102
145
 
103
146
  ```python
104
147
  def remove(key: str) -> bool:
@@ -7,9 +7,10 @@
7
7
  ### getBatteryInfo - 获取设备的电池信息。
8
8
 
9
9
  ```python
10
- from typing import TypedDict, Literal
10
+ from typing import Literal
11
+ from kuaijs._types import KuaiJSNamespace
11
12
 
12
- class BatteryInfo(TypedDict):
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 TypedDict, Literal
42
+ from typing import Literal
43
+ from kuaijs._types import KuaiJSNamespace
42
44
 
43
- class StorageSpaceInfo(TypedDict):
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
- class ScreenSize(TypedDict):
203
+ from kuaijs._types import KuaiJSNamespace
204
+
205
+ class ScreenSize(KuaiJSNamespace):
202
206
  width: float # 屏幕宽度(像素)
203
207
  height: float # 屏幕高度(像素)
204
208
 
@@ -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) -> dict
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
- | `dict` | `{"minMs": int, "maxMs": int}`,实际生效的延迟范围 |
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() -> dict
192
+ def getCpuThrottleDelay() -> CpuThrottleDelay
192
193
  ```
193
194
 
194
195
  **返回值:**
195
196
 
196
- | 类型 | 描述 |
197
- | ------ | ------------------ |
198
- | `dict` | `{"minMs": int, "maxMs": int}`,当前最低与最高延迟 |
197
+ | 字段名 | 类型 | 描述 |
198
+ | ------- | ----- | ------------ |
199
+ | `minMs` | `int` | 当前最低延迟 |
200
+ | `maxMs` | `int` | 当前最高延迟 |
199
201
 
200
202
  **示例:**
201
203
 
@@ -1109,15 +1109,22 @@ hid.takeMeToFront()
1109
1109
  获取当前打开应用的信息(仅 iOS 18.2+)。
1110
1110
 
1111
1111
  ```python
1112
- def currentAppInfo() -> Optional[dict]
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
- | dict \| None | 当前应用信息或 None(如果不可用) |
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 TypedDict, Optional
16
+ from typing import Optional
17
+ from kuaijs._types import KuaiJSNamespace
17
18
 
18
- class HotUpdateResponse(TypedDict):
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 TypedDict, Optional
34
+ from typing import Optional
35
+ from kuaijs._types import KuaiJSNamespace
34
36
 
35
- class HotUpdateResult(TypedDict):
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 TypedDict, Optional
48
+ from typing import Optional
49
+ from kuaijs._types import KuaiJSNamespace
47
50
 
48
- class InstallResult(TypedDict):
51
+ class InstallResult(KuaiJSNamespace):
49
52
  updated: bool # 是否安装成功
50
53
  error: Optional[str] # 安装失败时的错误信息
51
54
  ```
@@ -182,9 +182,10 @@ if imageId:
182
182
  ### getSize - 获取图片尺寸。
183
183
 
184
184
  ```python
185
- from typing import TypedDict, Optional
185
+ from typing import Optional
186
+ from kuaijs._types import KuaiJSNamespace
186
187
 
187
- class Size(TypedDict):
188
+ class Size(KuaiJSNamespace):
188
189
  width: int
189
190
  height: int
190
191
 
@@ -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 TypedDict, List, Dict, Any, Optional
51
+ from typing import Any, Dict, List, Optional
52
+ from kuaijs._types import KuaiJSNamespace
52
53
 
53
- class MySQLResult(TypedDict):
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 TypedDict, Optional
79
+ from typing import Optional
80
+ from kuaijs._types import KuaiJSNamespace
80
81
 
81
- class CardInfo(TypedDict):
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 typing import TypedDict, List
22
+ from kuaijs._types import KuaiJSNamespace
23
23
 
24
- class OCRResult(TypedDict):
24
+ class OCRResult(KuaiJSNamespace):
25
25
  text: str # 识别的文本内容
26
26
  confidence: float # 识别置信度 (0-1)
27
27
  x: int # 文本区域左上角 x 坐标
@@ -20,7 +20,9 @@
20
20
  前台应用信息结构。
21
21
 
22
22
  ```python
23
- class ActivateAppInfo(TypedDict):
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
- class InstalledAppInfo(TypedDict):
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
- class MemoryInfo(TypedDict):
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 typing import TypedDict, Optional
23
+ from kuaijs._types import KuaiJSNamespace
24
24
 
25
- class TomatoInitResult(TypedDict):
25
+ class TomatoInitResult(KuaiJSNamespace):
26
26
  deviceId: str # 设备 ID
27
27
  expiryTime: str # 过期时间
28
28
  message: str # 消息
@@ -6,12 +6,12 @@ TTS(文本转语音)模块提供了语音合成、播放控制等功能,
6
6
 
7
7
  ### VoiceInfo - 语音信息结构
8
8
 
9
- 语音信息字典。
9
+ 语音信息对象。
10
10
 
11
11
  ```python
12
- from typing import TypedDict
12
+ from kuaijs._types import KuaiJSNamespace
13
13
 
14
- class VoiceInfo(TypedDict):
14
+ class VoiceInfo(KuaiJSNamespace):
15
15
  identifier: str # 语音的唯一标识符,用于设置特定语音
16
16
  name: str # 语音显示名称
17
17
  language: str # 语言代码(如 "zh-CN", "en-US")
@@ -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 typing import TypedDict
33
+ from kuaijs._types import KuaiJSNamespace
34
34
 
35
- class YoloResult(TypedDict):
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 分类概率结果字典,字段命名与 Ultralytics `Probs` 保持一致。
23
+ YOLO 分类概率结果对象,字段命名与 Ultralytics `Probs` 保持一致。
24
24
 
25
25
  ```python
26
- from typing import List, Optional, TypedDict
26
+ from typing import List, Optional
27
+ from kuaijs._types import KuaiJSNamespace
27
28
 
28
- class YoloClsProbs(TypedDict):
29
+ class YoloClsProbs(KuaiJSNamespace):
29
30
  data: List[float] # 所有类别概率,下标即类别 ID
30
31
  top1: Optional[int] # 概率最高的类别 ID
31
32
  top5: List[int] # 概率最高的 5 个类别 ID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "1.4.20",
3
+ "version": "1.4.22",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {