assistsx-js 0.0.2005 → 0.0.2011

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/dist/Bounds.d.ts CHANGED
@@ -3,12 +3,26 @@ export declare class Bounds {
3
3
  readonly top: number;
4
4
  readonly right: number;
5
5
  readonly bottom: number;
6
- constructor(left: number, top: number, right: number, bottom: number);
6
+ readonly width: number;
7
+ readonly height: number;
8
+ readonly centerX: number;
9
+ readonly centerY: number;
10
+ readonly exactCenterX: number;
11
+ readonly exactCenterY: number;
12
+ readonly isEmpty: boolean;
13
+ constructor(left: number, top: number, right: number, bottom: number, width: number, height: number, centerX: number, centerY: number, exactCenterX: number, exactCenterY: number, isEmpty: boolean);
7
14
  static from(data: {
8
15
  left: number;
9
16
  top: number;
10
17
  right: number;
11
18
  bottom: number;
19
+ width: number;
20
+ height: number;
21
+ centerX: number;
22
+ centerY: number;
23
+ exactCenterX: number;
24
+ exactCenterY: number;
25
+ isEmpty: boolean;
12
26
  }): Bounds;
13
27
  static fromJSON(json: string): Bounds;
14
28
  static fromData(data: any): Bounds;
@@ -17,6 +31,13 @@ export declare class Bounds {
17
31
  top: number;
18
32
  right: number;
19
33
  bottom: number;
34
+ width: number;
35
+ height: number;
36
+ centerX: number;
37
+ centerY: number;
38
+ exactCenterX: number;
39
+ exactCenterY: number;
40
+ isEmpty: boolean;
20
41
  };
21
42
  clone(): Bounds;
22
43
  }
package/dist/Bounds.js CHANGED
@@ -1,15 +1,22 @@
1
1
  // Bounds 类,对应 Kotlin 的 data class
2
2
  export class Bounds {
3
3
  // 构造函数
4
- constructor(left, top, right, bottom) {
4
+ constructor(left, top, right, bottom, width, height, centerX, centerY, exactCenterX, exactCenterY, isEmpty) {
5
5
  this.left = left;
6
6
  this.top = top;
7
7
  this.right = right;
8
8
  this.bottom = bottom;
9
+ this.width = width;
10
+ this.height = height;
11
+ this.centerX = centerX;
12
+ this.centerY = centerY;
13
+ this.exactCenterX = exactCenterX;
14
+ this.exactCenterY = exactCenterY;
15
+ this.isEmpty = isEmpty;
9
16
  }
10
17
  // 从普通对象创建 Bounds 实例
11
18
  static from(data) {
12
- return new Bounds(data.left, data.top, data.right, data.bottom);
19
+ return new Bounds(data.left, data.top, data.right, data.bottom, data.width, data.height, data.centerX, data.centerY, data.exactCenterX, data.exactCenterY, data.isEmpty);
13
20
  }
14
21
  // 从 JSON 字符串创建实例
15
22
  static fromJSON(json) {
@@ -17,7 +24,7 @@ export class Bounds {
17
24
  return Bounds.from(data);
18
25
  }
19
26
  static fromData(data) {
20
- return new Bounds(data.left, data.top, data.right, data.bottom);
27
+ return new Bounds(data.left, data.top, data.right, data.bottom, data.width, data.height, data.centerX, data.centerY, data.exactCenterX, data.exactCenterY, data.isEmpty);
21
28
  }
22
29
  // 转换为普通对象
23
30
  toJSON() {
@@ -25,11 +32,18 @@ export class Bounds {
25
32
  left: this.left,
26
33
  top: this.top,
27
34
  right: this.right,
28
- bottom: this.bottom
35
+ bottom: this.bottom,
36
+ width: this.width,
37
+ height: this.height,
38
+ centerX: this.centerX,
39
+ centerY: this.centerY,
40
+ exactCenterX: this.exactCenterX,
41
+ exactCenterY: this.exactCenterY,
42
+ isEmpty: this.isEmpty,
29
43
  };
30
44
  }
31
45
  // 克隆方法
32
46
  clone() {
33
- return new Bounds(this.left, this.top, this.right, this.bottom);
47
+ return new Bounds(this.left, this.top, this.right, this.bottom, this.width, this.height, this.centerX, this.centerY, this.exactCenterX, this.exactCenterY, this.isEmpty);
34
48
  }
35
49
  }
package/dist/Node.d.ts CHANGED
@@ -41,6 +41,50 @@ export declare class Node {
41
41
  * 所属步骤ID
42
42
  */
43
43
  stepId: string | undefined;
44
+ /**
45
+ * 提示文本
46
+ */
47
+ hintText: string;
48
+ /**
49
+ * 是否可选择
50
+ */
51
+ isCheckable: boolean;
52
+ /**
53
+ * 是否已选中
54
+ */
55
+ isChecked: boolean;
56
+ /**
57
+ * 是否可聚焦
58
+ */
59
+ isFocusable: boolean;
60
+ /**
61
+ * 是否已聚焦
62
+ */
63
+ isFocused: boolean;
64
+ /**
65
+ * 是否可长按
66
+ */
67
+ isLongClickable: boolean;
68
+ /**
69
+ * 是否为密码字段
70
+ */
71
+ isPassword: boolean;
72
+ /**
73
+ * 是否已选中
74
+ */
75
+ isSelected: boolean;
76
+ /**
77
+ * 是否对用户可见
78
+ */
79
+ isVisibleToUser: boolean;
80
+ /**
81
+ * 绘制顺序
82
+ */
83
+ drawingOrder: number;
84
+ /**
85
+ * 节点在屏幕中的边界
86
+ */
87
+ boundsInScreen: Bounds;
44
88
  /**
45
89
  * 构造函数
46
90
  * @param params 节点参数对象
@@ -55,6 +99,17 @@ export declare class Node {
55
99
  isClickable: boolean;
56
100
  isEnabled: boolean;
57
101
  stepId: string | undefined;
102
+ hintText: string;
103
+ isCheckable: boolean;
104
+ isChecked: boolean;
105
+ isFocusable: boolean;
106
+ isFocused: boolean;
107
+ isLongClickable: boolean;
108
+ isPassword: boolean;
109
+ isSelected: boolean;
110
+ isVisibleToUser: boolean;
111
+ drawingOrder: number;
112
+ boundsInScreen: Bounds;
58
113
  });
59
114
  get async(): NodeAsync;
60
115
  /**
@@ -236,6 +291,17 @@ export declare class Node {
236
291
  isClickable: boolean;
237
292
  isEnabled: boolean;
238
293
  stepId: string | undefined;
294
+ hintText: string;
295
+ isCheckable: boolean;
296
+ isChecked: boolean;
297
+ isFocusable: boolean;
298
+ isFocused: boolean;
299
+ isLongClickable: boolean;
300
+ isPassword: boolean;
301
+ isSelected: boolean;
302
+ isVisibleToUser: boolean;
303
+ drawingOrder: number;
304
+ boundsInScreen: Bounds;
239
305
  }): Node;
240
306
  /**
241
307
  * 从JSON数组创建节点数组
package/dist/Node.js CHANGED
@@ -17,6 +17,17 @@ export class Node {
17
17
  this.isClickable = params.isClickable;
18
18
  this.isEnabled = params.isEnabled;
19
19
  this.stepId = params.stepId;
20
+ this.hintText = params.hintText;
21
+ this.isCheckable = params.isCheckable;
22
+ this.isChecked = params.isChecked;
23
+ this.isFocusable = params.isFocusable;
24
+ this.isFocused = params.isFocused;
25
+ this.isLongClickable = params.isLongClickable;
26
+ this.isPassword = params.isPassword;
27
+ this.isSelected = params.isSelected;
28
+ this.isVisibleToUser = params.isVisibleToUser;
29
+ this.drawingOrder = params.drawingOrder;
30
+ this.boundsInScreen = params.boundsInScreen;
20
31
  }
21
32
  get async() {
22
33
  return new NodeAsync(this);
@@ -190,6 +190,17 @@ export declare class NodeAsync {
190
190
  isClickable: boolean;
191
191
  isEnabled: boolean;
192
192
  stepId: string | undefined;
193
+ hintText: string;
194
+ isCheckable: boolean;
195
+ isChecked: boolean;
196
+ isFocusable: boolean;
197
+ isFocused: boolean;
198
+ isLongClickable: boolean;
199
+ isPassword: boolean;
200
+ isSelected: boolean;
201
+ isVisibleToUser: boolean;
202
+ drawingOrder: number;
203
+ boundsInScreen: Bounds;
193
204
  }): Node;
194
205
  /**
195
206
  * 从JSON数组创建节点数组
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.2005",
3
+ "version": "0.0.2011",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/src/Bounds.ts CHANGED
@@ -1,40 +1,114 @@
1
1
  // Bounds 类,对应 Kotlin 的 data class
2
2
  export class Bounds {
3
- // 构造函数
4
- constructor(
5
- public readonly left: number,
6
- public readonly top: number,
7
- public readonly right: number,
8
- public readonly bottom: number
9
- ) { }
3
+ // 构造函数
4
+ constructor(
5
+ public readonly left: number,
6
+ public readonly top: number,
7
+ public readonly right: number,
8
+ public readonly bottom: number,
9
+ public readonly width: number,
10
+ public readonly height: number,
11
+ public readonly centerX: number,
12
+ public readonly centerY: number,
13
+ public readonly exactCenterX: number,
14
+ public readonly exactCenterY: number,
15
+ public readonly isEmpty: boolean
16
+ ) {}
10
17
 
11
- // 从普通对象创建 Bounds 实例
12
- static from(data: { left: number; top: number; right: number; bottom: number }): Bounds {
13
- return new Bounds(data.left, data.top, data.right, data.bottom);
14
- }
18
+ // 从普通对象创建 Bounds 实例
19
+ static from(data: {
20
+ left: number;
21
+ top: number;
22
+ right: number;
23
+ bottom: number;
24
+ width: number;
25
+ height: number;
26
+ centerX: number;
27
+ centerY: number;
28
+ exactCenterX: number;
29
+ exactCenterY: number;
30
+ isEmpty: boolean;
31
+ }): Bounds {
32
+ return new Bounds(
33
+ data.left,
34
+ data.top,
35
+ data.right,
36
+ data.bottom,
37
+ data.width,
38
+ data.height,
39
+ data.centerX,
40
+ data.centerY,
41
+ data.exactCenterX,
42
+ data.exactCenterY,
43
+ data.isEmpty
44
+ );
45
+ }
15
46
 
16
- // 从 JSON 字符串创建实例
17
- static fromJSON(json: string): Bounds {
18
- const data = JSON.parse(json);
19
- return Bounds.from(data);
20
- }
47
+ // 从 JSON 字符串创建实例
48
+ static fromJSON(json: string): Bounds {
49
+ const data = JSON.parse(json);
50
+ return Bounds.from(data);
51
+ }
21
52
 
22
- static fromData(data: any): Bounds {
23
- return new Bounds(data.left, data.top, data.right, data.bottom);
24
- }
53
+ static fromData(data: any): Bounds {
54
+ return new Bounds(
55
+ data.left,
56
+ data.top,
57
+ data.right,
58
+ data.bottom,
59
+ data.width,
60
+ data.height,
61
+ data.centerX,
62
+ data.centerY,
63
+ data.exactCenterX,
64
+ data.exactCenterY,
65
+ data.isEmpty
66
+ );
67
+ }
25
68
 
26
- // 转换为普通对象
27
- toJSON(): { left: number; top: number; right: number; bottom: number } {
28
- return {
29
- left: this.left,
30
- top: this.top,
31
- right: this.right,
32
- bottom: this.bottom
33
- };
34
- }
69
+ // 转换为普通对象
70
+ toJSON(): {
71
+ left: number;
72
+ top: number;
73
+ right: number;
74
+ bottom: number;
75
+ width: number;
76
+ height: number;
77
+ centerX: number;
78
+ centerY: number;
79
+ exactCenterX: number;
80
+ exactCenterY: number;
81
+ isEmpty: boolean;
82
+ } {
83
+ return {
84
+ left: this.left,
85
+ top: this.top,
86
+ right: this.right,
87
+ bottom: this.bottom,
88
+ width: this.width,
89
+ height: this.height,
90
+ centerX: this.centerX,
91
+ centerY: this.centerY,
92
+ exactCenterX: this.exactCenterX,
93
+ exactCenterY: this.exactCenterY,
94
+ isEmpty: this.isEmpty,
95
+ };
96
+ }
35
97
 
36
- // 克隆方法
37
- clone(): Bounds {
38
- return new Bounds(this.left, this.top, this.right, this.bottom);
39
- }
40
- }
98
+ // 克隆方法
99
+ clone(): Bounds {
100
+ return new Bounds(
101
+ this.left,
102
+ this.top,
103
+ this.right,
104
+ this.bottom,
105
+ this.width,
106
+ this.height,
107
+ this.centerX,
108
+ this.centerY,
109
+ this.exactCenterX,
110
+ this.exactCenterY,
111
+ this.isEmpty
112
+ );
113
+ }
114
+ }
package/src/Node.ts CHANGED
@@ -54,6 +54,61 @@ export class Node {
54
54
  */
55
55
  stepId: string | undefined;
56
56
 
57
+ /**
58
+ * 提示文本
59
+ */
60
+ hintText: string;
61
+
62
+ /**
63
+ * 是否可选择
64
+ */
65
+ isCheckable: boolean;
66
+
67
+ /**
68
+ * 是否已选中
69
+ */
70
+ isChecked: boolean;
71
+
72
+ /**
73
+ * 是否可聚焦
74
+ */
75
+ isFocusable: boolean;
76
+
77
+ /**
78
+ * 是否已聚焦
79
+ */
80
+ isFocused: boolean;
81
+
82
+ /**
83
+ * 是否可长按
84
+ */
85
+ isLongClickable: boolean;
86
+
87
+ /**
88
+ * 是否为密码字段
89
+ */
90
+ isPassword: boolean;
91
+
92
+ /**
93
+ * 是否已选中
94
+ */
95
+ isSelected: boolean;
96
+
97
+ /**
98
+ * 是否对用户可见
99
+ */
100
+ isVisibleToUser: boolean;
101
+
102
+ /**
103
+ * 绘制顺序
104
+ */
105
+ drawingOrder: number;
106
+
107
+ /**
108
+ * 节点在屏幕中的边界
109
+ */
110
+ boundsInScreen: Bounds;
111
+
57
112
  /**
58
113
  * 构造函数
59
114
  * @param params 节点参数对象
@@ -68,6 +123,17 @@ export class Node {
68
123
  isClickable: boolean;
69
124
  isEnabled: boolean;
70
125
  stepId: string | undefined;
126
+ hintText: string;
127
+ isCheckable: boolean;
128
+ isChecked: boolean;
129
+ isFocusable: boolean;
130
+ isFocused: boolean;
131
+ isLongClickable: boolean;
132
+ isPassword: boolean;
133
+ isSelected: boolean;
134
+ isVisibleToUser: boolean;
135
+ drawingOrder: number;
136
+ boundsInScreen: Bounds;
71
137
  }) {
72
138
  this.nodeId = params.nodeId;
73
139
  this.text = params.text;
@@ -78,6 +144,17 @@ export class Node {
78
144
  this.isClickable = params.isClickable;
79
145
  this.isEnabled = params.isEnabled;
80
146
  this.stepId = params.stepId;
147
+ this.hintText = params.hintText;
148
+ this.isCheckable = params.isCheckable;
149
+ this.isChecked = params.isChecked;
150
+ this.isFocusable = params.isFocusable;
151
+ this.isFocused = params.isFocused;
152
+ this.isLongClickable = params.isLongClickable;
153
+ this.isPassword = params.isPassword;
154
+ this.isSelected = params.isSelected;
155
+ this.isVisibleToUser = params.isVisibleToUser;
156
+ this.drawingOrder = params.drawingOrder;
157
+ this.boundsInScreen = params.boundsInScreen;
81
158
  }
82
159
 
83
160
  public get async(): NodeAsync {
@@ -453,6 +530,17 @@ export class Node {
453
530
  isClickable: boolean;
454
531
  isEnabled: boolean;
455
532
  stepId: string | undefined;
533
+ hintText: string;
534
+ isCheckable: boolean;
535
+ isChecked: boolean;
536
+ isFocusable: boolean;
537
+ isFocused: boolean;
538
+ isLongClickable: boolean;
539
+ isPassword: boolean;
540
+ isSelected: boolean;
541
+ isVisibleToUser: boolean;
542
+ drawingOrder: number;
543
+ boundsInScreen: Bounds;
456
544
  }): Node {
457
545
  return new Node(params);
458
546
  }
package/src/NodeAsync.ts CHANGED
@@ -396,6 +396,17 @@ export class NodeAsync {
396
396
  isClickable: boolean;
397
397
  isEnabled: boolean;
398
398
  stepId: string | undefined;
399
+ hintText: string;
400
+ isCheckable: boolean;
401
+ isChecked: boolean;
402
+ isFocusable: boolean;
403
+ isFocused: boolean;
404
+ isLongClickable: boolean;
405
+ isPassword: boolean;
406
+ isSelected: boolean;
407
+ isVisibleToUser: boolean;
408
+ drawingOrder: number;
409
+ boundsInScreen: Bounds;
399
410
  }): Node {
400
411
  return new Node(params);
401
412
  }