ms-types 0.1.8 → 0.1.10

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.1.8",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -16,6 +16,6 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "vitepress": "^1.6.4",
19
- "vitepress-theme-teek": "^1.5.1"
19
+ "vitepress-theme-teek": "^1.5.2"
20
20
  }
21
21
  }
package/types/hid.d.ts CHANGED
@@ -56,7 +56,7 @@ declare namespace hid {
56
56
  * 点击指定坐标
57
57
  * @param x 点击坐标的X轴
58
58
  * @param y 点击坐标的Y轴
59
- * @param duration 点击持续时间(可选,默认值为100毫秒)
59
+ * @param duration 点击持续时间(可选,默认值为10毫秒)
60
60
  * @param jitter 是否添加随机抖动(可选,默认值为false)
61
61
  * @returns 操作是否成功
62
62
  */
package/types/image.d.ts CHANGED
@@ -109,7 +109,7 @@ declare namespace image {
109
109
  * 比较颜色
110
110
  * @param imageId 图片id
111
111
  * @param points 颜色点
112
- * @param threshold 阈值
112
+ * @param threshold 阈值 0.0-1.0
113
113
  * @param x 左上角x 全屏传0
114
114
  * @param y 左上角y 全屏传0
115
115
  * @param ex 右下角x 全屏传0
@@ -118,7 +118,7 @@ declare namespace image {
118
118
  * @example
119
119
  * const imageId = image.readImage("screen.jpg")
120
120
  * if (imageId) {
121
- * const isSame = image.cmpColor(imageId, "1|2|#6DD1E6-#101010", 10, 0, 0, 100, 100)
121
+ * const isSame = image.cmpColor(imageId, "1|2|#6DD1E6-#101010", 0.9, 0, 0, 100, 100)
122
122
  * if (isSame) {
123
123
  * logi("颜色相同")
124
124
  * }
@@ -137,7 +137,7 @@ declare namespace image {
137
137
  * 查找颜色
138
138
  * @param imageId 图片id
139
139
  * @param color 颜色 支持"主色-偏色"格式,如"0x6DD1E6-0x101010"
140
- * @param threshold 阈值
140
+ * @param threshold 阈值 0.0-1.0
141
141
  * @param x 左上角x 全屏传0
142
142
  * @param y 左上角y 全屏传0
143
143
  * @param ex 右下角x 全屏传0
@@ -148,7 +148,7 @@ declare namespace image {
148
148
  * @example
149
149
  * const imageId = image.readImage("screen.jpg")
150
150
  * if (imageId) {
151
- * const points = image.findColor(imageId, "0x6DD1E6-0x101010", 10, 0, 0, 100, 100, 1, 1)
151
+ * const points = image.findColor(imageId, "0x6DD1E6-0x101010", 0.9, 0, 0, 100, 100, 1, 1)
152
152
  * if (points.length > 0) {
153
153
  * logi("找到颜色")
154
154
  * }
@@ -170,7 +170,7 @@ declare namespace image {
170
170
  * 查找多颜色
171
171
  * @param imageId 图片id
172
172
  * @param firstColor 第一个颜色
173
- * @param threshold 阈值
173
+ * @param threshold 阈值 0.0-1.0
174
174
  * @param points 颜色点
175
175
  * @param x 左上角x 全屏传0
176
176
  * @param y 左上角y 全屏传0
@@ -182,7 +182,7 @@ declare namespace image {
182
182
  * @example
183
183
  * const imageId = image.readImage("screen.jpg")
184
184
  * if (imageId) {
185
- * const points = image.findMultiColor(imageId, "0x6DD1E6-0x101010", 10, "1|2|#6DD1E6-#101010", 0, 0, 100, 100, 1, 1)
185
+ * const points = image.findMultiColor(imageId, "0x6DD1E6-0x101010", 0.9, "1|2|#6DD1E6-#101010", 0, 0, 100, 100, 1, 1)
186
186
  * if (points.length > 0) {
187
187
  * logi("找到颜色")
188
188
  * }
@@ -209,13 +209,13 @@ declare namespace image {
209
209
  * @param y 左上角y 全屏传0
210
210
  * @param ex 右下角x 全屏传0
211
211
  * @param ey 右下角y 全屏传0
212
- * @param threshold 阈值
212
+ * @param threshold 阈值 0.0-1.0
213
213
  * @param limit 限制数量
214
214
  * @param method 方法
215
215
  * @param rgb 是否使用RGB找图,默认false
216
216
  * @returns 图片数组
217
217
  * @example
218
- * const points = image.findImage("screen", "template.jpg", 0, 0, 100, 100, 0.8, 1, 5, false)
218
+ * const points = image.findImage("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
219
219
  * if (points.length > 0) {
220
220
  * logi("找到图片")
221
221
  * }
@@ -298,7 +298,7 @@ declare namespace image {
298
298
  /**
299
299
  * 二值化
300
300
  * @param imageId 图片id
301
- * @param threshold 阈值
301
+ * @param threshold 阈值 0.0-255.0
302
302
  * @returns 二值化后的图片id
303
303
  * @example
304
304
  * const imageId = image.readImage("screen.jpg")
@@ -46,10 +46,10 @@ declare namespace paddleOcr {
46
46
  /**
47
47
  * 执行OCR识别
48
48
  * @param input 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
49
- * @param x 边界框左上角x坐标 全屏传0
50
- * @param y 边界框左上角y坐标 全屏传0
51
- * @param ex 边界框右下角x坐标 全屏传0
52
- * @param ey 边界框右下角y坐标 全屏传0
49
+ * @param x 边界框左上角x坐标 全屏传0,默认0
50
+ * @param y 边界框左上角y坐标 全屏传0,默认0
51
+ * @param ex 边界框右下角x坐标 全屏传0,默认0
52
+ * @param ey 边界框右下角y坐标 全屏传0,默认0
53
53
  * @param confidenceThreshold 置信度阈值,默认0.6
54
54
  * @returns 识别结果数组
55
55
  * @example
@@ -47,11 +47,11 @@ declare namespace $PaddleOCR {
47
47
  /**
48
48
  * 执行OCR识别
49
49
  * @param 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
50
- * @param 图片边界框左上角x坐标 全屏传0
51
- * @param 图片边界框左上角y坐标 全屏传0
52
- * @param 图片边界框右下角x坐标 全屏传0
53
- * @param 图片边界框右下角y坐标 全屏传0
54
- * @param confidenceThreshold 置信度阈值,默认0.6
50
+ * @param 图片边界框左上角x坐标 全屏传0,默认0
51
+ * @param 图片边界框左上角y坐标 全屏传0,默认0
52
+ * @param 图片边界框右下角x坐标 全屏传0,默认0
53
+ * @param 图片边界框右下角y坐标 全屏传0,默认0
54
+ * @param 置信度阈值 置信度阈值,默认0.6
55
55
  * @returns 识别结果数组
56
56
  * @example
57
57
  * const 识别结果数组 = $PaddleOCR.识别("screen", 0, 0, 100, 100)
@@ -110,7 +110,7 @@ declare namespace $图片 {
110
110
  * 比较颜色
111
111
  * @param 图片ID 图片id
112
112
  * @param 颜色点 颜色点 格式为"x1,y1|#6DD1E6-#101010,x2,y2|#6DD1E6-#101010"
113
- * @param 阈值 0-1
113
+ * @param 阈值 0.0-1.0
114
114
  * @param 区域左上角x 全屏传0
115
115
  * @param 区域左上角y 全屏传0
116
116
  * @param 区域右下角x 全屏传0
@@ -119,7 +119,7 @@ declare namespace $图片 {
119
119
  * @example
120
120
  * const 图片ID = $图片.读取图片("screen.jpg")
121
121
  * if (图片ID) {
122
- * const isSame = $图片.多点比色(图片ID, "1|2|#6DD1E6-#101010", 10, 0, 0, 100, 100)
122
+ * const isSame = $图片.多点比色(图片ID, "1|2|#6DD1E6-#101010", 0.9, 0, 0, 100, 100)
123
123
  * if (isSame) {
124
124
  * $打印信息日志("颜色相同")
125
125
  * }
@@ -139,7 +139,7 @@ declare namespace $图片 {
139
139
  * 查找颜色
140
140
  * @param 图片ID 图片id
141
141
  * @param 颜色 颜色 支持"主色-偏色"格式,如"0x6DD1E6-0x101010"
142
- * @param 阈值 阈值
142
+ * @param 阈值 0.0-1.0
143
143
  * @param 区域左上角x 全屏传0
144
144
  * @param 区域左上角y 全屏传0
145
145
  * @param 区域右下角x 全屏传0
@@ -150,7 +150,7 @@ declare namespace $图片 {
150
150
  * @example
151
151
  * const 图片ID = $图片.读取图片("screen.jpg")
152
152
  * if (图片ID) {
153
- * const 颜色点数组 = $图片.单点找色(图片ID, "0x6DD1E6-0x101010", 10, 0, 0, 100, 100, 1, 1)
153
+ * const 颜色点数组 = $图片.单点找色(图片ID, "0x6DD1E6-0x101010", 0.9, 0, 0, 100, 100, 1, 1)
154
154
  * if (颜色点数组.length > 0) {
155
155
  * $打印信息日志("找到颜色")
156
156
  * }
@@ -172,7 +172,7 @@ declare namespace $图片 {
172
172
  * 多点找色
173
173
  * @param 图片ID 图片id
174
174
  * @param 第一个颜色 第一个颜色
175
- * @param 阈值 阈值
175
+ * @param 阈值 0.0-1.0
176
176
  * @param 颜色点 颜色点
177
177
  * @param 区域左上角x 全屏传0
178
178
  * @param 区域左上角y 全屏传0
@@ -184,7 +184,7 @@ declare namespace $图片 {
184
184
  * @example
185
185
  * const 图片ID = $图片.读取图片("screen.jpg")
186
186
  * if (图片ID) {
187
- * const 颜色点数组 = $图片.多点找色(图片ID, "0x6DD1E6-0x101010", 10, "1|2|#6DD1E6-#101010", 0, 0, 100, 100, 1, 1)
187
+ * const 颜色点数组 = $图片.多点找色(图片ID, "0x6DD1E6-0x101010", 0.9, "1|2|#6DD1E6-#101010", 0, 0, 100, 100, 1, 1)
188
188
  * if (颜色点数组.length > 0) {
189
189
  * $打印信息日志("找到颜色")
190
190
  * }
@@ -211,13 +211,13 @@ declare namespace $图片 {
211
211
  * @param 区域左上角y 全屏传0
212
212
  * @param 区域右下角x 全屏传0
213
213
  * @param 区域右下角y 全屏传0
214
- * @param 阈值 阈值
214
+ * @param 阈值 阈值 0.0-1.0
215
215
  * @param 限制数量 限制数量
216
216
  * @param 方法 方法
217
217
  * @param 是否使用RGB找图 是否使用RGB找图,默认false
218
218
  * @returns 图片数组
219
219
  * @example
220
- * const 图片数组 = $图片.找图("screen", "template.jpg", 0, 0, 100, 100, 0.8, 1, 5, false)
220
+ * const 图片数组 = $图片.找图("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
221
221
  * if (图片数组.length > 0) {
222
222
  * $打印信息日志("找到图片")
223
223
  * }
@@ -300,7 +300,7 @@ declare namespace $图片 {
300
300
  /**
301
301
  * 二值化
302
302
  * @param 图片ID
303
- * @param 阈值
303
+ * @param 阈值 0.0-255.0
304
304
  * @returns 二值化后的图片ID
305
305
  * @example
306
306
  * const 图片ID = $图片.读取图片("screen.jpg")
@@ -252,7 +252,7 @@ declare class $节点选择器 {
252
252
  * @param childCount 子节点数量
253
253
  * @returns 节点选择器
254
254
  */
255
- childCount(childCount: 数字): $节点选择器;
255
+ childCount(childCount: 字符串): $节点选择器;
256
256
  /**
257
257
  * 获取节点位置
258
258
  * @param x x坐标