assistsx-js 0.0.2050 → 0.0.2052

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/Step.js CHANGED
@@ -100,12 +100,12 @@ export class Step {
100
100
  else {
101
101
  nextStep = await ((_e = currentStep.impl) === null || _e === void 0 ? void 0 : _e.call(currentStep, currentStep));
102
102
  }
103
- if (currentStep.repeatCountMax > Step.repeatCountInfinite &&
104
- currentStep.repeatCount > currentStep.repeatCountMax) {
103
+ if (currentStep.repeatCountMax >= Step.repeatCountInfinite &&
104
+ currentStep.repeatCount >= currentStep.repeatCountMax) {
105
105
  if (Step.showLog) {
106
106
  console.log(`重复次数${currentStep.repeatCount}超过最大次数${currentStep.repeatCountMax},停止执行`);
107
107
  }
108
- break;
108
+ throw new StepError("步骤重复次数达到最大次数", { stepId: currentStep.stepId, repeatCount: currentStep.repeatCount, repeatCountMax: currentStep.repeatCountMax });
109
109
  }
110
110
  Step.assert(currentStep.stepId);
111
111
  if (nextStep) {
package/dist/index.d.ts CHANGED
@@ -14,3 +14,4 @@ export * from "./StepAsync";
14
14
  export * from "./AccessibilityEventFilter";
15
15
  export * from "./AppInfo";
16
16
  export * from "./DeviceInfo";
17
+ export * from "./StepError";
package/dist/index.js CHANGED
@@ -14,3 +14,4 @@ export * from "./StepAsync";
14
14
  export * from "./AccessibilityEventFilter";
15
15
  export * from "./AppInfo";
16
16
  export * from "./DeviceInfo";
17
+ export * from "./StepError";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "assistsx-js",
3
- "version": "0.0.2050",
3
+ "version": "0.0.2052",
4
4
  "description": "assistsx-js自动化开发SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
package/src/Step.ts CHANGED
@@ -152,15 +152,15 @@ export class Step {
152
152
  nextStep = await currentStep.impl?.(currentStep);
153
153
  }
154
154
  if (
155
- currentStep.repeatCountMax > Step.repeatCountInfinite &&
156
- currentStep.repeatCount > currentStep.repeatCountMax
155
+ currentStep.repeatCountMax >= Step.repeatCountInfinite &&
156
+ currentStep.repeatCount >= currentStep.repeatCountMax
157
157
  ) {
158
158
  if (Step.showLog) {
159
159
  console.log(
160
160
  `重复次数${currentStep.repeatCount}超过最大次数${currentStep.repeatCountMax},停止执行`
161
161
  );
162
162
  }
163
- break;
163
+ throw new StepError("步骤重复次数达到最大次数", { stepId: currentStep.stepId, repeatCount: currentStep.repeatCount, repeatCountMax: currentStep.repeatCountMax });
164
164
  }
165
165
 
166
166
  Step.assert(currentStep.stepId);
package/src/StepAsync.ts CHANGED
@@ -12,354 +12,354 @@ import { AssistsXAsync } from "./AssistsXAsync";
12
12
  import { Step } from "./Step";
13
13
 
14
14
  export class StepAsync {
15
- private step: Step;
15
+ private step: Step;
16
16
 
17
- /**
18
- * 构造函数
19
- * @param step Step实例
20
- */
21
- constructor(step: Step) {
22
- this.step = step;
23
- }
17
+ /**
18
+ * 构造函数
19
+ * @param step Step实例
20
+ */
21
+ constructor(step: Step) {
22
+ this.step = step;
23
+ }
24
24
 
25
- /**
26
- * 对单个节点进行截图
27
- * @param node 目标节点
28
- * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
29
- * @returns 截图路径
30
- */
31
- public async takeScreenshotByNode(
32
- node: Node,
33
- overlayHiddenScreenshotDelayMillis: number = 250
34
- ): Promise<string> {
35
- Step.assert(this.step.stepId);
36
- const result = await AssistsXAsync.takeScreenshotNodes(
37
- [node],
38
- overlayHiddenScreenshotDelayMillis
39
- );
40
- Step.assert(this.step.stepId);
41
- return result[0];
42
- }
25
+ /**
26
+ * 对单个节点进行截图
27
+ * @param node 目标节点
28
+ * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
29
+ * @returns 截图路径
30
+ */
31
+ public async takeScreenshotByNode(
32
+ node: Node,
33
+ overlayHiddenScreenshotDelayMillis: number = 250
34
+ ): Promise<string> {
35
+ Step.assert(this.step.stepId);
36
+ const result = await AssistsXAsync.takeScreenshotNodes(
37
+ [node],
38
+ overlayHiddenScreenshotDelayMillis
39
+ );
40
+ Step.assert(this.step.stepId);
41
+ return result[0];
42
+ }
43
43
 
44
- /**
45
- * 对多个节点进行截图
46
- * @param nodes 目标节点数组
47
- * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
48
- * @returns 截图路径数组
49
- */
50
- public async takeScreenshotNodes(
51
- nodes: Node[],
52
- overlayHiddenScreenshotDelayMillis: number = 250
53
- ): Promise<string[]> {
54
- Step.assert(this.step.stepId);
55
- const result = await AssistsXAsync.takeScreenshotNodes(
56
- nodes,
57
- overlayHiddenScreenshotDelayMillis
58
- );
59
- Step.assert(this.step.stepId);
60
- return result;
61
- }
44
+ /**
45
+ * 对多个节点进行截图
46
+ * @param nodes 目标节点数组
47
+ * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
48
+ * @returns 截图路径数组
49
+ */
50
+ public async takeScreenshotNodes(
51
+ nodes: Node[],
52
+ overlayHiddenScreenshotDelayMillis: number = 250
53
+ ): Promise<string[]> {
54
+ Step.assert(this.step.stepId);
55
+ const result = await AssistsXAsync.takeScreenshotNodes(
56
+ nodes,
57
+ overlayHiddenScreenshotDelayMillis
58
+ );
59
+ Step.assert(this.step.stepId);
60
+ return result;
61
+ }
62
62
 
63
- /**
64
- * 获取所有符合条件的节点
65
- * @param filterClass 类名过滤
66
- * @param filterViewId 视图ID过滤
67
- * @param filterDes 描述过滤
68
- * @param filterText 文本过滤
69
- * @returns 节点数组
70
- */
71
- public async getAllNodes({
72
- filterClass,
73
- filterViewId,
74
- filterDes,
75
- filterText,
76
- }: {
77
- filterClass?: string;
78
- filterViewId?: string;
79
- filterDes?: string;
80
- filterText?: string;
81
- } = {}): Promise<Node[]> {
82
- Step.assert(this.step.stepId);
83
- const nodes = await AssistsXAsync.getAllNodes({
84
- filterClass,
85
- filterViewId,
86
- filterDes,
87
- filterText,
88
- });
89
- Step.assert(this.step.stepId);
90
- Step.assignIdsToNodes(nodes, this.step.stepId);
91
- return nodes;
92
- }
63
+ /**
64
+ * 获取所有符合条件的节点
65
+ * @param filterClass 类名过滤
66
+ * @param filterViewId 视图ID过滤
67
+ * @param filterDes 描述过滤
68
+ * @param filterText 文本过滤
69
+ * @returns 节点数组
70
+ */
71
+ public async getAllNodes({
72
+ filterClass,
73
+ filterViewId,
74
+ filterDes,
75
+ filterText,
76
+ }: {
77
+ filterClass?: string;
78
+ filterViewId?: string;
79
+ filterDes?: string;
80
+ filterText?: string;
81
+ } = {}): Promise<Node[]> {
82
+ Step.assert(this.step.stepId);
83
+ const nodes = await AssistsXAsync.getAllNodes({
84
+ filterClass,
85
+ filterViewId,
86
+ filterDes,
87
+ filterText,
88
+ });
89
+ Step.assert(this.step.stepId);
90
+ Step.assignIdsToNodes(nodes, this.step.stepId);
91
+ return nodes;
92
+ }
93
93
 
94
- /**
95
- * 启动应用
96
- * @param packageName 应用包名
97
- * @returns 是否启动成功
98
- */
99
- public async launchApp(packageName: string): Promise<boolean> {
100
- Step.assert(this.step.stepId);
101
- const result = await AssistsXAsync.launchApp(packageName);
102
- Step.assert(this.step.stepId);
103
- return result;
104
- }
94
+ /**
95
+ * 启动应用
96
+ * @param packageName 应用包名
97
+ * @returns 是否启动成功
98
+ */
99
+ public async launchApp(packageName: string): Promise<boolean> {
100
+ Step.assert(this.step.stepId);
101
+ const result = await AssistsXAsync.launchApp(packageName);
102
+ Step.assert(this.step.stepId);
103
+ return result;
104
+ }
105
105
 
106
- /**
107
- * 获取当前应用包名
108
- * @returns 包名
109
- */
110
- public async getPackageName(): Promise<string> {
111
- Step.assert(this.step.stepId);
112
- const result = await AssistsXAsync.getPackageName();
113
- Step.assert(this.step.stepId);
114
- return result;
115
- }
106
+ /**
107
+ * 获取当前应用包名
108
+ * @returns 包名
109
+ */
110
+ public async getPackageName(): Promise<string> {
111
+ Step.assert(this.step.stepId);
112
+ const result = await AssistsXAsync.getPackageName();
113
+ Step.assert(this.step.stepId);
114
+ return result;
115
+ }
116
116
 
117
- /**
118
- * 通过ID查找节点
119
- * @param id 节点ID
120
- * @param filterClass 类名过滤
121
- * @param filterText 文本过滤
122
- * @param filterDes 描述过滤
123
- * @returns 节点数组
124
- */
125
- public async findById(
126
- id: string,
127
- {
128
- filterClass,
129
- filterText,
130
- filterDes,
131
- }: { filterClass?: string; filterText?: string; filterDes?: string } = {}
132
- ): Promise<Node[]> {
133
- Step.assert(this.step.stepId);
134
- const nodes = await AssistsXAsync.findById(id, {
135
- filterClass,
136
- filterText,
137
- filterDes,
138
- });
139
- Step.assert(this.step.stepId);
140
- Step.assignIdsToNodes(nodes, this.step.stepId);
141
- return nodes;
142
- }
117
+ /**
118
+ * 通过ID查找节点
119
+ * @param id 节点ID
120
+ * @param filterClass 类名过滤
121
+ * @param filterText 文本过滤
122
+ * @param filterDes 描述过滤
123
+ * @returns 节点数组
124
+ */
125
+ public async findById(
126
+ id: string,
127
+ {
128
+ filterClass,
129
+ filterText,
130
+ filterDes,
131
+ }: { filterClass?: string; filterText?: string; filterDes?: string } = {}
132
+ ): Promise<Node[]> {
133
+ Step.assert(this.step.stepId);
134
+ const nodes = await AssistsXAsync.findById(id, {
135
+ filterClass,
136
+ filterText,
137
+ filterDes,
138
+ });
139
+ Step.assert(this.step.stepId);
140
+ Step.assignIdsToNodes(nodes, this.step.stepId);
141
+ return nodes;
142
+ }
143
143
 
144
- /**
145
- * 通过文本查找节点
146
- * @param text 要查找的文本
147
- * @param filterClass 类名过滤
148
- * @param filterViewId 视图ID过滤
149
- * @param filterDes 描述过滤
150
- * @returns 节点数组
151
- */
152
- public async findByText(
153
- text: string,
154
- {
155
- filterClass,
156
- filterViewId,
157
- filterDes,
158
- }: { filterClass?: string; filterViewId?: string; filterDes?: string } = {}
159
- ): Promise<Node[]> {
160
- Step.assert(this.step.stepId);
161
- const nodes = await AssistsXAsync.findByText(text, {
162
- filterClass,
163
- filterViewId,
164
- filterDes,
165
- });
166
- Step.assert(this.step.stepId);
167
- Step.assignIdsToNodes(nodes, this.step.stepId);
168
- return nodes;
169
- }
144
+ /**
145
+ * 通过文本查找节点
146
+ * @param text 要查找的文本
147
+ * @param filterClass 类名过滤
148
+ * @param filterViewId 视图ID过滤
149
+ * @param filterDes 描述过滤
150
+ * @returns 节点数组
151
+ */
152
+ public async findByText(
153
+ text: string,
154
+ {
155
+ filterClass,
156
+ filterViewId,
157
+ filterDes,
158
+ }: { filterClass?: string; filterViewId?: string; filterDes?: string } = {}
159
+ ): Promise<Node[]> {
160
+ Step.assert(this.step.stepId);
161
+ const nodes = await AssistsXAsync.findByText(text, {
162
+ filterClass,
163
+ filterViewId,
164
+ filterDes,
165
+ });
166
+ Step.assert(this.step.stepId);
167
+ Step.assignIdsToNodes(nodes, this.step.stepId);
168
+ return nodes;
169
+ }
170
170
 
171
- /**
172
- * 通过标签查找节点
173
- * @param className 类名
174
- * @param filterText 文本过滤
175
- * @param filterViewId 视图ID过滤
176
- * @param filterDes 描述过滤
177
- * @returns 节点数组
178
- */
179
- public async findByTags(
180
- className: string,
181
- {
182
- filterText,
183
- filterViewId,
184
- filterDes,
185
- }: { filterText?: string; filterViewId?: string; filterDes?: string } = {}
186
- ): Promise<Node[]> {
187
- Step.assert(this.step.stepId);
188
- const nodes = await AssistsXAsync.findByTags(className, {
189
- filterText,
190
- filterViewId,
191
- filterDes,
192
- });
193
- Step.assert(this.step.stepId);
194
- Step.assignIdsToNodes(nodes, this.step.stepId);
195
- return nodes;
196
- }
171
+ /**
172
+ * 通过标签查找节点
173
+ * @param className 类名
174
+ * @param filterText 文本过滤
175
+ * @param filterViewId 视图ID过滤
176
+ * @param filterDes 描述过滤
177
+ * @returns 节点数组
178
+ */
179
+ public async findByTags(
180
+ className: string,
181
+ {
182
+ filterText,
183
+ filterViewId,
184
+ filterDes,
185
+ }: { filterText?: string; filterViewId?: string; filterDes?: string } = {}
186
+ ): Promise<Node[]> {
187
+ Step.assert(this.step.stepId);
188
+ const nodes = await AssistsXAsync.findByTags(className, {
189
+ filterText,
190
+ filterViewId,
191
+ filterDes,
192
+ });
193
+ Step.assert(this.step.stepId);
194
+ Step.assignIdsToNodes(nodes, this.step.stepId);
195
+ return nodes;
196
+ }
197
197
 
198
- /**
199
- * 查找所有匹配文本的节点
200
- * @param text 要查找的文本
201
- * @returns 节点数组
202
- */
203
- public async findByTextAllMatch(text: string): Promise<Node[]> {
204
- Step.assert(this.step.stepId);
205
- const nodes = await AssistsXAsync.findByTextAllMatch(text);
206
- Step.assert(this.step.stepId);
207
- Step.assignIdsToNodes(nodes, this.step.stepId);
208
- return nodes;
209
- }
198
+ /**
199
+ * 查找所有匹配文本的节点
200
+ * @param text 要查找的文本
201
+ * @returns 节点数组
202
+ */
203
+ public async findByTextAllMatch(text: string): Promise<Node[]> {
204
+ Step.assert(this.step.stepId);
205
+ const nodes = await AssistsXAsync.findByTextAllMatch(text);
206
+ Step.assert(this.step.stepId);
207
+ Step.assignIdsToNodes(nodes, this.step.stepId);
208
+ return nodes;
209
+ }
210
210
 
211
- /**
212
- * 检查是否包含指定文本
213
- * @param text 要检查的文本
214
- * @returns 是否包含
215
- */
216
- public async containsText(text: string): Promise<boolean> {
217
- Step.assert(this.step.stepId);
218
- const result = await AssistsXAsync.containsText(text);
219
- Step.assert(this.step.stepId);
220
- return result;
221
- }
211
+ /**
212
+ * 检查是否包含指定文本
213
+ * @param text 要检查的文本
214
+ * @returns 是否包含
215
+ */
216
+ public async containsText(text: string): Promise<boolean> {
217
+ Step.assert(this.step.stepId);
218
+ const result = await AssistsXAsync.containsText(text);
219
+ Step.assert(this.step.stepId);
220
+ return result;
221
+ }
222
222
 
223
- /**
224
- * 获取所有文本
225
- * @returns 文本数组
226
- */
227
- public async getAllText(): Promise<string[]> {
228
- Step.assert(this.step.stepId);
229
- const texts = await AssistsXAsync.getAllText();
230
- Step.assert(this.step.stepId);
231
- return texts;
232
- }
223
+ /**
224
+ * 获取所有文本
225
+ * @returns 文本数组
226
+ */
227
+ public async getAllText(): Promise<string[]> {
228
+ Step.assert(this.step.stepId);
229
+ const texts = await AssistsXAsync.getAllText();
230
+ Step.assert(this.step.stepId);
231
+ return texts;
232
+ }
233
233
 
234
- /**
235
- * 执行点击手势
236
- * @param x 横坐标
237
- * @param y 纵坐标
238
- * @param duration 持续时间(毫秒)
239
- * @returns 是否成功
240
- */
241
- public async clickByGesture(
242
- x: number,
243
- y: number,
244
- duration: number
245
- ): Promise<boolean> {
246
- Step.assert(this.step.stepId);
247
- const result = await AssistsXAsync.clickByGesture(x, y, duration);
248
- Step.assert(this.step.stepId);
249
- return result;
250
- }
234
+ /**
235
+ * 执行点击手势
236
+ * @param x 横坐标
237
+ * @param y 纵坐标
238
+ * @param duration 持续时间(毫秒)
239
+ * @returns 是否成功
240
+ */
241
+ public async clickByGesture(
242
+ x: number,
243
+ y: number,
244
+ duration: number
245
+ ): Promise<boolean> {
246
+ Step.assert(this.step.stepId);
247
+ const result = await AssistsXAsync.clickByGesture(x, y, duration);
248
+ Step.assert(this.step.stepId);
249
+ return result;
250
+ }
251
251
 
252
- public async longPressGestureAutoPaste(
253
- point: { x: number; y: number },
254
- text: string,
255
- {
256
- matchedPackageName,
257
- matchedText,
258
- timeoutMillis,
259
- longPressDuration,
260
- }: {
261
- matchedPackageName?: string;
262
- matchedText?: string;
263
- timeoutMillis?: number;
264
- longPressDuration?: number;
265
- } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
266
- ): Promise<boolean> {
267
- Step.assert(this.step.stepId);
268
- const result = await AssistsXAsync.longPressGestureAutoPaste(point, text, {
269
- matchedPackageName,
270
- matchedText,
271
- timeoutMillis,
272
- longPressDuration,
273
- });
274
- Step.assert(this.step.stepId);
275
- return result;
276
- }
277
- public async getAppInfo(packageName: string): Promise<any> {
278
- Step.assert(this.step.stepId);
279
- const result = await AssistsXAsync.getAppInfo(packageName);
280
- Step.assert(this.step.stepId);
281
- return result;
282
- }
283
- public async performLinearGesture(
284
- startPoint: { x: number; y: number },
285
- endPoint: { x: number; y: number },
286
- { duration }: { duration?: number } = {}
287
- ): Promise<boolean> {
288
- Step.assert(this.step.stepId);
289
- const result = await AssistsXAsync.performLinearGesture(
290
- startPoint,
291
- endPoint,
292
- {
293
- duration,
294
- }
295
- );
296
- Step.assert(this.step.stepId);
297
- return result;
298
- }
252
+ public async longPressGestureAutoPaste(
253
+ point: { x: number; y: number },
254
+ text: string,
255
+ {
256
+ matchedPackageName,
257
+ matchedText,
258
+ timeoutMillis,
259
+ longPressDuration,
260
+ }: {
261
+ matchedPackageName?: string;
262
+ matchedText?: string;
263
+ timeoutMillis?: number;
264
+ longPressDuration?: number;
265
+ } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
266
+ ): Promise<boolean> {
267
+ Step.assert(this.step.stepId);
268
+ const result = await AssistsXAsync.longPressGestureAutoPaste(point, text, {
269
+ matchedPackageName,
270
+ matchedText,
271
+ timeoutMillis,
272
+ longPressDuration,
273
+ });
274
+ Step.assert(this.step.stepId);
275
+ return result;
276
+ }
277
+ public async getAppInfo(packageName: string): Promise<any> {
278
+ Step.assert(this.step.stepId);
279
+ const result = await AssistsXAsync.getAppInfo(packageName);
280
+ Step.assert(this.step.stepId);
281
+ return result;
282
+ }
283
+ public async performLinearGesture(
284
+ startPoint: { x: number; y: number },
285
+ endPoint: { x: number; y: number },
286
+ { duration }: { duration?: number } = {}
287
+ ): Promise<boolean> {
288
+ Step.assert(this.step.stepId);
289
+ const result = await AssistsXAsync.performLinearGesture(
290
+ startPoint,
291
+ endPoint,
292
+ {
293
+ duration,
294
+ }
295
+ );
296
+ Step.assert(this.step.stepId);
297
+ return result;
298
+ }
299
299
 
300
- /**
301
- * 返回操作
302
- * @returns 是否成功
303
- */
304
- public async back(): Promise<boolean> {
305
- Step.assert(this.step.stepId);
306
- const result = await AssistsXAsync.back();
307
- Step.assert(this.step.stepId);
308
- return result;
309
- }
300
+ /**
301
+ * 返回操作
302
+ * @returns 是否成功
303
+ */
304
+ public async back(): Promise<boolean> {
305
+ Step.assert(this.step.stepId);
306
+ const result = await AssistsXAsync.back();
307
+ Step.assert(this.step.stepId);
308
+ return result;
309
+ }
310
310
 
311
- /**
312
- * 回到主页
313
- * @returns 是否成功
314
- */
315
- public async home(): Promise<boolean> {
316
- Step.assert(this.step.stepId);
317
- const result = await AssistsXAsync.home();
318
- Step.assert(this.step.stepId);
319
- return result;
320
- }
311
+ /**
312
+ * 回到主页
313
+ * @returns 是否成功
314
+ */
315
+ public async home(): Promise<boolean> {
316
+ Step.assert(this.step.stepId);
317
+ const result = await AssistsXAsync.home();
318
+ Step.assert(this.step.stepId);
319
+ return result;
320
+ }
321
321
 
322
- /**
323
- * 打开通知栏
324
- * @returns 是否成功
325
- */
326
- public async notifications(): Promise<boolean> {
327
- Step.assert(this.step.stepId);
328
- const result = await AssistsXAsync.notifications();
329
- Step.assert(this.step.stepId);
330
- return result;
331
- }
322
+ /**
323
+ * 打开通知栏
324
+ * @returns 是否成功
325
+ */
326
+ public async notifications(): Promise<boolean> {
327
+ Step.assert(this.step.stepId);
328
+ const result = await AssistsXAsync.notifications();
329
+ Step.assert(this.step.stepId);
330
+ return result;
331
+ }
332
332
 
333
- /**
334
- * 显示最近应用
335
- * @returns 是否成功
336
- */
337
- public async recentApps(): Promise<boolean> {
338
- Step.assert(this.step.stepId);
339
- const result = await AssistsXAsync.recentApps();
340
- Step.assert(this.step.stepId);
341
- return result;
342
- }
333
+ /**
334
+ * 显示最近应用
335
+ * @returns 是否成功
336
+ */
337
+ public async recentApps(): Promise<boolean> {
338
+ Step.assert(this.step.stepId);
339
+ const result = await AssistsXAsync.recentApps();
340
+ Step.assert(this.step.stepId);
341
+ return result;
342
+ }
343
343
 
344
- /**
345
- * 获取屏幕尺寸
346
- * @returns 屏幕尺寸对象
347
- */
348
- public async getScreenSize(): Promise<any> {
349
- Step.assert(this.step.stepId);
350
- const data = await AssistsXAsync.getScreenSize();
351
- Step.assert(this.step.stepId);
352
- return data;
353
- }
344
+ /**
345
+ * 获取屏幕尺寸
346
+ * @returns 屏幕尺寸对象
347
+ */
348
+ public async getScreenSize(): Promise<any> {
349
+ Step.assert(this.step.stepId);
350
+ const data = await AssistsXAsync.getScreenSize();
351
+ Step.assert(this.step.stepId);
352
+ return data;
353
+ }
354
354
 
355
- /**
356
- * 获取应用窗口尺寸
357
- * @returns 应用窗口尺寸对象
358
- */
359
- public async getAppScreenSize(): Promise<any> {
360
- Step.assert(this.step.stepId);
361
- const data = await AssistsXAsync.getAppScreenSize();
362
- Step.assert(this.step.stepId);
363
- return data;
364
- }
355
+ /**
356
+ * 获取应用窗口尺寸
357
+ * @returns 应用窗口尺寸对象
358
+ */
359
+ public async getAppScreenSize(): Promise<any> {
360
+ Step.assert(this.step.stepId);
361
+ const data = await AssistsXAsync.getAppScreenSize();
362
+ Step.assert(this.step.stepId);
363
+ return data;
364
+ }
365
365
  }
package/src/index.ts CHANGED
@@ -14,3 +14,4 @@ export * from "./StepAsync";
14
14
  export * from "./AccessibilityEventFilter";
15
15
  export * from "./AppInfo";
16
16
  export * from "./DeviceInfo";
17
+ export * from "./StepError";