ms-types 0.9.33 → 0.9.34

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.33",
3
+ "version": "0.9.34",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -10,4 +10,4 @@
10
10
  }
11
11
  ```
12
12
 
13
- 不要把本目录复制进脚本项目根目录。每个模块文件用 `---@meta <require名>` 和 `package.loaded['<require名>']` 对齐运行时 `require`,例如 `require("cv")`、`require("dotocr")`、`require("yolocls")`。`Sleep`、`HidKey`、`logd` / `logi` / `logw` / `loge` 等裸全局会随 library 自动加载。
13
+ 不要把本目录复制进脚本项目根目录。每个模块文件声明对应的全局表(如 `device`、`cv`、`dotocr`),不要 `require` 宿主模块。`Sleep`、`HidKey`、`logd` / `logi` / `logw` / `loge` 等裸全局会随 library 自动加载。用户自己的 `scripts/foo.lua` 仍用 `require("foo")`。
@@ -1,4 +1,4 @@
1
- ---@meta action
1
+ ---@meta
2
2
  ---@class Action
3
3
  local _Action = {}
4
4
 
@@ -229,5 +229,5 @@ function _Action.createBuilder()
229
229
  return ret
230
230
  end
231
231
 
232
- package.loaded['action'] = _Action
233
- return _Action
232
+ ---@type Action
233
+ action = _Action
@@ -1,4 +1,4 @@
1
- ---@meta appleocr
1
+ ---@meta
2
2
  ---@class AppleOCR
3
3
  local _AppleOCR = {}
4
4
 
@@ -115,5 +115,5 @@ function _AppleOCR.findTextAbs(input, targets, x, y, ex, ey, langs, exactMatch)
115
115
  return ret
116
116
  end
117
117
 
118
- package.loaded['appleocr'] = _AppleOCR
119
- return _AppleOCR
118
+ ---@type AppleOCR
119
+ appleocr = _AppleOCR
@@ -1,4 +1,4 @@
1
- ---@meta cloud
1
+ ---@meta
2
2
  ---@class Cloud
3
3
  local _Cloud = {}
4
4
 
@@ -28,5 +28,5 @@ function _Cloud.report(event, data) return false end
28
28
  ---@param callback fun(event:string, data:table)|nil
29
29
  function _Cloud.onEvent(callback) end
30
30
 
31
- package.loaded['cloud'] = _Cloud
32
- return _Cloud
31
+ ---@type Cloud
32
+ cloud = _Cloud
@@ -1,4 +1,4 @@
1
- ---@meta config
1
+ ---@meta
2
2
  ---@class Config
3
3
  local _Config = {}
4
4
 
@@ -31,5 +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
35
- return _Config
34
+ ---@type Config
35
+ config = _Config
@@ -1,4 +1,4 @@
1
- ---@meta cryptoUtils
1
+ ---@meta
2
2
  ---@class CryptoUtils
3
3
  local _CryptoUtils = {}
4
4
 
@@ -43,5 +43,5 @@ function _CryptoUtils.sha1(data) return "" end
43
43
  ---@return string
44
44
  function _CryptoUtils.sha256(data) return "" end
45
45
 
46
- package.loaded['cryptoUtils'] = _CryptoUtils
47
- return _CryptoUtils
46
+ ---@type CryptoUtils
47
+ cryptoUtils = _CryptoUtils
package/types/lua/cv.lua CHANGED
@@ -1,8 +1,8 @@
1
- ---@meta cv
1
+ ---@meta
2
2
  ---@class OpenCV
3
3
  local _OpenCV = {}
4
4
 
5
- --- OpenCV Mat 句柄模块;require("cv")。方法与常量对齐 JS `cv` 运行时导出。
5
+ --- OpenCV Mat 句柄模块;全局 `cv`。方法与常量对齐 JS `cv` 运行时导出。
6
6
 
7
7
  --- absdiff
8
8
  ---@param ... any
@@ -724,5 +724,5 @@ function _OpenCV.warpPerspective(...) return nil end
724
724
  ---@return any
725
725
  function _OpenCV.zeros(...) return nil end
726
726
 
727
- package.loaded['cv'] = _OpenCV
728
- return _OpenCV
727
+ ---@type OpenCV
728
+ cv = _OpenCV
@@ -1,4 +1,4 @@
1
- ---@meta device
1
+ ---@meta
2
2
  ---@class Device
3
3
  local _Device = {}
4
4
 
@@ -102,5 +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
106
- return _Device
105
+ ---@type Device
106
+ device = _Device
@@ -1,8 +1,8 @@
1
- ---@meta dotocr
1
+ ---@meta
2
2
  ---@class DotOCR
3
3
  local _DotOCR = {}
4
4
 
5
- --- 点阵 OCR;require("dotocr")
5
+ --- 点阵 OCR;全局 `dotocr`
6
6
 
7
7
  --- loadFont
8
8
  ---@param fontPath string
@@ -41,5 +41,5 @@ function _DotOCR.recognizeAbs(fontId, input, x, y, ex, ey, confidenceThreshold)
41
41
  ---@return table[]
42
42
  function _DotOCR.findTextAbs(fontId, input, targetTexts, x, y, ex, ey, confidenceThreshold, exactMatch) return {} end
43
43
 
44
- package.loaded['dotocr'] = _DotOCR
45
- return _DotOCR
44
+ ---@type DotOCR
45
+ dotocr = _DotOCR
@@ -1,4 +1,4 @@
1
- ---@meta file
1
+ ---@meta
2
2
  ---@class File
3
3
  local _File = {}
4
4
 
@@ -93,5 +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
97
- return _File
96
+ ---@type File
97
+ file = _File
package/types/lua/hid.lua CHANGED
@@ -1,4 +1,4 @@
1
- ---@meta hid
1
+ ---@meta
2
2
  ---@type table<string, integer>
3
3
  HidKey = {
4
4
  COMMAND = 0x83,
@@ -271,5 +271,5 @@ function _HID.currentAppInfo()
271
271
  return ret
272
272
  end
273
273
 
274
- package.loaded['hid'] = _HID
275
- return _HID
274
+ ---@type HID
275
+ hid = _HID
@@ -1,4 +1,4 @@
1
- ---@meta hotupdate
1
+ ---@meta
2
2
  ---@class HotUpdate
3
3
  local _HotUpdate = {}
4
4
 
@@ -20,5 +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
24
- return _HotUpdate
23
+ ---@type HotUpdate
24
+ hotupdate = _HotUpdate
@@ -1,4 +1,4 @@
1
- ---@meta http
1
+ ---@meta
2
2
  ---@class Http
3
3
  local _Http = {}
4
4
 
@@ -141,5 +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
145
- return _Http
144
+ ---@type Http
145
+ http = _Http
@@ -1,4 +1,4 @@
1
- ---@meta image
1
+ ---@meta
2
2
  ---@class Image
3
3
  local _Image = {}
4
4
 
@@ -205,5 +205,5 @@ function _Image.drawRect(id, x, y, ex, ey, color, thickness) end
205
205
  --- 释放所有图片
206
206
  function _Image.releaseAll() end
207
207
 
208
- package.loaded['image'] = _Image
209
- return _Image
208
+ ---@type Image
209
+ image = _Image
package/types/lua/ime.lua CHANGED
@@ -1,4 +1,4 @@
1
- ---@meta ime
1
+ ---@meta
2
2
  ---@class Ime
3
3
  local _Ime = {}
4
4
 
@@ -45,5 +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
49
- return _Ime
48
+ ---@type Ime
49
+ ime = _Ime
@@ -1,4 +1,4 @@
1
- ---@meta logger
1
+ ---@meta
2
2
  ---@class Logger
3
3
  local _Logger = {}
4
4
 
@@ -45,5 +45,5 @@ function _Logger.warn(...) end
45
45
  --- @return nil
46
46
  function _Logger.error(...) end
47
47
 
48
- package.loaded['logger'] = _Logger
49
- return _Logger
48
+ ---@type Logger
49
+ logger = _Logger
@@ -1,4 +1,4 @@
1
- ---@meta media
1
+ ---@meta
2
2
  ---@class Media
3
3
  local _Media = {}
4
4
 
@@ -43,5 +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
47
- return _Media
46
+ ---@type Media
47
+ media = _Media
@@ -1,4 +1,4 @@
1
- ---@meta mysql
1
+ ---@meta
2
2
  ---@class MySQL
3
3
  local _MySQL = {}
4
4
 
@@ -61,5 +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
65
- return _MySQL
64
+ ---@type MySQL
65
+ mysql = _MySQL
@@ -1,4 +1,4 @@
1
- ---@meta netcard
1
+ ---@meta
2
2
  ---@class NetCard
3
3
  local _NetCard = {}
4
4
 
@@ -42,5 +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
46
- return _NetCard
45
+ ---@type NetCard
46
+ netcard = _NetCard
@@ -1,4 +1,4 @@
1
- ---@meta node
1
+ ---@meta
2
2
  ---@class Node
3
3
  local _Node = {}
4
4
 
@@ -82,5 +82,5 @@ function _Node.createNodeSelector(params)
82
82
  return ret
83
83
  end
84
84
 
85
- package.loaded['node'] = _Node
86
- return _Node
85
+ ---@type Node
86
+ node = _Node
@@ -1,4 +1,4 @@
1
- ---@meta paddleocr
1
+ ---@meta
2
2
  ---@class PaddleOCR
3
3
  local _PaddleOCR = {}
4
4
 
@@ -99,5 +99,5 @@ end
99
99
  --- 释放资源
100
100
  function _PaddleOCR.free() end
101
101
 
102
- package.loaded['paddleocr'] = _PaddleOCR
103
- return _PaddleOCR
102
+ ---@type PaddleOCR
103
+ paddleocr = _PaddleOCR
package/types/lua/pip.lua CHANGED
@@ -1,4 +1,4 @@
1
- ---@meta pip
1
+ ---@meta
2
2
  ---@class Pip
3
3
  local _Pip = {}
4
4
 
@@ -53,5 +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
57
- return _Pip
56
+ ---@type Pip
57
+ pip = _Pip
@@ -1,4 +1,4 @@
1
- ---@meta system
1
+ ---@meta
2
2
  ---@class System
3
3
  local _System = {}
4
4
 
@@ -136,5 +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
140
- return _System
139
+ ---@type System
140
+ system = _System
@@ -1,4 +1,4 @@
1
- ---@meta tomatoocr
1
+ ---@meta
2
2
  ---@class TomatoOCR
3
3
  local _TomatoOCR = {}
4
4
 
@@ -80,5 +80,5 @@ function _TomatoOCR.findTapPoints(js) return '' end
80
80
  --- 释放已加载的 OCR 模型和内部资源
81
81
  function _TomatoOCR.release() end
82
82
 
83
- package.loaded['tomatoocr'] = _TomatoOCR
84
- return _TomatoOCR
83
+ ---@type TomatoOCR
84
+ tomatoocr = _TomatoOCR
package/types/lua/tts.lua CHANGED
@@ -1,4 +1,4 @@
1
- ---@meta tts
1
+ ---@meta
2
2
  ---@class TTS
3
3
  local _TTS = {}
4
4
 
@@ -39,5 +39,5 @@ function _TTS.getAvailableVoices() return {} end
39
39
  --- 释放 TTS 资源
40
40
  function _TTS.free() end
41
41
 
42
- package.loaded['tts'] = _TTS
43
- return _TTS
42
+ ---@type TTS
43
+ tts = _TTS
package/types/lua/ui.lua CHANGED
@@ -1,4 +1,4 @@
1
- ---@meta ui
1
+ ---@meta
2
2
  ---@class UI
3
3
  local _UI = {}
4
4
 
@@ -43,5 +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
47
- return _UI
46
+ ---@type UI
47
+ ui = _UI
@@ -1,4 +1,4 @@
1
- ---@meta utils
1
+ ---@meta
2
2
  ---@class Utils
3
3
  local _Utils = {}
4
4
 
@@ -46,5 +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
50
- return _Utils
49
+ ---@type Utils
50
+ utils = _Utils
@@ -1,4 +1,4 @@
1
- ---@meta yolo
1
+ ---@meta
2
2
  ---@class Yolo
3
3
  local _Yolo = {}
4
4
 
@@ -62,5 +62,5 @@ function _Yolo.free(id) end
62
62
  --- 释放全部模型
63
63
  function _Yolo.freeAll() end
64
64
 
65
- package.loaded['yolo'] = _Yolo
66
- return _Yolo
65
+ ---@type Yolo
66
+ yolo = _Yolo
@@ -1,4 +1,4 @@
1
- ---@meta yolocls
1
+ ---@meta
2
2
  ---@class YoloCls
3
3
  local _YoloCls = {}
4
4
 
@@ -36,5 +36,5 @@ function _YoloCls.free(modelId) end
36
36
 
37
37
  function _YoloCls.freeAll() end
38
38
 
39
- package.loaded['yolocls'] = _YoloCls
40
- return _YoloCls
39
+ ---@type YoloCls
40
+ yolocls = _YoloCls