ms-types 0.9.29 → 0.9.31

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.29",
3
+ "version": "0.9.31",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/image.d.ts CHANGED
@@ -252,6 +252,9 @@ declare namespace image {
252
252
  * @param options.scaleFactors 仅 method=99 生效。模板缩放比例列表(不是屏幕 scale)。
253
253
  * 应围绕 baseScale=当前设备宽/截模板设备宽 生成,例如 baseScale 附近 ±0.05~0.1 共 3~7 档;
254
254
  * 默认 [1.0, 0.9, 1.1, 0.8, 1.2] 只适合尺寸接近时的盲扫,跨大分辨率请按设备动态计算。
255
+ * @param options.orz 查找方向 1-8,与 findColor 的 orz 相同。不传或非 1-8 时仍按相似度从高到低返回;
256
+ * 传入 1-8 时按该方向取前 limit 个达标结果。limit=1 时只返回该方向第一个,不必把其余命中都找出来。
257
+ * method 0(SIFT)会先完成匹配再按方向排序截取。
255
258
  * @returns 图片数组;method=99 时结果额外含 scaleX/scaleY
256
259
  * @example
257
260
  * const points = image.findImage("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
@@ -272,6 +275,7 @@ declare namespace image {
272
275
  rgb?: boolean,
273
276
  options?: {
274
277
  scaleFactors?: number[];
278
+ orz?: number;
275
279
  },
276
280
  ): {
277
281
  index: number;
@@ -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
@@ -129,11 +129,12 @@ function _Image.cmpColor(id, points, threshold) return true end
129
129
  --- @param ey integer|nil 右下y
130
130
  --- @param threshold number 相似度 0.0-1.0
131
131
  --- @param limit integer|nil 限制个数
132
- --- @param method integer|nil 匹配方法 1|3|5
132
+ --- @param method integer|nil 匹配方法 0|1|3|5|99
133
133
  --- @param rgb boolean|nil 是否使用RGB
134
+ --- @param options table|nil 选项。scaleFactors 仅 method=99;orz 为查找方向 1-8(与 findColor 相同)
134
135
  --- @return Rect[] 结果矩形列表
135
136
  function _Image.findImage(id, templateImageId, x, y, ex, ey, threshold, limit,
136
- method, rgb) return {} end
137
+ method, rgb, options) return {} end
137
138
 
138
139
  --- 多点找色
139
140
  --- @param id string 图片ID
@@ -202,4 +203,5 @@ function _Image.drawRect(id, x, y, ex, ey, color, thickness) end
202
203
  --- 释放所有图片
203
204
  function _Image.releaseAll() end
204
205
 
206
+ package.loaded['image'] = _Image
205
207
  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
@@ -82,4 +82,5 @@ function _Node.createNodeSelector(params)
82
82
  return ret
83
83
  end
84
84
 
85
+ package.loaded['node'] = _Node
85
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
@@ -250,6 +250,9 @@ declare namespace $图片 {
250
250
  * @param 选项.scaleFactors 仅方法=99 生效。模板缩放比例列表(不是屏幕 scale)。
251
251
  * 应围绕 baseScale=当前设备宽/截模板设备宽 生成,例如 baseScale 附近 ±0.05~0.1 共 3~7 档;
252
252
  * 默认 [1.0, 0.9, 1.1, 0.8, 1.2] 只适合尺寸接近时的盲扫,跨大分辨率请按设备动态计算。
253
+ * @param 选项.orz 查找方向 1-8,与单点找色的查找方向相同。不传或非 1-8 时仍按相似度从高到低返回;
254
+ * 传入 1-8 时按该方向取前限制数量个达标结果。限制数量=1 时只返回该方向第一个,不必把其余命中都找出来。
255
+ * 方法 0(SIFT)会先完成匹配再按方向排序截取。
253
256
  * @returns 图片数组;方法=99 时结果额外含 scaleX/scaleY
254
257
  * @example
255
258
  * const 图片数组 = $图片.找图("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
@@ -270,6 +273,7 @@ declare namespace $图片 {
270
273
  是否使用RGB找图?: 布尔值,
271
274
  选项?: {
272
275
  scaleFactors?: 数字[];
276
+ orz?: 数字;
273
277
  },
274
278
  ): {
275
279
  index: 数字;