assistsx-js 0.0.1353 → 0.0.2002

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.
@@ -0,0 +1,532 @@
1
+ /**
2
+ * AssistsX 类
3
+ * 提供与移动应用程序界面交互的工具类,包括节点查找、手势操作、屏幕操作等功能
4
+ */
5
+ import { Node } from "./Node";
6
+ import { CallMethod } from "./CallMethod";
7
+ import { CallResponse } from "./CallResponse";
8
+ import { Bounds } from "./Bounds";
9
+ import { generateUUID } from "./Utils";
10
+ import { callbacks } from "./AssistsX";
11
+ export class AssistsXAsync {
12
+ /**
13
+ * 执行异步调用
14
+ * @param method 方法名
15
+ * @param args 参数对象
16
+ * @returns Promise<调用响应>
17
+ */
18
+ static async asyncCall(method, { args, node, nodes } = {}) {
19
+ const uuid = generateUUID();
20
+ const params = {
21
+ method,
22
+ arguments: args ? args : undefined,
23
+ node: node ? node : undefined,
24
+ nodes: nodes ? nodes : undefined,
25
+ callbackId: uuid,
26
+ };
27
+ const promise = new Promise((resolve) => {
28
+ callbacks[uuid] = (data) => {
29
+ resolve(data);
30
+ };
31
+ setTimeout(() => {
32
+ resolve(new CallResponse(0, null, uuid));
33
+ }, 10000);
34
+ });
35
+ const result = window.assistsxAsync.call(JSON.stringify(params));
36
+ const promiseResult = await promise;
37
+ if (typeof promiseResult === "string") {
38
+ const responseData = JSON.parse(promiseResult);
39
+ const response = new CallResponse(responseData.code, responseData.data, responseData.callbackId);
40
+ return response;
41
+ }
42
+ throw new Error("Call failed");
43
+ }
44
+ /**
45
+ * 设置悬浮窗标志
46
+ * @param flags 标志
47
+ * @returns 是否设置成功
48
+ */
49
+ static async setOverlayFlags(flags) {
50
+ const response = await this.asyncCall(CallMethod.setOverlayFlags, {
51
+ args: { flags: flags },
52
+ });
53
+ return response.getDataOrDefault(false);
54
+ }
55
+ /**
56
+ * 设置悬浮窗标志
57
+ * @param flags 标志
58
+ * @returns 是否设置成功
59
+ */
60
+ static async setOverlayFlagList(flags) {
61
+ const response = await this.asyncCall(CallMethod.setOverlayFlags, {
62
+ args: { flags: flags },
63
+ });
64
+ return response.getDataOrDefault(false);
65
+ }
66
+ /**
67
+ * 获取所有符合条件的节点
68
+ * @param filterClass 类名过滤
69
+ * @param filterViewId 视图ID过滤
70
+ * @param filterDes 描述过滤
71
+ * @param filterText 文本过滤
72
+ * @returns 节点数组
73
+ */
74
+ static async getAllNodes({ filterClass, filterViewId, filterDes, filterText, } = {}) {
75
+ const response = await this.asyncCall(CallMethod.getAllNodes, {
76
+ args: { filterClass, filterViewId, filterDes, filterText },
77
+ });
78
+ return Node.fromJSONArray(response.getDataOrDefault("[]"));
79
+ }
80
+ /**
81
+ * 设置节点文本
82
+ * @param node 目标节点
83
+ * @param text 要设置的文本
84
+ * @returns 是否设置成功
85
+ */
86
+ static async setNodeText(node, text) {
87
+ const response = await this.asyncCall(CallMethod.setNodeText, {
88
+ args: { text },
89
+ node,
90
+ });
91
+ return response.getDataOrDefault(false);
92
+ }
93
+ /**
94
+ * 对指定节点进行截图
95
+ * @param nodes 要截图的节点数组
96
+ * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
97
+ * @returns 截图路径数组
98
+ */
99
+ static async takeScreenshotNodes(nodes, overlayHiddenScreenshotDelayMillis = 250) {
100
+ const response = await this.asyncCall(CallMethod.takeScreenshot, {
101
+ nodes,
102
+ args: { overlayHiddenScreenshotDelayMillis },
103
+ });
104
+ const data = response.getDataOrDefault("");
105
+ return data.images;
106
+ }
107
+ static async scanQR() {
108
+ const response = await this.asyncCall(CallMethod.scanQR);
109
+ const data = response.getDataOrDefault({ value: "" });
110
+ return data.value;
111
+ }
112
+ static async loadWebViewOverlay(url, options = {}) {
113
+ const { initialWidth, initialHeight, minWidth, minHeight, maxWidth, maxHeight, initialCenter, } = options;
114
+ const response = await this.asyncCall(CallMethod.loadWebViewOverlay, {
115
+ args: {
116
+ url,
117
+ initialWidth,
118
+ initialHeight,
119
+ minWidth,
120
+ minHeight,
121
+ maxWidth,
122
+ maxHeight,
123
+ initialCenter,
124
+ },
125
+ });
126
+ const data = response.getDataOrDefault({});
127
+ return data;
128
+ }
129
+ /**
130
+ * 点击节点
131
+ * @param node 要点击的节点
132
+ * @returns 是否点击成功
133
+ */
134
+ static async click(node) {
135
+ const response = await this.asyncCall(CallMethod.click, { node });
136
+ return response.getDataOrDefault(false);
137
+ }
138
+ /**
139
+ * 长按节点
140
+ * @param node 要长按的节点
141
+ * @returns 是否长按成功
142
+ */
143
+ static async longClick(node) {
144
+ const response = await this.asyncCall(CallMethod.longClick, { node });
145
+ return response.getDataOrDefault(false);
146
+ }
147
+ /**
148
+ * 启动应用
149
+ * @param packageName 应用包名
150
+ * @returns 是否启动成功
151
+ */
152
+ static async launchApp(packageName) {
153
+ const response = await this.asyncCall(CallMethod.launchApp, {
154
+ args: { packageName },
155
+ });
156
+ return response.getDataOrDefault(false);
157
+ }
158
+ /**
159
+ * 获取当前应用包名
160
+ * @returns 包名
161
+ */
162
+ static async getPackageName() {
163
+ const response = await this.asyncCall(CallMethod.getPackageName);
164
+ return response.getDataOrDefault("");
165
+ }
166
+ /**
167
+ * 显示悬浮提示
168
+ * @param text 提示文本
169
+ * @param delay 显示时长(毫秒)
170
+ * @returns 是否显示成功
171
+ */
172
+ static async overlayToast(text, delay = 2000) {
173
+ const response = await this.asyncCall(CallMethod.overlayToast, {
174
+ args: { text, delay },
175
+ });
176
+ return response.getDataOrDefault(false);
177
+ }
178
+ /**
179
+ * 通过ID查找节点
180
+ * @param id 节点ID
181
+ * @param filterClass 类名过滤
182
+ * @param filterText 文本过滤
183
+ * @param filterDes 描述过滤
184
+ * @param node 父节点范围
185
+ * @returns 节点数组
186
+ */
187
+ static async findById(id, { filterClass, filterText, filterDes, node, } = {}) {
188
+ const response = await this.asyncCall(CallMethod.findById, {
189
+ args: { id, filterClass, filterText, filterDes },
190
+ node,
191
+ });
192
+ return Node.fromJSONArray(response.getDataOrDefault("[]"));
193
+ }
194
+ /**
195
+ * 通过文本查找节点
196
+ * @param text 要查找的文本
197
+ * @param filterClass 类名过滤
198
+ * @param filterViewId 视图ID过滤
199
+ * @param filterDes 描述过滤
200
+ * @param node 父节点范围
201
+ * @returns 节点数组
202
+ */
203
+ static async findByText(text, { filterClass, filterViewId, filterDes, node, } = {}) {
204
+ const response = await this.asyncCall(CallMethod.findByText, {
205
+ args: { text, filterClass, filterViewId, filterDes },
206
+ node,
207
+ });
208
+ return Node.fromJSONArray(response.getDataOrDefault("[]"));
209
+ }
210
+ /**
211
+ * 通过标签查找节点
212
+ * @param className 类名
213
+ * @param filterText 文本过滤
214
+ * @param filterViewId 视图ID过滤
215
+ * @param filterDes 描述过滤
216
+ * @param node 父节点范围
217
+ * @returns 节点数组
218
+ */
219
+ static async findByTags(className, { filterText, filterViewId, filterDes, node, } = {}) {
220
+ const response = await this.asyncCall(CallMethod.findByTags, {
221
+ args: { className, filterText, filterViewId, filterDes },
222
+ node,
223
+ });
224
+ return Node.fromJSONArray(response.getDataOrDefault("[]"));
225
+ }
226
+ /**
227
+ * 查找所有匹配文本的节点
228
+ * @param text 要查找的文本
229
+ * @returns 节点数组
230
+ */
231
+ static async findByTextAllMatch(text) {
232
+ const response = await this.asyncCall(CallMethod.findByTextAllMatch, {
233
+ args: { text },
234
+ });
235
+ return Node.fromJSONArray(response.getDataOrDefault("[]"));
236
+ }
237
+ /**
238
+ * 检查是否包含指定文本
239
+ * @param text 要检查的文本
240
+ * @returns 是否包含
241
+ */
242
+ static async containsText(text) {
243
+ const response = await this.asyncCall(CallMethod.containsText, {
244
+ args: { text },
245
+ });
246
+ return response.getDataOrDefault(false);
247
+ }
248
+ /**
249
+ * 获取所有文本
250
+ * @returns 文本数组
251
+ */
252
+ static async getAllText() {
253
+ const response = await this.asyncCall(CallMethod.getAllText);
254
+ return response.getDataOrDefault("[]");
255
+ }
256
+ /**
257
+ * 查找第一个匹配标签的父节点
258
+ * @param className 类名
259
+ * @returns 父节点
260
+ */
261
+ static async findFirstParentByTags(node, className) {
262
+ const response = await this.asyncCall(CallMethod.findFirstParentByTags, {
263
+ args: { className },
264
+ node,
265
+ });
266
+ return Node.create(response.getDataOrDefault("{}"));
267
+ }
268
+ /**
269
+ * 获取节点的所有子节点
270
+ * @param node 父节点
271
+ * @returns 子节点数组
272
+ */
273
+ static async getNodes(node) {
274
+ const response = await this.asyncCall(CallMethod.getNodes, { node });
275
+ return Node.fromJSONArray(response.getDataOrDefault("[]"));
276
+ }
277
+ /**
278
+ * 获取节点的直接子节点
279
+ * @param node 父节点
280
+ * @returns 子节点数组
281
+ */
282
+ static async getChildren(node) {
283
+ const response = await this.asyncCall(CallMethod.getChildren, { node });
284
+ return Node.fromJSONArray(response.getDataOrDefault([]));
285
+ }
286
+ /**
287
+ * 查找第一个可点击的父节点
288
+ * @param node 起始节点
289
+ * @returns 可点击的父节点
290
+ */
291
+ static async findFirstParentClickable(node) {
292
+ const response = await this.asyncCall(CallMethod.findFirstParentClickable, {
293
+ node,
294
+ });
295
+ return Node.create(response.getDataOrDefault("{}"));
296
+ }
297
+ /**
298
+ * 获取节点在屏幕中的边界
299
+ * @param node 目标节点
300
+ * @returns 边界对象
301
+ */
302
+ static async getBoundsInScreen(node) {
303
+ const response = await this.asyncCall(CallMethod.getBoundsInScreen, {
304
+ node,
305
+ });
306
+ return Bounds.fromData(response.getDataOrDefault({}));
307
+ }
308
+ /**
309
+ * 检查节点是否可见
310
+ * @param node 目标节点
311
+ * @param compareNode 比较节点
312
+ * @param isFullyByCompareNode 是否完全可见
313
+ * @returns 是否可见
314
+ */
315
+ static async isVisible(node, { compareNode, isFullyByCompareNode, } = {}) {
316
+ const response = await this.asyncCall(CallMethod.isVisible, {
317
+ node,
318
+ args: { compareNode, isFullyByCompareNode },
319
+ });
320
+ return response.getDataOrDefault(false);
321
+ }
322
+ /**
323
+ * 执行点击手势
324
+ * @param x 横坐标
325
+ * @param y 纵坐标
326
+ * @param duration 持续时间
327
+ * @returns 是否成功
328
+ */
329
+ static async clickByGesture(x, y, duration) {
330
+ const response = await this.asyncCall(CallMethod.clickByGesture, {
331
+ args: { x, y, duration },
332
+ });
333
+ return response.getDataOrDefault(false);
334
+ }
335
+ /**
336
+ * 返回操作
337
+ * @returns 是否成功
338
+ */
339
+ static async back() {
340
+ const response = await this.asyncCall(CallMethod.back);
341
+ return response.getDataOrDefault(false);
342
+ }
343
+ /**
344
+ * 回到主页
345
+ * @returns 是否成功
346
+ */
347
+ static async home() {
348
+ const response = await this.asyncCall(CallMethod.home);
349
+ return response.getDataOrDefault(false);
350
+ }
351
+ /**
352
+ * 打开通知栏
353
+ * @returns 是否成功
354
+ */
355
+ static async notifications() {
356
+ const response = await this.asyncCall(CallMethod.notifications);
357
+ return response.getDataOrDefault(false);
358
+ }
359
+ /**
360
+ * 显示最近应用
361
+ * @returns 是否成功
362
+ */
363
+ static async recentApps() {
364
+ const response = await this.asyncCall(CallMethod.recentApps);
365
+ return response.getDataOrDefault(false);
366
+ }
367
+ /**
368
+ * 在节点中粘贴文本
369
+ * @param node 目标节点
370
+ * @param text 要粘贴的文本
371
+ * @returns 是否成功
372
+ */
373
+ static async paste(node, text) {
374
+ const response = await this.asyncCall(CallMethod.paste, {
375
+ args: { text },
376
+ node,
377
+ });
378
+ return response.getDataOrDefault(false);
379
+ }
380
+ static async focus(node) {
381
+ const response = await this.asyncCall(CallMethod.focus, { node });
382
+ return response.getDataOrDefault(false);
383
+ }
384
+ /**
385
+ * 选择文本
386
+ * @param node 目标节点
387
+ * @param selectionStart 选择起始位置
388
+ * @param selectionEnd 选择结束位置
389
+ * @returns 是否成功
390
+ */
391
+ static async selectionText(node, selectionStart, selectionEnd) {
392
+ const response = await this.asyncCall(CallMethod.selectionText, {
393
+ args: { selectionStart, selectionEnd },
394
+ node,
395
+ });
396
+ return response.getDataOrDefault(false);
397
+ }
398
+ /**
399
+ * 向前滚动
400
+ * @param node 可滚动节点
401
+ * @returns 是否成功
402
+ */
403
+ static async scrollForward(node) {
404
+ const response = await this.asyncCall(CallMethod.scrollForward, {
405
+ node,
406
+ });
407
+ return response.getDataOrDefault(false);
408
+ }
409
+ /**
410
+ * 向后滚动
411
+ * @param node 可滚动节点
412
+ * @returns 是否成功
413
+ */
414
+ static async scrollBackward(node) {
415
+ const response = await this.asyncCall(CallMethod.scrollBackward, {
416
+ node,
417
+ });
418
+ return response.getDataOrDefault(false);
419
+ }
420
+ /**
421
+ * 对节点执行点击手势
422
+ * @param node 目标节点
423
+ * @param offsetX X轴偏移
424
+ * @param offsetY Y轴偏移
425
+ * @param switchWindowIntervalDelay 窗口切换延迟
426
+ * @param clickDuration 点击持续时间
427
+ * @returns 是否成功
428
+ */
429
+ static async clickNodeByGesture(node, { offsetX, offsetY, switchWindowIntervalDelay, clickDuration, } = {}) {
430
+ const response = await this.asyncCall(CallMethod.clickNodeByGesture, {
431
+ node,
432
+ args: { offsetX, offsetY, switchWindowIntervalDelay, clickDuration },
433
+ });
434
+ return response.getDataOrDefault(false);
435
+ }
436
+ /**
437
+ * 对节点执行双击手势
438
+ * @param node 目标节点
439
+ * @param offsetX X轴偏移
440
+ * @param offsetY Y轴偏移
441
+ * @param switchWindowIntervalDelay 窗口切换延迟
442
+ * @param clickDuration 点击持续时间
443
+ * @param clickInterval 点击间隔
444
+ * @returns 是否成功
445
+ */
446
+ static async doubleClickNodeByGesture(node, { offsetX, offsetY, switchWindowIntervalDelay, clickDuration, clickInterval, } = {}) {
447
+ const response = await this.asyncCall(CallMethod.doubleClickNodeByGesture, {
448
+ node,
449
+ args: {
450
+ offsetX,
451
+ offsetY,
452
+ switchWindowIntervalDelay,
453
+ clickDuration,
454
+ clickInterval,
455
+ },
456
+ });
457
+ return response.getDataOrDefault(false);
458
+ }
459
+ /**
460
+ * 执行线型手势
461
+ * @param startPoint
462
+ * @param endPoint
463
+ * @param param2
464
+ * @returns
465
+ */
466
+ static async performLinearGesture(startPoint, endPoint, { duration } = {}) {
467
+ const response = await this.asyncCall(CallMethod.performLinearGesture, {
468
+ args: { startPoint, endPoint, duration },
469
+ });
470
+ return response.getDataOrDefault(false);
471
+ }
472
+ static async longPressNodeByGestureAutoPaste(node, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration, } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }) {
473
+ const response = await this.asyncCall(CallMethod.longPressGestureAutoPaste, {
474
+ node,
475
+ args: {
476
+ text,
477
+ matchedPackageName,
478
+ matchedText,
479
+ timeoutMillis,
480
+ longPressDuration,
481
+ },
482
+ });
483
+ return response.getDataOrDefault(false);
484
+ }
485
+ static async longPressGestureAutoPaste(point, text, { matchedPackageName, matchedText, timeoutMillis, longPressDuration, } = { matchedText: "粘贴", timeoutMillis: 1500, longPressDuration: 600 }) {
486
+ const response = await this.asyncCall(CallMethod.longPressGestureAutoPaste, {
487
+ args: {
488
+ point,
489
+ text,
490
+ matchedPackageName,
491
+ matchedText,
492
+ timeoutMillis,
493
+ longPressDuration,
494
+ },
495
+ });
496
+ return response.getDataOrDefault(false);
497
+ }
498
+ static async getAppInfo(packageName) {
499
+ const response = await this.asyncCall(CallMethod.getAppInfo, {
500
+ args: { packageName },
501
+ });
502
+ return response.getDataOrDefault({});
503
+ }
504
+ static async getUniqueDeviceId() {
505
+ const response = await this.asyncCall(CallMethod.getUniqueDeviceId);
506
+ return response.getDataOrDefault("");
507
+ }
508
+ static async getAndroidID() {
509
+ const response = await this.asyncCall(CallMethod.getAndroidID);
510
+ return response.getDataOrDefault("");
511
+ }
512
+ static async getMacAddress() {
513
+ const response = await this.asyncCall(CallMethod.getMacAddress);
514
+ return response.getDataOrDefault({});
515
+ }
516
+ /**
517
+ * 获取屏幕尺寸
518
+ * @returns 屏幕尺寸对象
519
+ */
520
+ static async getScreenSize() {
521
+ const response = await this.asyncCall(CallMethod.getScreenSize);
522
+ return response.getDataOrDefault("{}");
523
+ }
524
+ /**
525
+ * 获取应用窗口尺寸
526
+ * @returns 应用窗口尺寸对象
527
+ */
528
+ static async getAppScreenSize() {
529
+ const response = await this.asyncCall(CallMethod.getAppScreenSize);
530
+ return response.getDataOrDefault("{}");
531
+ }
532
+ }
@@ -22,6 +22,7 @@ export declare const CallMethod: {
22
22
  readonly notifications: "notifications";
23
23
  readonly recentApps: "recentApps";
24
24
  readonly paste: "paste";
25
+ readonly focus: "focus";
25
26
  readonly selectionText: "selectionText";
26
27
  readonly scrollForward: "scrollForward";
27
28
  readonly launchApp: "launchApp";
@@ -23,6 +23,7 @@ export const CallMethod = {
23
23
  notifications: "notifications",
24
24
  recentApps: "recentApps",
25
25
  paste: "paste",
26
+ focus: "focus",
26
27
  selectionText: "selectionText",
27
28
  scrollForward: "scrollForward",
28
29
  launchApp: "launchApp",
package/dist/Node.d.ts CHANGED
@@ -2,7 +2,8 @@
2
2
  * 节点类
3
3
  * 表示界面上的一个可交互元素,包含元素的属性和可执行的操作
4
4
  */
5
- import { Bounds } from './Bounds';
5
+ import { Bounds } from "./Bounds";
6
+ import { NodeAsync } from "./NodeAsync";
6
7
  export declare class Node {
7
8
  /**
8
9
  * 节点唯一标识
@@ -55,6 +56,13 @@ export declare class Node {
55
56
  isEnabled: boolean;
56
57
  stepId: string | undefined;
57
58
  });
59
+ get async(): NodeAsync;
60
+ /**
61
+ * 查找第一个匹配标签的父节点
62
+ * @param className 类名
63
+ * @returns 父节点
64
+ */
65
+ findFirstParentByTags(className: string): Node;
58
66
  /**
59
67
  * 对节点执行点击手势
60
68
  * @param offsetX X轴偏移
@@ -63,7 +71,7 @@ export declare class Node {
63
71
  * @param clickDuration 点击持续时间
64
72
  * @returns 是否点击成功
65
73
  */
66
- clickNodeByGesture({ offsetX, offsetY, switchWindowIntervalDelay, clickDuration }?: {
74
+ clickNodeByGesture({ offsetX, offsetY, switchWindowIntervalDelay, clickDuration, }?: {
67
75
  offsetX?: number;
68
76
  offsetY?: number;
69
77
  switchWindowIntervalDelay?: number;
@@ -78,14 +86,14 @@ export declare class Node {
78
86
  * @param clickInterval 点击间隔
79
87
  * @returns 是否双击成功
80
88
  */
81
- doubleClickNodeByGesture({ offsetX, offsetY, switchWindowIntervalDelay, clickDuration, clickInterval }?: {
89
+ doubleClickNodeByGesture({ offsetX, offsetY, switchWindowIntervalDelay, clickDuration, clickInterval, }?: {
82
90
  offsetX?: number;
83
91
  offsetY?: number;
84
92
  switchWindowIntervalDelay?: number;
85
93
  clickDuration?: number;
86
94
  clickInterval?: number;
87
95
  }): Promise<boolean>;
88
- longPressNodeByGestureAutoPaste(text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration }?: {
96
+ longPressNodeByGestureAutoPaste(text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration, }?: {
89
97
  matchedPackageName?: string;
90
98
  matchedText?: string;
91
99
  timeoutMillis?: number;
@@ -99,7 +107,7 @@ export declare class Node {
99
107
  * @param filterDes 描述过滤
100
108
  * @returns 节点数组
101
109
  */
102
- findByTags(className: string, { filterText, filterViewId, filterDes }?: {
110
+ findByTags(className: string, { filterText, filterViewId, filterDes, }?: {
103
111
  filterText?: string;
104
112
  filterViewId?: string;
105
113
  filterDes?: string;
@@ -112,7 +120,7 @@ export declare class Node {
112
120
  * @param filterDes 描述过滤
113
121
  * @returns 节点数组
114
122
  */
115
- findById(id: string, { filterClass, filterText, filterDes }?: {
123
+ findById(id: string, { filterClass, filterText, filterDes, }?: {
116
124
  filterClass?: string;
117
125
  filterText?: string;
118
126
  filterDes?: string;
@@ -125,7 +133,7 @@ export declare class Node {
125
133
  * @param filterDes 描述过滤
126
134
  * @returns 节点数组
127
135
  */
128
- findByText(text: string, { filterClass, filterViewId, filterDes }?: {
136
+ findByText(text: string, { filterClass, filterViewId, filterDes, }?: {
129
137
  filterClass?: string;
130
138
  filterViewId?: string;
131
139
  filterDes?: string;
@@ -146,7 +154,7 @@ export declare class Node {
146
154
  * @param isFullyByCompareNode 是否完全可见
147
155
  * @returns 是否可见
148
156
  */
149
- isVisible({ compareNode, isFullyByCompareNode }?: {
157
+ isVisible({ compareNode, isFullyByCompareNode, }?: {
150
158
  compareNode?: Node;
151
159
  isFullyByCompareNode?: boolean;
152
160
  }): boolean;
@@ -163,6 +171,7 @@ export declare class Node {
163
171
  */
164
172
  setNodeText(text: string): boolean;
165
173
  paste(text: string): boolean;
174
+ focus(): boolean;
166
175
  /**
167
176
  * 点击节点
168
177
  * @returns 是否点击成功