ms-types 0.0.73 → 0.0.75

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.73",
3
+ "version": "0.0.75",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/image.d.ts CHANGED
@@ -12,6 +12,20 @@ declare namespace image {
12
12
  * }
13
13
  */
14
14
  function captureFullScreen(): string | null;
15
+ /**
16
+ * 截图指定区域
17
+ * @param x 截图区域左上角x坐标
18
+ * @param y 截图区域左上角y坐标
19
+ * @param ex 截图区域右下角x坐标
20
+ * @param ey 截图区域右下角y坐标
21
+ * @returns 截图的imageId ,如果截图失败则返回null
22
+ * @example
23
+ * const imageId = image.captureRect(0, 0, 100, 100)
24
+ * if (imageId) {
25
+ * image.saveTo(imageId, "screen.jpg")
26
+ * }
27
+ */
28
+ function captureRect(x: number, y: number, ex: number, ey: number): string | null;
15
29
  /**
16
30
  * 保存图片
17
31
  * @param imageId 图片id 路径 http地址或者 screen 实时截屏
package/types/system.d.ts CHANGED
@@ -9,15 +9,15 @@ declare namespace system {
9
9
  * @param env 应用环境变量
10
10
  * @returns 是否启动成功
11
11
  * @example
12
- * const started = system.startApp("cn.magicnode.script, [], {})
12
+ * const started = system.startApp("cn.magicnode.script")
13
13
  * if (started) {
14
14
  * logi("启动成功")
15
15
  * }
16
16
  */
17
17
  function startApp(
18
18
  bundleId: string,
19
- args: string[],
20
- env: Record<string, any>
19
+ args?: string[],
20
+ env?: Record<string, any>
21
21
  ): boolean;
22
22
  /**
23
23
  * 关闭应用
@@ -13,6 +13,25 @@ declare namespace $图片 {
13
13
  * }
14
14
  */
15
15
  function 截取全屏(): 字符串 | null;
16
+ /**
17
+ * 截图指定区域
18
+ * @param 区域左上角X坐标
19
+ * @param 区域左上角Y坐标
20
+ * @param 区域右下角X坐标
21
+ * @param 区域右下角Y坐标
22
+ * @returns 截图的imageId ,如果截图失败则返回null
23
+ * @example
24
+ * const 图片ID = $图片.截取区域(0, 0, 100, 100)
25
+ * if (图片ID) {
26
+ * $图片.保存图片(图片ID, "screen.jpg")
27
+ * }
28
+ */
29
+ function 截取区域(
30
+ 区域左上角X坐标: 数字,
31
+ 区域左上角Y坐标: 数字,
32
+ 区域右下角X坐标: 数字,
33
+ 区域右下角Y坐标: 数字
34
+ ): 字符串 | null;
16
35
  /**
17
36
  * 保存图片
18
37
  * @param imageId 图片id 路径 http地址或者 screen 实时截屏
@@ -10,15 +10,15 @@ declare namespace $系统 {
10
10
  * @param env 应用环境变量
11
11
  * @returns 是否启动成功
12
12
  * @example
13
- * const 是否启动成功 = $系统.启动应用("cn.magicnode.script", [], {})
13
+ * const 是否启动成功 = $系统.启动应用("cn.magicnode.script")
14
14
  * if (是否启动成功) {
15
15
  * $打印信息日志("启动成功")
16
16
  * }
17
17
  */
18
18
  function 启动应用(
19
19
  bundleId: 字符串,
20
- args: 字符串[],
21
- env: 字典<任意类型>
20
+ args?: 字符串[],
21
+ env?: 字典<任意类型>
22
22
  ): 布尔值;
23
23
  /**
24
24
  * 关闭应用
@@ -110,10 +110,18 @@ declare interface $节点信息 {
110
110
  * 点击节点中心
111
111
  */
112
112
  clickCenter(): 布尔值;
113
+ /**
114
+ * 点击节点中心
115
+ */
116
+ 点击中心(): 布尔值;
113
117
  /**
114
118
  * 点击节点随机位置
115
119
  */
116
120
  clickRandom(): 布尔值;
121
+ /**
122
+ * 点击节点随机范围
123
+ */
124
+ 点击随机范围(): 布尔值;
117
125
  /**
118
126
  * 获取父节点
119
127
  */