ms-types 0.4.6 → 0.4.8
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
package/types/global.d.ts
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
* 是否是调试模式
|
|
3
3
|
*/
|
|
4
4
|
declare const __debug__: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* 平台标识
|
|
7
|
+
*/
|
|
8
|
+
declare const __platform__: "ios" | "android";
|
|
9
|
+
/**
|
|
5
10
|
/**
|
|
6
11
|
* 应用版本
|
|
7
12
|
*/
|
|
@@ -195,3 +200,21 @@ declare function logw(...args: any[]): void;
|
|
|
195
200
|
* loge("文件读取错误");
|
|
196
201
|
*/
|
|
197
202
|
declare function loge(...args: any[]): void;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* 加载 dex 文件 (仅安卓可用)
|
|
206
|
+
* @param path dex 文件路径
|
|
207
|
+
* @description 加载 dex 文件到内存中
|
|
208
|
+
* @example
|
|
209
|
+
* loadDex("test.dex");
|
|
210
|
+
*/
|
|
211
|
+
declare function loadDex(path: string): void;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 加载 apk 文件 (仅安卓可用)
|
|
215
|
+
* @param path apk 文件路径
|
|
216
|
+
* @description 加载 apk 文件到内存中
|
|
217
|
+
* @example
|
|
218
|
+
* loadApk("test.apk");
|
|
219
|
+
*/
|
|
220
|
+
declare function loadApk(path: string): void;
|
package/types/image.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ declare namespace image {
|
|
|
29
29
|
x: number,
|
|
30
30
|
y: number,
|
|
31
31
|
ex: number,
|
|
32
|
-
ey: number
|
|
32
|
+
ey: number,
|
|
33
33
|
): string | null;
|
|
34
34
|
/**
|
|
35
35
|
* 保存图片
|
|
@@ -123,7 +123,7 @@ declare namespace image {
|
|
|
123
123
|
function cmpColor(
|
|
124
124
|
imageId: string,
|
|
125
125
|
points: string,
|
|
126
|
-
threshold: number
|
|
126
|
+
threshold: number,
|
|
127
127
|
): boolean;
|
|
128
128
|
/**
|
|
129
129
|
* 查找颜色
|
|
@@ -156,7 +156,7 @@ declare namespace image {
|
|
|
156
156
|
ex: number,
|
|
157
157
|
ey: number,
|
|
158
158
|
limit: number,
|
|
159
|
-
orz: number
|
|
159
|
+
orz: number,
|
|
160
160
|
): { x: number; y: number }[];
|
|
161
161
|
/**
|
|
162
162
|
* 查找多颜色
|
|
@@ -191,7 +191,7 @@ declare namespace image {
|
|
|
191
191
|
ex: number,
|
|
192
192
|
ey: number,
|
|
193
193
|
limit: number,
|
|
194
|
-
orz: number
|
|
194
|
+
orz: number,
|
|
195
195
|
): { x: number; y: number }[];
|
|
196
196
|
/**
|
|
197
197
|
* 统计颜色数量
|
|
@@ -213,7 +213,7 @@ declare namespace image {
|
|
|
213
213
|
x: number,
|
|
214
214
|
y: number,
|
|
215
215
|
ex: number,
|
|
216
|
-
ey: number
|
|
216
|
+
ey: number,
|
|
217
217
|
): number;
|
|
218
218
|
/**
|
|
219
219
|
* 查找图片
|
|
@@ -227,6 +227,8 @@ declare namespace image {
|
|
|
227
227
|
* @param limit 限制数量
|
|
228
228
|
* @param method 方法
|
|
229
229
|
* @param rgb 是否使用RGB找图,默认false
|
|
230
|
+
* @param options 选项
|
|
231
|
+
* @param options.scaleFactors 缩放匹配法缩放因子数组,默认[1.0, 0.9, 1.1, 0.8, 1.2]
|
|
230
232
|
* @returns 图片数组
|
|
231
233
|
* @example
|
|
232
234
|
* const points = image.findImage("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
|
|
@@ -244,7 +246,10 @@ declare namespace image {
|
|
|
244
246
|
threshold: number,
|
|
245
247
|
limit: number,
|
|
246
248
|
method: number,
|
|
247
|
-
rgb?: boolean
|
|
249
|
+
rgb?: boolean,
|
|
250
|
+
options?: {
|
|
251
|
+
scaleFactors?: number[];
|
|
252
|
+
},
|
|
248
253
|
): {
|
|
249
254
|
index: number;
|
|
250
255
|
x: number;
|
|
@@ -280,7 +285,7 @@ declare namespace image {
|
|
|
280
285
|
x: number,
|
|
281
286
|
y: number,
|
|
282
287
|
ex: number,
|
|
283
|
-
ey: number
|
|
288
|
+
ey: number,
|
|
284
289
|
): string | null;
|
|
285
290
|
/**
|
|
286
291
|
* 获取图片像素
|
|
@@ -370,7 +375,7 @@ declare namespace image {
|
|
|
370
375
|
function toBase64Format(
|
|
371
376
|
imageId: string,
|
|
372
377
|
format: string,
|
|
373
|
-
q: number
|
|
378
|
+
q: number,
|
|
374
379
|
): string | null;
|
|
375
380
|
/**
|
|
376
381
|
* 扫描条码 支持一维码和二维码
|
|
@@ -410,6 +415,6 @@ declare namespace image {
|
|
|
410
415
|
ex: number,
|
|
411
416
|
ey: number,
|
|
412
417
|
color: string,
|
|
413
|
-
thickness: number
|
|
418
|
+
thickness: number,
|
|
414
419
|
): void;
|
|
415
420
|
}
|
|
@@ -30,7 +30,7 @@ declare namespace $图片 {
|
|
|
30
30
|
区域左上角X坐标: 数字,
|
|
31
31
|
区域左上角Y坐标: 数字,
|
|
32
32
|
区域右下角X坐标: 数字,
|
|
33
|
-
区域右下角Y坐标:
|
|
33
|
+
区域右下角Y坐标: 数字,
|
|
34
34
|
): 字符串 | null;
|
|
35
35
|
/**
|
|
36
36
|
* 保存图片
|
|
@@ -154,7 +154,7 @@ declare namespace $图片 {
|
|
|
154
154
|
区域右下角x: 数字,
|
|
155
155
|
区域右下角y: 数字,
|
|
156
156
|
限制数量: 数字,
|
|
157
|
-
查找方向:
|
|
157
|
+
查找方向: 数字,
|
|
158
158
|
): { x: 数字; y: 数字 }[];
|
|
159
159
|
/**
|
|
160
160
|
* 多点找色
|
|
@@ -189,7 +189,7 @@ declare namespace $图片 {
|
|
|
189
189
|
区域右下角x: 数字,
|
|
190
190
|
区域右下角y: 数字,
|
|
191
191
|
限制数量: 数字,
|
|
192
|
-
查找方向:
|
|
192
|
+
查找方向: 数字,
|
|
193
193
|
): { x: 数字; y: 数字 }[];
|
|
194
194
|
/**
|
|
195
195
|
* 统计颜色数量
|
|
@@ -211,7 +211,7 @@ declare namespace $图片 {
|
|
|
211
211
|
区域左上角x: 数字,
|
|
212
212
|
区域左上角y: 数字,
|
|
213
213
|
区域右下角x: 数字,
|
|
214
|
-
区域右下角y:
|
|
214
|
+
区域右下角y: 数字,
|
|
215
215
|
): 数字;
|
|
216
216
|
/**
|
|
217
217
|
* 查找图片
|
|
@@ -225,6 +225,8 @@ declare namespace $图片 {
|
|
|
225
225
|
* @param 限制数量 限制数量
|
|
226
226
|
* @param 方法 方法
|
|
227
227
|
* @param 是否使用RGB找图 是否使用RGB找图,默认false
|
|
228
|
+
* @param 选项 选项
|
|
229
|
+
* @param 选项.scaleFactors 缩放匹配法缩放因子数组,默认[1.0, 0.9, 1.1, 0.8, 1.2]
|
|
228
230
|
* @returns 图片数组
|
|
229
231
|
* @example
|
|
230
232
|
* const 图片数组 = $图片.找图("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
|
|
@@ -242,7 +244,10 @@ declare namespace $图片 {
|
|
|
242
244
|
阈值: 数字,
|
|
243
245
|
限制数量: 数字,
|
|
244
246
|
方法: 数字,
|
|
245
|
-
是否使用RGB找图?:
|
|
247
|
+
是否使用RGB找图?: 布尔值,
|
|
248
|
+
选项?: {
|
|
249
|
+
scaleFactors?: 数字[];
|
|
250
|
+
},
|
|
246
251
|
): {
|
|
247
252
|
index: 数字;
|
|
248
253
|
x: 数字;
|
|
@@ -278,7 +283,7 @@ declare namespace $图片 {
|
|
|
278
283
|
区域左上角x: 数字,
|
|
279
284
|
区域左上角y: 数字,
|
|
280
285
|
区域右下角x: 数字,
|
|
281
|
-
区域右下角y:
|
|
286
|
+
区域右下角y: 数字,
|
|
282
287
|
): 字符串 | null;
|
|
283
288
|
/**
|
|
284
289
|
* 获取图片像素
|
|
@@ -368,7 +373,7 @@ declare namespace $图片 {
|
|
|
368
373
|
function 图片转base64(
|
|
369
374
|
图片ID: 字符串,
|
|
370
375
|
格式: 字符串,
|
|
371
|
-
质量:
|
|
376
|
+
质量: 数字,
|
|
372
377
|
): 字符串 | null;
|
|
373
378
|
/**
|
|
374
379
|
* 扫描条码 支持一维码和二维码
|
|
@@ -409,6 +414,6 @@ declare namespace $图片 {
|
|
|
409
414
|
坐标ex: 数字,
|
|
410
415
|
坐标ey: 数字,
|
|
411
416
|
颜色: 字符串,
|
|
412
|
-
线宽:
|
|
417
|
+
线宽: 数字,
|
|
413
418
|
): 无返回值;
|
|
414
419
|
}
|