ms-types 0.10.10 → 0.10.12

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.
Files changed (57) hide show
  1. package/package.json +1 -1
  2. package/types/cryptoUtils.d.ts +50 -36
  3. package/types/dotocr.d.ts +9 -2
  4. package/types/file.d.ts +1 -1
  5. package/types/hid.d.ts +46 -4
  6. package/types/hotUpdate.d.ts +0 -3
  7. package/types/image.d.ts +447 -447
  8. package/types/lua/action.lua +6 -6
  9. package/types/lua/ai.lua +3 -3
  10. package/types/lua/appleocr.lua +3 -3
  11. package/types/lua/cloud.lua +1 -1
  12. package/types/lua/cryptoUtils.lua +7 -7
  13. package/types/lua/cv.lua +142 -142
  14. package/types/lua/dotocr.lua +4 -4
  15. package/types/lua/file.lua +1 -1
  16. package/types/lua/global.lua +9 -7
  17. package/types/lua/hid.lua +22 -22
  18. package/types/lua/hotupdate.lua +7 -8
  19. package/types/lua/http.lua +27 -12
  20. package/types/lua/image.lua +23 -19
  21. package/types/lua/ime.lua +9 -9
  22. package/types/lua/media.lua +9 -9
  23. package/types/lua/mysql.lua +11 -11
  24. package/types/lua/netcard.lua +6 -6
  25. package/types/lua/node.lua +1 -1
  26. package/types/lua/paddleocr.lua +3 -3
  27. package/types/lua/pip.lua +6 -6
  28. package/types/lua/system.lua +23 -23
  29. package/types/lua/tomatoocr.lua +12 -17
  30. package/types/lua/tts.lua +3 -3
  31. package/types/lua/ui.lua +5 -5
  32. package/types/lua/yolo.lua +2 -2
  33. package/types/lua/yolocls.lua +2 -2
  34. package/types/mysql.d.ts +0 -2
  35. package/types/node.d.ts +1 -0
  36. package/types/opencv.d.ts +571 -38
  37. package/types/paddleocr.d.ts +1 -0
  38. package/types/pip.d.ts +11 -0
  39. package/types/system.d.ts +1 -0
  40. package/types/tomatoocr.d.ts +3 -41
  41. package/types/tts.d.ts +1 -1
  42. package/types/ui.d.ts +2 -0
  43. package/types/web.d.ts +16 -0
  44. package/types/yolo.d.ts +1 -1
  45. package/types/yoloCls.d.ts +1 -1
  46. package/types/zh/HID/346/250/241/345/235/227.d.ts +46 -4
  47. package/types/zh/MySql/346/250/241/345/235/227.d.ts +1 -3
  48. package/types/zh/PaddleOCR/346/250/241/345/235/227.d.ts +1 -0
  49. package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +1 -1
  50. package/types/zh//345/233/276/347/211/207/346/250/241/345/235/227.d.ts +447 -447
  51. package/types/zh//346/202/254/346/265/256/347/252/227/346/250/241/345/235/227.d.ts +10 -0
  52. package/types/zh//346/226/207/344/273/266/346/250/241/345/235/227.d.ts +1 -1
  53. package/types/zh//347/202/271/351/230/265OCR/346/250/241/345/235/227.d.ts +9 -2
  54. package/types/zh//347/203/255/346/233/264/346/226/260/346/250/241/345/235/227.d.ts +0 -3
  55. package/types/zh//347/263/273/347/273/237/346/250/241/345/235/227.d.ts +1 -0
  56. package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +1 -0
  57. package/types/zh//350/247/206/345/233/276/346/250/241/345/235/227.d.ts +2 -0
@@ -154,7 +154,7 @@ local _ActionBuilder = {}
154
154
  --- 添加手指
155
155
  ---@param id integer 指针编号
156
156
  ---@return Pointer 返回指针对象
157
- ---@example builder:addPointer(id)
157
+ ---@example builder:addPointer(1)
158
158
  function _ActionBuilder:addPointer(id)
159
159
  ---@type Pointer
160
160
  local ret
@@ -166,7 +166,7 @@ end
166
166
  ---@param y integer
167
167
  ---@param duration integer|nil 按下持续时间,默认20ms
168
168
  ---@return ActionBuilder self
169
- ---@example builder:singleTap(x, y, duration)
169
+ ---@example builder:singleTap(100, 100, 50)
170
170
  function _ActionBuilder:singleTap(x, y, duration)
171
171
  ---@type ActionBuilder
172
172
  local ret
@@ -177,7 +177,7 @@ end
177
177
  ---@param points TapPoint[] 坐标数组
178
178
  ---@param duration integer|nil 按下持续时间,默认20ms
179
179
  ---@return ActionBuilder self
180
- ---@example builder:multiTap(points, duration)
180
+ ---@example builder:multiTap({ { x = 100, y = 100 }, { x = 200, y = 200 } }, 50)
181
181
  function _ActionBuilder:multiTap(points, duration)
182
182
  ---@type ActionBuilder
183
183
  local ret
@@ -197,7 +197,7 @@ local _Pointer = {}
197
197
  ---@param y integer
198
198
  ---@param duration integer|nil 持续时间
199
199
  ---@return Pointer self
200
- ---@example pointer:moveTo(x, y, duration)
200
+ ---@example pointer:moveTo(100, 100, 200)
201
201
  function _Pointer:moveTo(x, y, duration)
202
202
  ---@type Pointer
203
203
  local ret
@@ -225,7 +225,7 @@ end
225
225
  --- 停留
226
226
  ---@param duration integer 停留时间,默认20ms
227
227
  ---@return Pointer self
228
- ---@example pointer:stay(duration)
228
+ ---@example pointer:stay(100)
229
229
  function _Pointer:stay(duration)
230
230
  ---@type Pointer
231
231
  local ret
@@ -237,7 +237,7 @@ end
237
237
  ---@param y integer
238
238
  ---@param duration integer|nil 按下持续时间,默认20ms
239
239
  ---@return Pointer self
240
- ---@example pointer:tap(x, y, duration)
240
+ ---@example pointer:tap(100, 100, 50)
241
241
  function _Pointer:tap(x, y, duration)
242
242
  ---@type Pointer
243
243
  local ret
package/types/lua/ai.lua CHANGED
@@ -53,7 +53,7 @@ function _Ai.setProvider(config) return nil end
53
53
  --- 列出已登记的供应商,默认项排在最前
54
54
  ---@return AiProvider[]
55
55
  ---@example for _, p in ipairs(ai.getProviders()) do
56
- --- logi(p.name)
56
+ --- print(p.name)
57
57
  --- end
58
58
  function _Ai.getProviders() return {} end
59
59
 
@@ -96,7 +96,7 @@ function _Ai.judge(question, options) return false end
96
96
  ---@param options AiOptions|nil 同 ask,另支持 schema
97
97
  ---@return table|nil 解析后的对象或数组;没有合法 JSON 或请求失败返回 null
98
98
  ---@example local d = ai.extract("提取验证码", { image = "screen", x = 100, y = 800, ex = 600, ey = 900, schema = { code = "string" } })
99
- --- if d then logi(d.code) end
99
+ --- if d then print(d.code) end
100
100
  function _Ai.extract(prompt, options) return nil end
101
101
 
102
102
  --- 多轮对话:自己维护完整消息数组,每次整表传入。失败返回 nil,不要把空回复推进历史。
@@ -114,7 +114,7 @@ function _Ai.parseJson(text) return nil end
114
114
 
115
115
  --- 最近一次调用失败的原因;上一次调用成功时返回 nil
116
116
  ---@return string|nil 错误文案;上一次调用成功时返回 null
117
- ---@example if ai.ask("你好") == nil then loge(ai.lastError()) end
117
+ ---@example if ai.ask("你好") == nil then print(ai.lastError()) end
118
118
  function _Ai.lastError() return nil end
119
119
 
120
120
  ---@type Ai
@@ -25,7 +25,7 @@ local _AppleOCR = {}
25
25
  ---@return AppleOCRResult[] 识别结果数组,坐标为原图/全屏绝对坐标
26
26
  ---@example local results = appleocr.recognizeAbs("screen", 100, 100, 500, 300)
27
27
  --- if #results > 0 then
28
- --- action.click(results[0].centerX, results[0].centerY)
28
+ --- action.click(results[1].centerX, results[1].centerY)
29
29
  --- end
30
30
  function _AppleOCR.recognizeAbs(input, x, y, ex, ey, langs)
31
31
  ---@type AppleOCRResult[]
@@ -42,7 +42,7 @@ end
42
42
  ---@return AppleOCRResult[] 识别结果数组,坐标为原图/全屏绝对坐标
43
43
  ---@example local results = appleocr.recognizeNumbersAbs("screen", 100, 100, 500, 300)
44
44
  --- if #results > 0 then
45
- --- action.click(results[0].centerX, results[0].centerY)
45
+ --- action.click(results[1].centerX, results[1].centerY)
46
46
  --- end
47
47
  function _AppleOCR.recognizeNumbersAbs(input, x, y, ex, ey)
48
48
  ---@type AppleOCRResult[]
@@ -62,7 +62,7 @@ end
62
62
  ---@return AppleOCRResult[] 命中子串的识别结果数组,坐标为原图/全屏绝对坐标
63
63
  ---@example local results = appleocr.findTextAbs("screen", {"开始"}, 100, 100, 500, 400)
64
64
  --- if #results > 0 then
65
- --- action.click(results[0].centerX, results[0].centerY)
65
+ --- action.click(results[1].centerX, results[1].centerY)
66
66
  --- end
67
67
  function _AppleOCR.findTextAbs(input, targets, x, y, ex, ey, langs, exactMatch)
68
68
  ---@type AppleOCRResult[]
@@ -37,7 +37,7 @@ function _Cloud.report(event, data) return false end
37
37
  --- 监听服务端下发的 scriptEvent 事件(仅主线程调用,不能在线程脚本中调用)。
38
38
  ---@param callback fun(event: string, data: table<string, any>)|nil 主脚本回调函数;传入 null 可取消监听。
39
39
  ---@example cloud.onEvent(function(event, data)
40
- --- logi("server event:", event, data)
40
+ --- print("server event:", event, data)
41
41
  --- end)
42
42
  function _Cloud.onEvent(callback) end
43
43
 
@@ -8,7 +8,7 @@ local _CryptoUtils = {}
8
8
  ---@param aesKey string AES密钥 支持16位、24位、32位字符串
9
9
  ---@param noPadding boolean 是否禁用填充,默认为false, 默认使用PKCS7填充
10
10
  ---@return string 加密后的数据
11
- ---@example cryptoUtils.encryptWithAES_ECB(data, aesKey, noPadding)
11
+ ---@example cryptoUtils.encryptWithAES_ECB("hello", "1234567890123456", false)
12
12
  function _CryptoUtils.encryptWithAES_ECB(data, aesKey, noPadding) return "" end
13
13
 
14
14
  --- 使用AES ECB模式解密数据 默认使用PKCS7填充
@@ -16,39 +16,39 @@ function _CryptoUtils.encryptWithAES_ECB(data, aesKey, noPadding) return "" end
16
16
  ---@param aesKey string AES密钥 支持16位、24位、32位字符串
17
17
  ---@param noPadding boolean 是否禁用填充,默认为false, 默认使用PKCS7填充
18
18
  ---@return string 解密后的数据
19
- ---@example cryptoUtils.decryptWithAES_ECB(data, aesKey, noPadding)
19
+ ---@example cryptoUtils.decryptWithAES_ECB("BASE64_CIPHER", "1234567890123456", false)
20
20
  function _CryptoUtils.decryptWithAES_ECB(data, aesKey, noPadding) return "" end
21
21
 
22
22
  --- 使用RSA公钥加密数据 默认使用PKCS1填充
23
23
  ---@param data string 要加密的数据
24
24
  ---@param publicKeyBase64 string RSA公钥
25
25
  ---@return string 加密后的数据
26
- ---@example cryptoUtils.encryptWithRSA(data, publicKeyBase64)
26
+ ---@example cryptoUtils.encryptWithRSA("hello", "BASE64_PUBLIC_KEY")
27
27
  function _CryptoUtils.encryptWithRSA(data, publicKeyBase64) return "" end
28
28
 
29
29
  --- 使用RSA私钥解密数据 默认使用PKCS1填充
30
30
  ---@param encryptedData string 要解密的数据
31
31
  ---@param privateKeyBase64 string RSA私钥
32
32
  ---@return string 解密后的数据
33
- ---@example cryptoUtils.decryptWithRSA(encryptedData, privateKeyBase64)
33
+ ---@example cryptoUtils.decryptWithRSA("BASE64_CIPHER", "BASE64_PRIVATE_KEY")
34
34
  function _CryptoUtils.decryptWithRSA(encryptedData, privateKeyBase64) return "" end
35
35
 
36
36
  --- 计算MD5值
37
37
  ---@param data string 要计算MD5的值
38
38
  ---@return string MD5值
39
- ---@example cryptoUtils.md5(data)
39
+ ---@example cryptoUtils.md5("hello")
40
40
  function _CryptoUtils.md5(data) return "" end
41
41
 
42
42
  --- 计算SHA1值
43
43
  ---@param data string 要计算SHA1的值
44
44
  ---@return string SHA1值
45
- ---@example cryptoUtils.sha1(data)
45
+ ---@example cryptoUtils.sha1("hello")
46
46
  function _CryptoUtils.sha1(data) return "" end
47
47
 
48
48
  --- 计算SHA256值
49
49
  ---@param data string 要计算SHA256的值
50
50
  ---@return string SHA256值
51
- ---@example cryptoUtils.sha256(data)
51
+ ---@example cryptoUtils.sha256("hello")
52
52
  function _CryptoUtils.sha256(data) return "" end
53
53
 
54
54
  ---@type CryptoUtils