ms-types 0.1.7 → 0.1.9
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.
|
|
3
|
+
"version": "0.1.9",
|
|
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.
|
|
19
|
+
"vitepress-theme-teek": "^1.5.2"
|
|
20
20
|
}
|
|
21
21
|
}
|
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",
|
|
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",
|
|
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",
|
|
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.
|
|
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")
|
package/types/node.d.ts
CHANGED
|
@@ -156,15 +156,6 @@ declare class NodeSelector {
|
|
|
156
156
|
* @returns 节点信息
|
|
157
157
|
*/
|
|
158
158
|
getOneNodeInfo(timeout?: number): NodeInfo | null;
|
|
159
|
-
/**
|
|
160
|
-
* 加载节点
|
|
161
|
-
* @param timeout 超时时间,单位毫秒 默认为 5000 毫秒
|
|
162
|
-
*/
|
|
163
|
-
loadNode(timeout?: number): NodeSelector;
|
|
164
|
-
/**
|
|
165
|
-
* 清除条件
|
|
166
|
-
*/
|
|
167
|
-
clearSelector(): NodeSelector;
|
|
168
159
|
/**
|
|
169
160
|
* 获取节点xpath
|
|
170
161
|
* @param path xpath路径
|
|
@@ -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",
|
|
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",
|
|
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",
|
|
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.
|
|
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")
|
|
@@ -157,15 +157,6 @@ declare class $节点选择器 {
|
|
|
157
157
|
* @returns 节点信息
|
|
158
158
|
*/
|
|
159
159
|
获取一个节点(超时时间?: 数字): $节点信息 | null;
|
|
160
|
-
/**
|
|
161
|
-
* 加载节点
|
|
162
|
-
* @param 超时时间 超时时间,单位毫秒 默认为 5000 毫秒
|
|
163
|
-
*/
|
|
164
|
-
加载节点数据(超时时间?: 数字): $节点选择器;
|
|
165
|
-
/**
|
|
166
|
-
* 清除条件
|
|
167
|
-
*/
|
|
168
|
-
清除所有选择条件(): $节点选择器;
|
|
169
160
|
/**
|
|
170
161
|
* 获取节点xpath
|
|
171
162
|
* @param xpath 节点xpath路径
|
|
@@ -261,7 +252,7 @@ declare class $节点选择器 {
|
|
|
261
252
|
* @param childCount 子节点数量
|
|
262
253
|
* @returns 节点选择器
|
|
263
254
|
*/
|
|
264
|
-
childCount(childCount:
|
|
255
|
+
childCount(childCount: 字符串): $节点选择器;
|
|
265
256
|
/**
|
|
266
257
|
* 获取节点位置
|
|
267
258
|
* @param x x坐标
|