ms-types 0.9.28 → 0.9.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.9.28",
3
+ "version": "0.9.30",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -10,4 +10,4 @@
10
10
  }
11
11
  ```
12
12
 
13
- 不要把本目录复制进脚本项目根目录。`Sleep`、`HidKey` 等裸全局会随 library 自动加载。
13
+ 不要把本目录复制进脚本项目根目录。每个模块文件用 `---@meta <require名>` 和 `package.loaded['<require名>']` 对齐运行时 `require`,例如 `require("cv")`、`require("dotocr")`、`require("yolocls")`。`Sleep`、`HidKey` 等裸全局会随 library 自动加载。
@@ -229,4 +229,5 @@ function _Action.createBuilder()
229
229
  return ret
230
230
  end
231
231
 
232
+ package.loaded['action'] = _Action
232
233
  return _Action
@@ -112,4 +112,5 @@ function _AppleOCR.findTextAbs(input, targets, x, y, ex, ey, langs, exactMatch)
112
112
  return ret
113
113
  end
114
114
 
115
+ package.loaded['appleocr'] = _AppleOCR
115
116
  return _AppleOCR
@@ -31,4 +31,5 @@ function _Config.getKuiConfig() return {} end
31
31
  ---@return boolean
32
32
  function _Config.remove(key) return true end
33
33
 
34
+ package.loaded['config'] = _Config
34
35
  return _Config
@@ -102,4 +102,5 @@ function _Device.getLanIp() return '' end
102
102
  ---@param intensity number 0.0-1.0
103
103
  function _Device.vibrate(duration, intensity) end
104
104
 
105
+ package.loaded['device'] = _Device
105
106
  return _Device
@@ -93,4 +93,5 @@ function _File.copy(src, dest) return true end
93
93
  --- @return string|nil MD5值
94
94
  function _File.fileMD5(path) return '' end
95
95
 
96
+ package.loaded['file'] = _File
96
97
  return _File
package/types/lua/hid.lua CHANGED
@@ -271,4 +271,5 @@ function _HID.currentAppInfo()
271
271
  return ret
272
272
  end
273
273
 
274
+ package.loaded['hid'] = _HID
274
275
  return _HID
@@ -20,4 +20,5 @@ function _HotUpdate.downloadAndInstall() return {updated = true, error = nil} en
20
20
  --- @return integer 版本号
21
21
  function _HotUpdate.getCurrentVersion() return 0 end
22
22
 
23
+ package.loaded['hotupdate'] = _HotUpdate
23
24
  return _HotUpdate
@@ -141,4 +141,5 @@ function _WebSocket.onBinary(fn) end
141
141
  --- @param fn fun(error:string)
142
142
  function _WebSocket.onError(fn) end
143
143
 
144
+ package.loaded['http'] = _Http
144
145
  return _Http
@@ -202,4 +202,5 @@ function _Image.drawRect(id, x, y, ex, ey, color, thickness) end
202
202
  --- 释放所有图片
203
203
  function _Image.releaseAll() end
204
204
 
205
+ package.loaded['image'] = _Image
205
206
  return _Image
package/types/lua/ime.lua CHANGED
@@ -45,4 +45,5 @@ function _Ime.getClipboard() return '' end
45
45
  --- @return boolean 成功
46
46
  function _Ime.setClipboard(text) return true end
47
47
 
48
+ package.loaded['ime'] = _Ime
48
49
  return _Ime
@@ -45,4 +45,5 @@ function _Logger.warn(...) end
45
45
  --- @return nil
46
46
  function _Logger.error(...) end
47
47
 
48
+ package.loaded['logger'] = _Logger
48
49
  return _Logger
@@ -43,4 +43,5 @@ function _Media.deleteAllVideos() return true end
43
43
  --- @return boolean 成功
44
44
  function _Media.deleteAllScreenshots() return true end
45
45
 
46
+ package.loaded['media'] = _Media
46
47
  return _Media
@@ -61,4 +61,5 @@ function _MySQL.commit() return true end
61
61
  --- @return boolean 成功
62
62
  function _MySQL.rollback() return true end
63
63
 
64
+ package.loaded['mysql'] = _MySQL
64
65
  return _MySQL
@@ -42,4 +42,5 @@ function _NetCard.setValue(key, value) return '' end
42
42
  --- @return string 值
43
43
  function _NetCard.getValue(key) return '' end
44
44
 
45
+ package.loaded['netcard'] = _NetCard
45
46
  return _NetCard
@@ -20,16 +20,23 @@ local _Node = {}
20
20
  ---@field label string 节点标签
21
21
  ---@field type string 节点类型
22
22
  ---@field value string 节点值
23
+ ---@field placeholderValue string 输入框占位文字
23
24
  ---@field title string 节点名称
24
25
  ---@field visible boolean 是否可见
25
26
  ---@field enabled boolean 是否启用
26
- ---@field accessible boolean 是否可访问
27
- ---@field selected boolean 是否选中
28
27
  ---@field bounds NodeBounds 节点边界
29
28
  ---@field depth integer 节点深度
30
29
  ---@field index integer 节点索引
31
30
  ---@field parentId string 父节点ID
32
31
  ---@field childCount integer 子节点数量
32
+ ---@field hittable fun(self: NodeInfo): boolean 当前是否可点击
33
+ ---@field tap fun(self: NodeInfo): boolean 单击
34
+ ---@field doubleTap fun(self: NodeInfo): boolean 双击
35
+ ---@field press fun(self: NodeInfo, duration: integer|nil): boolean 长按,默认 500ms
36
+ ---@field scrollToVisible fun(self: NodeInfo): boolean 滚到可见
37
+ ---@field clearInput fun(self: NodeInfo): boolean 清空输入
38
+ ---@field input fun(self: NodeInfo, text: string): boolean 追加输入
39
+ ---@field setValue fun(self: NodeInfo, text: string): boolean 设置值
33
40
  ---@field clickCenter fun(self: NodeInfo, duration: integer|nil): boolean 点击中心
34
41
  ---@field clickRandom fun(self: NodeInfo, duration: integer|nil): boolean 点击随机位置
35
42
  ---@field parent fun(self: NodeInfo): NodeInfo|nil 父节点
@@ -52,6 +59,9 @@ local _Node = {}
52
59
  ---@field titleMatch fun(self: NodeSelector, match: string): NodeSelector 设置名称匹配
53
60
  ---@field identifier fun(self: NodeSelector, identifier: string): NodeSelector 设置标识符
54
61
  ---@field identifierMatch fun(self: NodeSelector, match: string): NodeSelector 设置标识符匹配
62
+ ---@field id fun(self: NodeSelector, id: string): NodeSelector 按节点 ID 筛选
63
+ ---@field placeholderValue fun(self: NodeSelector, placeholderValue: string): NodeSelector 按占位文字筛选
64
+ ---@field placeholderValueMatch fun(self: NodeSelector, match: string): NodeSelector 按占位文字匹配筛选
55
65
  ---@field type fun(self: NodeSelector, typetitle: string): NodeSelector 设置类型
56
66
  ---@field typeMatch fun(self: NodeSelector, match: string): NodeSelector 设置类型匹配
57
67
  ---@field value fun(self: NodeSelector, value: string): NodeSelector 设置值
@@ -72,4 +82,5 @@ function _Node.createNodeSelector(params)
72
82
  return ret
73
83
  end
74
84
 
85
+ package.loaded['node'] = _Node
75
86
  return _Node
@@ -96,4 +96,5 @@ end
96
96
  --- 释放资源
97
97
  function _PaddleOCR.free() end
98
98
 
99
+ package.loaded['paddleocr'] = _PaddleOCR
99
100
  return _PaddleOCR
package/types/lua/pip.lua CHANGED
@@ -53,4 +53,5 @@ function _Pip.setCustomTextSize(fontSize) return true end
53
53
  ---@return boolean
54
54
  function _Pip.setCustomBackgroundColor(color) return true end
55
55
 
56
+ package.loaded['pip'] = _Pip
56
57
  return _Pip
@@ -136,4 +136,5 @@ function _System.getAgentStatus() return false end
136
136
  --- @return boolean 成功
137
137
  function _System.stopAgent() return true end
138
138
 
139
+ package.loaded['system'] = _System
139
140
  return _System
@@ -80,4 +80,5 @@ function _TomatoOCR.findTapPoints(js) return '' end
80
80
  --- 释放已加载的 OCR 模型和内部资源
81
81
  function _TomatoOCR.release() end
82
82
 
83
+ package.loaded['tomatoocr'] = _TomatoOCR
83
84
  return _TomatoOCR
package/types/lua/tts.lua CHANGED
@@ -39,4 +39,5 @@ function _TTS.getAvailableVoices() return {} end
39
39
  --- 释放 TTS 资源
40
40
  function _TTS.free() end
41
41
 
42
+ package.loaded['tts'] = _TTS
42
43
  return _TTS
package/types/lua/ui.lua CHANGED
@@ -43,4 +43,5 @@ function _UI.call(key, data) end
43
43
  --- @param code string 代码
44
44
  function _UI.eval(code) end
45
45
 
46
+ package.loaded['ui'] = _UI
46
47
  return _UI
@@ -46,4 +46,5 @@ function _Utils.hexStringBase64Encoded(hexString) return '' end
46
46
  --- @return string hex
47
47
  function _Utils.hexStringBase64Decoded(base64HexString) return '' end
48
48
 
49
+ package.loaded['utils'] = _Utils
49
50
  return _Utils
@@ -60,4 +60,5 @@ function _Yolo.free(id) end
60
60
  --- 释放全部模型
61
61
  function _Yolo.freeAll() end
62
62
 
63
+ package.loaded['yolo'] = _Yolo
63
64
  return _Yolo