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.
- package/package.json +1 -1
- package/types/cryptoUtils.d.ts +50 -36
- package/types/dotocr.d.ts +9 -2
- package/types/file.d.ts +1 -1
- package/types/hid.d.ts +46 -4
- package/types/hotUpdate.d.ts +0 -3
- package/types/image.d.ts +447 -447
- package/types/lua/action.lua +6 -6
- package/types/lua/ai.lua +3 -3
- package/types/lua/appleocr.lua +3 -3
- package/types/lua/cloud.lua +1 -1
- package/types/lua/cryptoUtils.lua +7 -7
- package/types/lua/cv.lua +142 -142
- package/types/lua/dotocr.lua +4 -4
- package/types/lua/file.lua +1 -1
- package/types/lua/global.lua +9 -7
- package/types/lua/hid.lua +22 -22
- package/types/lua/hotupdate.lua +7 -8
- package/types/lua/http.lua +27 -12
- package/types/lua/image.lua +23 -19
- package/types/lua/ime.lua +9 -9
- package/types/lua/media.lua +9 -9
- package/types/lua/mysql.lua +11 -11
- package/types/lua/netcard.lua +6 -6
- package/types/lua/node.lua +1 -1
- package/types/lua/paddleocr.lua +3 -3
- package/types/lua/pip.lua +6 -6
- package/types/lua/system.lua +23 -23
- package/types/lua/tomatoocr.lua +12 -17
- package/types/lua/tts.lua +3 -3
- package/types/lua/ui.lua +5 -5
- package/types/lua/yolo.lua +2 -2
- package/types/lua/yolocls.lua +2 -2
- package/types/mysql.d.ts +0 -2
- package/types/node.d.ts +1 -0
- package/types/opencv.d.ts +571 -38
- package/types/paddleocr.d.ts +1 -0
- package/types/pip.d.ts +11 -0
- package/types/system.d.ts +1 -0
- package/types/tomatoocr.d.ts +3 -41
- package/types/tts.d.ts +1 -1
- package/types/ui.d.ts +2 -0
- package/types/web.d.ts +16 -0
- package/types/yolo.d.ts +1 -1
- package/types/yoloCls.d.ts +1 -1
- package/types/zh/HID/346/250/241/345/235/227.d.ts +46 -4
- package/types/zh/MySql/346/250/241/345/235/227.d.ts +1 -3
- package/types/zh/PaddleOCR/346/250/241/345/235/227.d.ts +1 -0
- package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +1 -1
- package/types/zh//345/233/276/347/211/207/346/250/241/345/235/227.d.ts +447 -447
- package/types/zh//346/202/254/346/265/256/347/252/227/346/250/241/345/235/227.d.ts +10 -0
- package/types/zh//346/226/207/344/273/266/346/250/241/345/235/227.d.ts +1 -1
- package/types/zh//347/202/271/351/230/265OCR/346/250/241/345/235/227.d.ts +9 -2
- package/types/zh//347/203/255/346/233/264/346/226/260/346/250/241/345/235/227.d.ts +0 -3
- package/types/zh//347/263/273/347/273/237/346/250/241/345/235/227.d.ts +1 -0
- package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +1 -0
- package/types/zh//350/247/206/345/233/276/346/250/241/345/235/227.d.ts +2 -0
package/types/lua/action.lua
CHANGED
|
@@ -154,7 +154,7 @@ local _ActionBuilder = {}
|
|
|
154
154
|
--- 添加手指
|
|
155
155
|
---@param id integer 指针编号
|
|
156
156
|
---@return Pointer 返回指针对象
|
|
157
|
-
---@example builder:addPointer(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
-
---
|
|
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
|
|
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
|
|
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
|
package/types/lua/appleocr.lua
CHANGED
|
@@ -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[
|
|
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[
|
|
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[
|
|
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[]
|
package/types/lua/cloud.lua
CHANGED
|
@@ -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
|
-
---
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
51
|
+
---@example cryptoUtils.sha256("hello")
|
|
52
52
|
function _CryptoUtils.sha256(data) return "" end
|
|
53
53
|
|
|
54
54
|
---@type CryptoUtils
|