assistsx-js 0.0.1352 → 0.0.2001

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/src/Node.ts CHANGED
@@ -2,350 +2,455 @@
2
2
  * 节点类
3
3
  * 表示界面上的一个可交互元素,包含元素的属性和可执行的操作
4
4
  */
5
- import { Bounds } from './Bounds';
6
- import { AssistsX } from './AssistsX';
7
- import { Step } from './Step';
5
+ import { Bounds } from "./Bounds";
6
+ import { AssistsX } from "./AssistsX";
7
+ import { Step } from "./Step";
8
+ import { NodeAsync } from "./NodeAsync";
8
9
 
9
10
  // 将接口改造为类
10
11
  export class Node {
11
- /**
12
- * 节点唯一标识
13
- */
14
- nodeId: string;
12
+ /**
13
+ * 节点唯一标识
14
+ */
15
+ nodeId: string;
15
16
 
16
- /**
17
- * 节点文本内容
18
- */
19
- text: string;
17
+ /**
18
+ * 节点文本内容
19
+ */
20
+ text: string;
20
21
 
21
- /**
22
- * 节点描述信息
23
- */
24
- des: string;
22
+ /**
23
+ * 节点描述信息
24
+ */
25
+ des: string;
25
26
 
26
- /**
27
- * 节点视图ID
28
- */
29
- viewId: string;
27
+ /**
28
+ * 节点视图ID
29
+ */
30
+ viewId: string;
30
31
 
31
- /**
32
- * 节点类名
33
- */
34
- className: string;
32
+ /**
33
+ * 节点类名
34
+ */
35
+ className: string;
35
36
 
36
- /**
37
- * 是否可滚动
38
- */
39
- isScrollable: boolean;
37
+ /**
38
+ * 是否可滚动
39
+ */
40
+ isScrollable: boolean;
40
41
 
41
- /**
42
- * 是否可点击
43
- */
44
- isClickable: boolean;
42
+ /**
43
+ * 是否可点击
44
+ */
45
+ isClickable: boolean;
45
46
 
46
- /**
47
- * 是否启用
48
- */
49
- isEnabled: boolean;
47
+ /**
48
+ * 是否启用
49
+ */
50
+ isEnabled: boolean;
51
+
52
+ /**
53
+ * 所属步骤ID
54
+ */
55
+ stepId: string | undefined;
50
56
 
51
- /**
52
- * 所属步骤ID
53
- */
57
+ /**
58
+ * 构造函数
59
+ * @param params 节点参数对象
60
+ */
61
+ constructor(params: {
62
+ nodeId: string;
63
+ text: string;
64
+ des: string;
65
+ viewId: string;
66
+ className: string;
67
+ isScrollable: boolean;
68
+ isClickable: boolean;
69
+ isEnabled: boolean;
54
70
  stepId: string | undefined;
71
+ }) {
72
+ this.nodeId = params.nodeId;
73
+ this.text = params.text;
74
+ this.des = params.des;
75
+ this.viewId = params.viewId;
76
+ this.className = params.className;
77
+ this.isScrollable = params.isScrollable;
78
+ this.isClickable = params.isClickable;
79
+ this.isEnabled = params.isEnabled;
80
+ this.stepId = params.stepId;
81
+ }
55
82
 
56
- /**
57
- * 构造函数
58
- * @param params 节点参数对象
59
- */
60
- constructor(params: {
61
- nodeId: string;
62
- text: string;
63
- des: string;
64
- viewId: string;
65
- className: string;
66
- isScrollable: boolean;
67
- isClickable: boolean;
68
- isEnabled: boolean;
69
- stepId: string | undefined;
70
- }) {
71
- this.nodeId = params.nodeId;
72
- this.text = params.text;
73
- this.des = params.des;
74
- this.viewId = params.viewId;
75
- this.className = params.className;
76
- this.isScrollable = params.isScrollable;
77
- this.isClickable = params.isClickable;
78
- this.isEnabled = params.isEnabled;
79
- this.stepId = params.stepId;
80
- }
83
+ public get async(): NodeAsync {
84
+ return new NodeAsync(this);
85
+ }
81
86
 
82
- /**
83
- * 对节点执行点击手势
84
- * @param offsetX X轴偏移
85
- * @param offsetY Y轴偏移
86
- * @param switchWindowIntervalDelay 窗口切换延迟
87
- * @param clickDuration 点击持续时间
88
- * @returns 是否点击成功
89
- */
90
- public async clickNodeByGesture({ offsetX, offsetY, switchWindowIntervalDelay, clickDuration }: { offsetX?: number, offsetY?: number, switchWindowIntervalDelay?: number, clickDuration?: number } = {}): Promise<boolean> {
91
- Step.assert(this.stepId);
92
- const result = await AssistsX.clickNodeByGesture(this, { offsetX, offsetY, switchWindowIntervalDelay, clickDuration });
93
- Step.assert(this.stepId);
94
- return result;
95
- }
96
- /**
97
- * 对节点执行双击手势
98
- * @param offsetX X轴偏移
99
- * @param offsetY Y轴偏移
100
- * @param switchWindowIntervalDelay 窗口切换延迟
101
- * @param clickDuration 点击持续时间
102
- * @param clickInterval 点击间隔
103
- * @returns 是否双击成功
104
- */
105
- public async doubleClickNodeByGesture({ offsetX, offsetY, switchWindowIntervalDelay, clickDuration, clickInterval }: { offsetX?: number, offsetY?: number, switchWindowIntervalDelay?: number, clickDuration?: number, clickInterval?: number } = {}): Promise<boolean> {
106
- Step.assert(this.stepId);
107
- const result = await AssistsX.doubleClickNodeByGesture(this, { offsetX, offsetY, switchWindowIntervalDelay, clickDuration, clickInterval });
108
- Step.assert(this.stepId);
109
- return result;
110
- }
87
+ /**
88
+ * 对节点执行点击手势
89
+ * @param offsetX X轴偏移
90
+ * @param offsetY Y轴偏移
91
+ * @param switchWindowIntervalDelay 窗口切换延迟
92
+ * @param clickDuration 点击持续时间
93
+ * @returns 是否点击成功
94
+ */
95
+ public async clickNodeByGesture({
96
+ offsetX,
97
+ offsetY,
98
+ switchWindowIntervalDelay,
99
+ clickDuration,
100
+ }: {
101
+ offsetX?: number;
102
+ offsetY?: number;
103
+ switchWindowIntervalDelay?: number;
104
+ clickDuration?: number;
105
+ } = {}): Promise<boolean> {
106
+ Step.assert(this.stepId);
107
+ const result = await AssistsX.clickNodeByGesture(this, {
108
+ offsetX,
109
+ offsetY,
110
+ switchWindowIntervalDelay,
111
+ clickDuration,
112
+ });
113
+ Step.assert(this.stepId);
114
+ return result;
115
+ }
116
+ /**
117
+ * 对节点执行双击手势
118
+ * @param offsetX X轴偏移
119
+ * @param offsetY Y轴偏移
120
+ * @param switchWindowIntervalDelay 窗口切换延迟
121
+ * @param clickDuration 点击持续时间
122
+ * @param clickInterval 点击间隔
123
+ * @returns 是否双击成功
124
+ */
125
+ public async doubleClickNodeByGesture({
126
+ offsetX,
127
+ offsetY,
128
+ switchWindowIntervalDelay,
129
+ clickDuration,
130
+ clickInterval,
131
+ }: {
132
+ offsetX?: number;
133
+ offsetY?: number;
134
+ switchWindowIntervalDelay?: number;
135
+ clickDuration?: number;
136
+ clickInterval?: number;
137
+ } = {}): Promise<boolean> {
138
+ Step.assert(this.stepId);
139
+ const result = await AssistsX.doubleClickNodeByGesture(this, {
140
+ offsetX,
141
+ offsetY,
142
+ switchWindowIntervalDelay,
143
+ clickDuration,
144
+ clickInterval,
145
+ });
146
+ Step.assert(this.stepId);
147
+ return result;
148
+ }
111
149
 
112
- public async longPressNodeByGestureAutoPaste(text: string,
113
- { matchedPackageName, matchedText, timeoutMillis, longPressDuration }:
114
- { matchedPackageName?: string, matchedText?: string, timeoutMillis?: number, longPressDuration?: number } =
115
- { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
116
- ): Promise<boolean> {
117
- Step.assert(this.stepId);
118
- const result = await AssistsX.longPressNodeByGestureAutoPaste(this, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration });
119
- Step.assert(this.stepId);
120
- return result;
121
- }
150
+ public async longPressNodeByGestureAutoPaste(
151
+ text: string,
152
+ {
153
+ matchedPackageName,
154
+ matchedText,
155
+ timeoutMillis,
156
+ longPressDuration,
157
+ }: {
158
+ matchedPackageName?: string;
159
+ matchedText?: string;
160
+ timeoutMillis?: number;
161
+ longPressDuration?: number;
162
+ } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }
163
+ ): Promise<boolean> {
164
+ Step.assert(this.stepId);
165
+ const result = await AssistsX.longPressNodeByGestureAutoPaste(this, text, {
166
+ matchedPackageName,
167
+ matchedText,
168
+ timeoutMillis,
169
+ longPressDuration,
170
+ });
171
+ Step.assert(this.stepId);
172
+ return result;
173
+ }
122
174
 
123
- /**
124
- * 在当前节点范围内通过标签查找节点
125
- * @param className 类名
126
- * @param filterText 文本过滤
127
- * @param filterViewId 视图ID过滤
128
- * @param filterDes 描述过滤
129
- * @returns 节点数组
130
- */
131
- public findByTags(className: string, { filterText, filterViewId, filterDes }: { filterText?: string, filterViewId?: string, filterDes?: string, } = {}): Node[] {
132
- Step.assert(this.stepId);
133
- const result = AssistsX.findByTags(className, { filterText, filterViewId, filterDes, node: this });
134
- Step.assignIdsToNodes(result, this.stepId);
135
- Step.assert(this.stepId);
136
- return result;
137
- }
138
- /**
139
- * 在当前节点范围内通过ID查找节点
140
- * @param id 节点ID
141
- * @param filterClass 类名过滤
142
- * @param filterText 文本过滤
143
- * @param filterDes 描述过滤
144
- * @returns 节点数组
145
- */
146
- public findById(id: string, { filterClass, filterText, filterDes }: { filterClass?: string, filterText?: string, filterDes?: string } = {}): Node[] {
147
- Step.assert(this.stepId);
148
- const result = AssistsX.findById(id, { filterClass, filterText, filterDes, node: this });
149
- Step.assignIdsToNodes(result, this.stepId);
150
- Step.assert(this.stepId);
151
- return result;
152
- }
153
- /**
154
- * 在当前节点范围内通过文本查找节点
155
- * @param text 要查找的文本
156
- * @param filterClass 类名过滤
157
- * @param filterViewId 视图ID过滤
158
- * @param filterDes 描述过滤
159
- * @returns 节点数组
160
- */
161
- public findByText(text: string, { filterClass, filterViewId, filterDes }: { filterClass?: string, filterViewId?: string, filterDes?: string } = {}): Node[] {
162
- Step.assert(this.stepId);
163
- const result = AssistsX.findByText(text, { filterClass, filterViewId, filterDes, node: this });
164
- Step.assignIdsToNodes(result, this.stepId);
165
- Step.assert(this.stepId);
166
- return result;
167
- }
175
+ /**
176
+ * 在当前节点范围内通过标签查找节点
177
+ * @param className 类名
178
+ * @param filterText 文本过滤
179
+ * @param filterViewId 视图ID过滤
180
+ * @param filterDes 描述过滤
181
+ * @returns 节点数组
182
+ */
183
+ public findByTags(
184
+ className: string,
185
+ {
186
+ filterText,
187
+ filterViewId,
188
+ filterDes,
189
+ }: { filterText?: string; filterViewId?: string; filterDes?: string } = {}
190
+ ): Node[] {
191
+ Step.assert(this.stepId);
192
+ const result = AssistsX.findByTags(className, {
193
+ filterText,
194
+ filterViewId,
195
+ filterDes,
196
+ node: this,
197
+ });
198
+ Step.assignIdsToNodes(result, this.stepId);
199
+ Step.assert(this.stepId);
200
+ return result;
201
+ }
202
+ /**
203
+ * 在当前节点范围内通过ID查找节点
204
+ * @param id 节点ID
205
+ * @param filterClass 类名过滤
206
+ * @param filterText 文本过滤
207
+ * @param filterDes 描述过滤
208
+ * @returns 节点数组
209
+ */
210
+ public findById(
211
+ id: string,
212
+ {
213
+ filterClass,
214
+ filterText,
215
+ filterDes,
216
+ }: { filterClass?: string; filterText?: string; filterDes?: string } = {}
217
+ ): Node[] {
218
+ Step.assert(this.stepId);
219
+ const result = AssistsX.findById(id, {
220
+ filterClass,
221
+ filterText,
222
+ filterDes,
223
+ node: this,
224
+ });
225
+ Step.assignIdsToNodes(result, this.stepId);
226
+ Step.assert(this.stepId);
227
+ return result;
228
+ }
229
+ /**
230
+ * 在当前节点范围内通过文本查找节点
231
+ * @param text 要查找的文本
232
+ * @param filterClass 类名过滤
233
+ * @param filterViewId 视图ID过滤
234
+ * @param filterDes 描述过滤
235
+ * @returns 节点数组
236
+ */
237
+ public findByText(
238
+ text: string,
239
+ {
240
+ filterClass,
241
+ filterViewId,
242
+ filterDes,
243
+ }: { filterClass?: string; filterViewId?: string; filterDes?: string } = {}
244
+ ): Node[] {
245
+ Step.assert(this.stepId);
246
+ const result = AssistsX.findByText(text, {
247
+ filterClass,
248
+ filterViewId,
249
+ filterDes,
250
+ node: this,
251
+ });
252
+ Step.assignIdsToNodes(result, this.stepId);
253
+ Step.assert(this.stepId);
254
+ return result;
255
+ }
168
256
 
169
- /**
170
- * 向前滚动节点
171
- * @returns 是否滚动成功
172
- */
173
- public scrollForward(): boolean {
174
- Step.assert(this.stepId);
175
- const response = AssistsX.scrollForward(this);
176
- Step.assert(this.stepId);
177
- return response;
178
- }
257
+ /**
258
+ * 向前滚动节点
259
+ * @returns 是否滚动成功
260
+ */
261
+ public scrollForward(): boolean {
262
+ Step.assert(this.stepId);
263
+ const response = AssistsX.scrollForward(this);
264
+ Step.assert(this.stepId);
265
+ return response;
266
+ }
179
267
 
180
- /**
181
- * 向后滚动节点
182
- * @returns 是否滚动成功
183
- */
184
- public scrollBackward(): boolean {
185
- Step.assert(this.stepId);
186
- const response = AssistsX.scrollBackward(this);
187
- Step.assert(this.stepId);
188
- return response;
189
- }
190
- /**
191
- * 检查节点是否可见
192
- * @param compareNode 比较节点
193
- * @param isFullyByCompareNode 是否完全可见
194
- * @returns 是否可见
195
- */
196
- public isVisible({ compareNode, isFullyByCompareNode }: { compareNode?: Node, isFullyByCompareNode?: boolean } = {}): boolean {
197
- Step.assert(this.stepId);
198
- const response = AssistsX.isVisible(this, { compareNode, isFullyByCompareNode });
199
- Step.assert(this.stepId);
200
- return response;
201
- }
202
- /**
203
- * 对节点进行截图
204
- * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
205
- * @returns 截图路径
206
- */
207
- public async takeScreenshot(overlayHiddenScreenshotDelayMillis: number = 250): Promise<string> {
208
- Step.assert(this.stepId);
209
- const result = await AssistsX.takeScreenshotNodes([this], overlayHiddenScreenshotDelayMillis);
210
- Step.assert(this.stepId);
211
- return result[0];
212
- }
213
- /**
214
- * 设置节点文本
215
- * @param text 要设置的文本
216
- * @returns 是否设置成功
217
- */
218
- public setNodeText(text: string): boolean {
219
- Step.assert(this.stepId);
220
- const result = AssistsX.setNodeText(this, text);
221
- Step.assert(this.stepId);
222
- return result;
223
- }
224
- public paste(text: string): boolean {
225
- Step.assert(this.stepId);
226
- const result = AssistsX.paste(this, text);
227
- Step.assert(this.stepId);
228
- return result;
229
- }
268
+ /**
269
+ * 向后滚动节点
270
+ * @returns 是否滚动成功
271
+ */
272
+ public scrollBackward(): boolean {
273
+ Step.assert(this.stepId);
274
+ const response = AssistsX.scrollBackward(this);
275
+ Step.assert(this.stepId);
276
+ return response;
277
+ }
278
+ /**
279
+ * 检查节点是否可见
280
+ * @param compareNode 比较节点
281
+ * @param isFullyByCompareNode 是否完全可见
282
+ * @returns 是否可见
283
+ */
284
+ public isVisible({
285
+ compareNode,
286
+ isFullyByCompareNode,
287
+ }: { compareNode?: Node; isFullyByCompareNode?: boolean } = {}): boolean {
288
+ Step.assert(this.stepId);
289
+ const response = AssistsX.isVisible(this, {
290
+ compareNode,
291
+ isFullyByCompareNode,
292
+ });
293
+ Step.assert(this.stepId);
294
+ return response;
295
+ }
296
+ /**
297
+ * 对节点进行截图
298
+ * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
299
+ * @returns 截图路径
300
+ */
301
+ public async takeScreenshot(
302
+ overlayHiddenScreenshotDelayMillis: number = 250
303
+ ): Promise<string> {
304
+ Step.assert(this.stepId);
305
+ const result = await AssistsX.takeScreenshotNodes(
306
+ [this],
307
+ overlayHiddenScreenshotDelayMillis
308
+ );
309
+ Step.assert(this.stepId);
310
+ return result[0];
311
+ }
312
+ /**
313
+ * 设置节点文本
314
+ * @param text 要设置的文本
315
+ * @returns 是否设置成功
316
+ */
317
+ public setNodeText(text: string): boolean {
318
+ Step.assert(this.stepId);
319
+ const result = AssistsX.setNodeText(this, text);
320
+ Step.assert(this.stepId);
321
+ return result;
322
+ }
323
+ public paste(text: string): boolean {
324
+ Step.assert(this.stepId);
325
+ const result = AssistsX.paste(this, text);
326
+ Step.assert(this.stepId);
327
+ return result;
328
+ }
329
+ public focus(): boolean {
330
+ Step.assert(this.stepId);
331
+ const result = AssistsX.focus(this);
332
+ Step.assert(this.stepId);
333
+ return result;
334
+ }
230
335
 
231
- /**
232
- * 点击节点
233
- * @returns 是否点击成功
234
- */
235
- public click(): boolean {
236
- Step.assert(this.stepId);
237
- const result = AssistsX.click(this);
238
- Step.assert(this.stepId);
239
- return result;
240
- }
241
- /**
242
- * 长按节点
243
- * @returns 是否长按成功
244
- */
245
- public longClick(): boolean {
246
- Step.assert(this.stepId);
247
- const result = AssistsX.longClick(this);
248
- Step.assert(this.stepId);
249
- return result;
250
- }
251
- /**
252
- * 查找第一个可点击的父节点
253
- * @returns 可点击的父节点
254
- */
255
- public findFirstParentClickable(): Node {
256
- Step.assert(this.stepId);
257
- const result = AssistsX.findFirstParentClickable(this);
258
- Step.assert(this.stepId);
259
- Step.assignIdsToNodes([result], this.stepId);
260
- return result;
261
- }
262
- /**
263
- * 获取节点在屏幕中的边界
264
- * @returns 边界对象
265
- */
266
- public getBoundsInScreen(): Bounds {
267
- Step.assert(this.stepId);
268
- const result = AssistsX.getBoundsInScreen(this);
269
- Step.assert(this.stepId);
270
- return result;
271
- }
272
- /**
273
- * 获取节点的所有子节点
274
- * @returns 子节点数组
275
- */
276
- public getNodes(): Node[] {
277
- Step.assert(this.stepId);
278
- const result = AssistsX.getNodes(this);
279
- Step.assert(this.stepId);
280
- Step.assignIdsToNodes(result, this.stepId);
281
- return result;
282
- }
283
- /**
284
- * 获取节点的直接子节点
285
- * @returns 子节点数组
286
- */
287
- public getChildren(): Node[] {
288
- Step.assert(this.stepId);
289
- const result = AssistsX.getChildren(this);
290
- Step.assert(this.stepId);
291
- Step.assignIdsToNodes(result, this.stepId);
292
- return result;
293
- }
336
+ /**
337
+ * 点击节点
338
+ * @returns 是否点击成功
339
+ */
340
+ public click(): boolean {
341
+ Step.assert(this.stepId);
342
+ const result = AssistsX.click(this);
343
+ Step.assert(this.stepId);
344
+ return result;
345
+ }
346
+ /**
347
+ * 长按节点
348
+ * @returns 是否长按成功
349
+ */
350
+ public longClick(): boolean {
351
+ Step.assert(this.stepId);
352
+ const result = AssistsX.longClick(this);
353
+ Step.assert(this.stepId);
354
+ return result;
355
+ }
356
+ /**
357
+ * 查找第一个可点击的父节点
358
+ * @returns 可点击的父节点
359
+ */
360
+ public findFirstParentClickable(): Node {
361
+ Step.assert(this.stepId);
362
+ const result = AssistsX.findFirstParentClickable(this);
363
+ Step.assert(this.stepId);
364
+ Step.assignIdsToNodes([result], this.stepId);
365
+ return result;
366
+ }
367
+ /**
368
+ * 获取节点在屏幕中的边界
369
+ * @returns 边界对象
370
+ */
371
+ public getBoundsInScreen(): Bounds {
372
+ Step.assert(this.stepId);
373
+ const result = AssistsX.getBoundsInScreen(this);
374
+ Step.assert(this.stepId);
375
+ return result;
376
+ }
377
+ /**
378
+ * 获取节点的所有子节点
379
+ * @returns 子节点数组
380
+ */
381
+ public getNodes(): Node[] {
382
+ Step.assert(this.stepId);
383
+ const result = AssistsX.getNodes(this);
384
+ Step.assert(this.stepId);
385
+ Step.assignIdsToNodes(result, this.stepId);
386
+ return result;
387
+ }
388
+ /**
389
+ * 获取节点的直接子节点
390
+ * @returns 子节点数组
391
+ */
392
+ public getChildren(): Node[] {
393
+ Step.assert(this.stepId);
394
+ const result = AssistsX.getChildren(this);
395
+ Step.assert(this.stepId);
396
+ Step.assignIdsToNodes(result, this.stepId);
397
+ return result;
398
+ }
294
399
 
295
- /**
296
- * 从JSON字符串创建节点实例
297
- * @param json JSON字符串
298
- * @returns 节点实例
299
- */
300
- static fromJSON(json: string): Node {
301
- const data = JSON.parse(json);
302
- return new Node(data);
303
- }
400
+ /**
401
+ * 从JSON字符串创建节点实例
402
+ * @param json JSON字符串
403
+ * @returns 节点实例
404
+ */
405
+ static fromJSON(json: string): Node {
406
+ const data = JSON.parse(json);
407
+ return new Node(data);
408
+ }
304
409
 
305
- /**
306
- * 从普通对象创建节点实例
307
- * @param data 对象数据
308
- * @returns 节点实例
309
- */
310
- static from(data: any): Node {
311
- return new Node(data);
312
- }
410
+ /**
411
+ * 从普通对象创建节点实例
412
+ * @param data 对象数据
413
+ * @returns 节点实例
414
+ */
415
+ static from(data: any): Node {
416
+ return new Node(data);
417
+ }
313
418
 
314
- /**
315
- * JSON.parse的reviver函数,用于将解析的JSON对象转换为Node实例
316
- * @param key 属性键
317
- * @param value 属性值
318
- * @returns 转换后的值
319
- */
320
- static reviver(key: string, value: any): any {
321
- return key === "" ? new Node(value) : value;
322
- }
419
+ /**
420
+ * JSON.parse的reviver函数,用于将解析的JSON对象转换为Node实例
421
+ * @param key 属性键
422
+ * @param value 属性值
423
+ * @returns 转换后的值
424
+ */
425
+ static reviver(key: string, value: any): any {
426
+ return key === "" ? new Node(value) : value;
427
+ }
323
428
 
324
- /**
325
- * 创建新的节点实例
326
- * @param params 节点参数对象
327
- * @returns 节点实例
328
- */
329
- static create(params: {
330
- nodeId: string;
331
- text: string;
332
- des: string;
333
- viewId: string;
334
- className: string;
335
- isScrollable: boolean;
336
- isClickable: boolean;
337
- isEnabled: boolean;
338
- stepId: string | undefined;
339
- }): Node {
340
- return new Node(params);
341
- }
429
+ /**
430
+ * 创建新的节点实例
431
+ * @param params 节点参数对象
432
+ * @returns 节点实例
433
+ */
434
+ static create(params: {
435
+ nodeId: string;
436
+ text: string;
437
+ des: string;
438
+ viewId: string;
439
+ className: string;
440
+ isScrollable: boolean;
441
+ isClickable: boolean;
442
+ isEnabled: boolean;
443
+ stepId: string | undefined;
444
+ }): Node {
445
+ return new Node(params);
446
+ }
342
447
 
343
- /**
344
- * 从JSON数组创建节点数组
345
- * @param array JSON数组
346
- * @returns 节点数组
347
- */
348
- static fromJSONArray(array: Array<any>): Node[] {
349
- return array.map(data => new Node(data));
350
- }
351
- }
448
+ /**
449
+ * 从JSON数组创建节点数组
450
+ * @param array JSON数组
451
+ * @returns 节点数组
452
+ */
453
+ static fromJSONArray(array: Array<any>): Node[] {
454
+ return array.map((data) => new Node(data));
455
+ }
456
+ }