ms-types 0.0.24 → 0.0.26

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.0.24",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/action.d.ts CHANGED
@@ -55,6 +55,42 @@ declare namespace action {
55
55
  y2: number,
56
56
  duration?: number
57
57
  ): boolean;
58
+ /**
59
+ * 双击
60
+ * @param x 坐标x
61
+ * @param y 坐标y
62
+ * @param duration 持续时间 默认20ms
63
+ * @param interval 双击间隔时间 默认20ms
64
+ * @param jitter 抖动 开启抖动,会在像素范围随机偏移 点击 默认false
65
+ * @returns 双击是否成功
66
+ * @example action.doubleClick(100, 100, 20, 20, true)
67
+ */
68
+ function doubleClick(
69
+ x: number,
70
+ y: number,
71
+ duration?: number,
72
+ interval?: number,
73
+ jitter?: boolean
74
+ ): boolean;
75
+ /**
76
+ * 随机双击
77
+ * @param x1 区域左上角x坐标
78
+ * @param y1 区域左上角y坐标
79
+ * @param x2 区域右下角x坐标
80
+ * @param y2 区域右下角y坐标
81
+ * @param duration 持续时间 默认20ms
82
+ * @param interval 双击间隔时间 默认20ms
83
+ * @returns 随机双击是否成功
84
+ * @example action.doubleClickRandom(100, 100, 200, 200, 20, 20)
85
+ */
86
+ function doubleClickRandom(
87
+ x1: number,
88
+ y1: number,
89
+ x2: number,
90
+ y2: number,
91
+ duration?: number,
92
+ interval?: number
93
+ ): boolean;
58
94
  /**
59
95
  * 长按滑动
60
96
  * @param startX 起始坐标x
@@ -4,7 +4,7 @@
4
4
  declare namespace appleOcr {
5
5
  /**
6
6
  * 执行OCR识别(使用Apple Vision框架)
7
- * @param input 输入源(imageId、URL字符串、文件路径或"screen",null表示使用当前屏幕)
7
+ * @param input 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
8
8
  * @param x 边界框左上角x坐标
9
9
  * @param y 边界框左上角y坐标
10
10
  * @param ex 边界框右下角x坐标
@@ -18,7 +18,7 @@ declare namespace appleOcr {
18
18
  * })
19
19
  */
20
20
  function recognize(
21
- input: string | null,
21
+ input: string,
22
22
  x: number,
23
23
  y: number,
24
24
  ex: number,
@@ -28,7 +28,7 @@ declare namespace appleOcr {
28
28
 
29
29
  /**
30
30
  * 执行快速OCR识别(仅返回文本内容)
31
- * @param input 输入源
31
+ * @param input 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
32
32
  * @param x 边界框左上角x坐标
33
33
  * @param y 边界框左上角y坐标
34
34
  * @param ex 边界框右下角x坐标
@@ -42,7 +42,7 @@ declare namespace appleOcr {
42
42
  * }
43
43
  */
44
44
  function recognizeText(
45
- input: string | null,
45
+ input: string,
46
46
  x: number,
47
47
  y: number,
48
48
  ex: number,
package/types/ime.d.ts CHANGED
@@ -42,7 +42,7 @@ declare namespace ime {
42
42
  * const text = ime.paste("hello")
43
43
  * logger.info(text)
44
44
  */
45
- function paste(text: string): string;
45
+ function paste(text?: string): string;
46
46
  /**
47
47
  * 模拟删除键
48
48
  * @returns {string} 如果为空,代表输入框无数据,如果不为空,代表输入框剩余数据
@@ -15,7 +15,7 @@ declare namespace paddleOcr {
15
15
  function loadV5(useGpu: boolean): boolean;
16
16
  /**
17
17
  * 执行OCR识别
18
- * @param input 输入源(imageId、URL字符串、文件路径或"screen",nil表示使用当前屏幕)
18
+ * @param input 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
19
19
  * @param x 边界框左上角x坐标
20
20
  * @param y 边界框左上角y坐标
21
21
  * @param ex 边界框右下角x坐标
@@ -28,7 +28,7 @@ declare namespace paddleOcr {
28
28
  * }
29
29
  */
30
30
  function recognize(
31
- input: string | null,
31
+ input: string,
32
32
  x: number,
33
33
  y: number,
34
34
  ex: number,
@@ -6,15 +6,15 @@ declare namespace tomatoOcr {
6
6
  /**
7
7
  * 初始化TomatoOCR并设置基本配置
8
8
  * @param mode 运行模式 debug:调试模型;删除或传别的任何值为正式模式
9
- * @param licenseData 许可证数据
9
+ * @param licenseData 授权码 请传入你在 TomatoOCR 官网申请的授权码
10
10
  * @param remark 备注信息(可选)
11
11
  * @returns 设置结果
12
12
  * @example
13
13
  * ```typescript
14
14
  * // 不带备注
15
- * const result1 = tomatoOcr.initializeWithConfig("online", "your_license_data");
15
+ * const result1 = tomatoOcr.initializeWithConfig("online", "授权码");
16
16
  * // 带备注
17
- * const result2 = tomatoOcr.initializeWithConfig("online", "your_license_data", "测试环境");
17
+ * const result2 = tomatoOcr.initializeWithConfig("online", "授权码", "测试环境");
18
18
  * logger.info(result1, result2);
19
19
  * ```
20
20
  */
@@ -140,7 +140,7 @@ declare namespace tomatoOcr {
140
140
 
141
141
  /**
142
142
  * 对图像执行 OCR 识别
143
- * @param input 输入源(imageId、URL字符串、文件路径或"screen",null表示使用当前屏幕)
143
+ * @param input 输入源(imageId、URL字符串、文件路径或"screen","screen"表示使用当前屏幕)
144
144
  * @param type 识别类型 默认3: 检测 + 识别;0: 只检测;1: 方向分类+识别;2: 只识别;3: 检测+识别
145
145
  * @param x 边界框左上角x坐标
146
146
  * @param y 边界框左上角y坐标
@@ -150,7 +150,7 @@ declare namespace tomatoOcr {
150
150
  * @example
151
151
  * ```typescript
152
152
  * // 识别屏幕
153
- * const result1 = tomatoOcr.ocrImage(null, 0, 0, 0, 0, 0);
153
+ * const result1 = tomatoOcr.ocrImage("screen", 0, 0, 0, 0, 0);
154
154
  * logger.info(`识别屏幕结果:${result1}`);
155
155
  *
156
156
  * // 识别文件
@@ -163,7 +163,7 @@ declare namespace tomatoOcr {
163
163
  * ```
164
164
  */
165
165
  function ocrImage(
166
- input: string | null,
166
+ input: string,
167
167
  type: number,
168
168
  x: number,
169
169
  y: number,
package/types/yolo.d.ts CHANGED
@@ -68,17 +68,17 @@ declare namespace yolo {
68
68
  /**
69
69
  * 目标检测
70
70
  * @param modelId 模型ID
71
- * @param img 图像ID,默认null用当前屏幕检测,可以填入图像ID或者http图片地址或文件地址
71
+ * @param img 图像ID,"screen"用当前屏幕检测,可以填入图像ID或者http图片地址或文件地址
72
72
  * @param targetSize 图像进入后缩放的检测大小,模型训练一般都用640,因此这里的640一般不要改
73
73
  * @param threshold 置信度,默认0.4,小于这个值的会被过滤掉
74
74
  * @param nmsThreshold 重叠阈值,一般是0.5不需要更改
75
75
  * @returns 检测结果数组
76
76
  * @example
77
- * const results = yolo.detect(modelId, null, 640, 0.4, 0.5)
77
+ * const results = yolo.detect(modelId, "screen", 640, 0.4, 0.5)
78
78
  */
79
79
  function detect(
80
80
  modelId: string,
81
- img: string | null,
81
+ img: string,
82
82
  targetSize?: number,
83
83
  threshold?: number,
84
84
  nmsThreshold?: number