assistsx-js 0.1.41 → 0.2.0

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.
Files changed (104) hide show
  1. package/README.md +32 -0
  2. package/dist/index.cjs +7957 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.mts +4231 -0
  5. package/dist/index.d.ts +4231 -30
  6. package/dist/index.global.js +46 -0
  7. package/dist/index.global.js.map +1 -0
  8. package/dist/index.js +7879 -30
  9. package/dist/index.js.map +1 -0
  10. package/package.json +11 -5
  11. package/src/{AssistsXAsync.ts → assistsx-async.ts} +8 -8
  12. package/src/{AssistsX.ts → assistsx.ts} +8 -8
  13. package/src/barutils/bar-utils.ts +3 -3
  14. package/src/filesystem/fileio/file-io.ts +2 -2
  15. package/src/filesystem/fileutils/file-utils.ts +2 -2
  16. package/src/filesystem/path.ts +2 -2
  17. package/src/floatingwindow/float.ts +4 -4
  18. package/src/gallery/gallery.ts +2 -2
  19. package/src/global.d.ts +6 -1
  20. package/src/imageutils/image-utils.ts +2 -2
  21. package/src/ime/ime.ts +2 -2
  22. package/src/index.ts +21 -20
  23. package/src/log/log-call-method.ts +28 -0
  24. package/src/log/log.ts +445 -0
  25. package/src/mlkit/mlkit.ts +3 -3
  26. package/src/network/http.ts +2 -2
  27. package/src/{NodeAsync.ts → node-async.ts} +5 -5
  28. package/src/{Node.ts → node.ts} +5 -5
  29. package/src/{StepAsync.ts → step-async.ts} +8 -8
  30. package/src/{Step.ts → step.ts} +7 -7
  31. package/dist/AccessibilityEventFilter.d.ts +0 -105
  32. package/dist/AccessibilityEventFilter.js +0 -89
  33. package/dist/AppInfo.d.ts +0 -45
  34. package/dist/AppInfo.js +0 -38
  35. package/dist/AssistsX.d.ts +0 -484
  36. package/dist/AssistsX.js +0 -828
  37. package/dist/AssistsXAsync.d.ts +0 -532
  38. package/dist/AssistsXAsync.js +0 -874
  39. package/dist/Bounds.d.ts +0 -48
  40. package/dist/Bounds.js +0 -68
  41. package/dist/CallMethod.d.ts +0 -69
  42. package/dist/CallMethod.js +0 -71
  43. package/dist/CallResponse.d.ts +0 -10
  44. package/dist/CallResponse.js +0 -28
  45. package/dist/DeviceInfo.d.ts +0 -69
  46. package/dist/DeviceInfo.js +0 -50
  47. package/dist/Node.d.ts +0 -334
  48. package/dist/Node.js +0 -369
  49. package/dist/NodeAsync.d.ts +0 -213
  50. package/dist/NodeAsync.js +0 -313
  51. package/dist/NodeClassValue.d.ts +0 -15
  52. package/dist/NodeClassValue.js +0 -15
  53. package/dist/Step.d.ts +0 -355
  54. package/dist/Step.js +0 -689
  55. package/dist/StepAsync.d.ts +0 -162
  56. package/dist/StepAsync.js +0 -264
  57. package/dist/StepError.d.ts +0 -35
  58. package/dist/StepError.js +0 -26
  59. package/dist/StepStateStore.d.ts +0 -14
  60. package/dist/StepStateStore.js +0 -37
  61. package/dist/Utils.d.ts +0 -3
  62. package/dist/Utils.js +0 -20
  63. package/dist/WindowFlags.d.ts +0 -75
  64. package/dist/WindowFlags.js +0 -97
  65. package/dist/barutils/BarUtilsCallMethod.d.ts +0 -24
  66. package/dist/barutils/BarUtilsCallMethod.js +0 -26
  67. package/dist/barutils/bar-utils.d.ts +0 -41
  68. package/dist/barutils/bar-utils.js +0 -205
  69. package/dist/filesystem/fileio/file-io.d.ts +0 -101
  70. package/dist/filesystem/fileio/file-io.js +0 -235
  71. package/dist/filesystem/fileutils/file-utils.d.ts +0 -242
  72. package/dist/filesystem/fileutils/file-utils.js +0 -493
  73. package/dist/filesystem/path.d.ts +0 -252
  74. package/dist/filesystem/path.js +0 -589
  75. package/dist/floatingwindow/FloatCallMethod.d.ts +0 -19
  76. package/dist/floatingwindow/FloatCallMethod.js +0 -18
  77. package/dist/floatingwindow/float.d.ts +0 -29
  78. package/dist/floatingwindow/float.js +0 -149
  79. package/dist/gallery/gallery.d.ts +0 -60
  80. package/dist/gallery/gallery.js +0 -142
  81. package/dist/imageutils/image-utils.d.ts +0 -442
  82. package/dist/imageutils/image-utils.js +0 -543
  83. package/dist/ime/ime.d.ts +0 -80
  84. package/dist/ime/ime.js +0 -141
  85. package/dist/mlkit/MlkitCallMethod.d.ts +0 -27
  86. package/dist/mlkit/MlkitCallMethod.js +0 -26
  87. package/dist/mlkit/mlkit.d.ts +0 -86
  88. package/dist/mlkit/mlkit.js +0 -169
  89. package/dist/network/http.d.ts +0 -127
  90. package/dist/network/http.js +0 -202
  91. /package/src/{AccessibilityEventFilter.ts → accessibility-event-filter.ts} +0 -0
  92. /package/src/{AppInfo.ts → app-info.ts} +0 -0
  93. /package/src/barutils/{BarUtilsCallMethod.ts → bar-utils-call-method.ts} +0 -0
  94. /package/src/{Bounds.ts → bounds.ts} +0 -0
  95. /package/src/{CallMethod.ts → call-method.ts} +0 -0
  96. /package/src/{CallResponse.ts → call-response.ts} +0 -0
  97. /package/src/{DeviceInfo.ts → device-info.ts} +0 -0
  98. /package/src/floatingwindow/{FloatCallMethod.ts → float-call-method.ts} +0 -0
  99. /package/src/mlkit/{MlkitCallMethod.ts → mlkit-call-method.ts} +0 -0
  100. /package/src/{NodeClassValue.ts → node-class-value.ts} +0 -0
  101. /package/src/{StepError.ts → step-error.ts} +0 -0
  102. /package/src/{StepStateStore.ts → step-state-store.ts} +0 -0
  103. /package/src/{Utils.ts → utils.ts} +0 -0
  104. /package/src/{WindowFlags.ts → window-flags.ts} +0 -0
@@ -1,532 +0,0 @@
1
- /**
2
- * AssistsX 类
3
- * 提供与移动应用程序界面交互的工具类,包括节点查找、手势操作、屏幕操作等功能
4
- */
5
- import { Node } from "./Node";
6
- import { Bounds } from "./Bounds";
7
- import { AppInfo } from "./AppInfo";
8
- import { DeviceInfo } from "./DeviceInfo";
9
- import { WebFloatingWindowOptions } from "./AssistsX";
10
- /**
11
- * 截图识别位置信息
12
- */
13
- export interface RecognizeTextInScreenshotPosition {
14
- text: string;
15
- left: number;
16
- top: number;
17
- right: number;
18
- bottom: number;
19
- width: number;
20
- height: number;
21
- }
22
- /**
23
- * 截图识别结果
24
- */
25
- export interface RecognizeTextInScreenshotResult {
26
- fullText: string;
27
- processingTimeMillis: number;
28
- positions: RecognizeTextInScreenshotPosition[];
29
- }
30
- /**
31
- * 截图识别区域参数
32
- */
33
- export interface RecognizeTextRegion {
34
- left?: number;
35
- top?: number;
36
- right?: number;
37
- bottom?: number;
38
- width?: number;
39
- height?: number;
40
- }
41
- /**
42
- * 联系人信息
43
- */
44
- export interface Contact {
45
- id: string;
46
- name: string;
47
- phoneNumbers: string[];
48
- emails: string[];
49
- address: string;
50
- }
51
- export declare class AssistsXAsync {
52
- /**
53
- * 执行异步调用
54
- * @param method 方法名
55
- * @param args 参数对象
56
- * @param timeout 超时时间(秒),默认30秒
57
- * @returns Promise<调用响应>
58
- */
59
- private static asyncCall;
60
- /**
61
- * 设置悬浮窗标志
62
- * @param flags 标志
63
- * @param timeout 超时时间(秒),默认30秒
64
- * @returns 是否设置成功
65
- */
66
- static setOverlayFlags(flags: number, timeout?: number): Promise<boolean>;
67
- /**
68
- * 设置悬浮窗标志
69
- * @param flags 标志
70
- * @param timeout 超时时间(秒),默认30秒
71
- * @returns 是否设置成功
72
- */
73
- static setOverlayFlagList(flags: number[], timeout?: number): Promise<boolean>;
74
- /**
75
- * 获取所有符合条件的节点
76
- * @param filterClass 类名过滤
77
- * @param filterViewId 视图ID过滤
78
- * @param filterDes 描述过滤
79
- * @param filterText 文本过滤
80
- * @param timeout 超时时间(秒),默认30秒
81
- * @returns 节点数组
82
- */
83
- static getAllNodes({ filterClass, filterViewId, filterDes, filterText, timeout, }?: {
84
- filterClass?: string;
85
- filterViewId?: string;
86
- filterDes?: string;
87
- filterText?: string;
88
- timeout?: number;
89
- }): Promise<Node[]>;
90
- /**
91
- * 设置节点文本
92
- * @param node 目标节点
93
- * @param text 要设置的文本
94
- * @param timeout 超时时间(秒),默认30秒
95
- * @returns 是否设置成功
96
- */
97
- static setNodeText(node: Node, text: string, timeout?: number): Promise<boolean>;
98
- /**
99
- * 对指定节点进行截图
100
- * @param nodes 要截图的节点数组
101
- * @param overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒)
102
- * @param timeout 超时时间(秒),默认30秒
103
- * @returns 截图路径数组
104
- */
105
- static takeScreenshotNodes(nodes: Node[], overlayHiddenScreenshotDelayMillis?: number, timeout?: number): Promise<string[]>;
106
- /**
107
- * 保存全屏截图到文件
108
- * @param options 截图保存选项
109
- * @param options.filePath 文件路径(可选,不提供则自动生成)
110
- * @param options.format 图片格式,支持 "PNG"、"JPEG"、"JPG"、"WEBP",默认为 "PNG"
111
- * @param options.overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒),默认为 250
112
- * @param options.timeout 超时时间(秒),默认30秒
113
- * @returns 保存的文件路径
114
- */
115
- static takeScreenshotSave(options?: {
116
- filePath?: string;
117
- format?: "PNG" | "JPEG" | "JPG" | "WEBP";
118
- overlayHiddenScreenshotDelayMillis?: number;
119
- timeout?: number;
120
- }): Promise<string>;
121
- /**
122
- * 保存截图到文件(支持多个节点)
123
- * @param options 截图保存选项
124
- * @param options.nodes 要截图的节点数组(可选,不提供则保存全屏截图)
125
- * @param options.filePath 文件路径(可选,不提供则自动生成。多个节点时会自动添加索引后缀)
126
- * @param options.format 图片格式,支持 "PNG"、"JPEG"、"JPG"、"WEBP",默认为 "PNG"
127
- * @param options.overlayHiddenScreenshotDelayMillis 截图延迟时间(毫秒),默认为 250
128
- * @param options.timeout 超时时间(秒),默认30秒
129
- * @returns 保存的文件路径数组
130
- */
131
- static takeScreenshotToFile(options?: {
132
- nodes?: Node[];
133
- filePath?: string;
134
- format?: "PNG" | "JPEG" | "JPG" | "WEBP";
135
- overlayHiddenScreenshotDelayMillis?: number;
136
- timeout?: number;
137
- }): Promise<string[]>;
138
- /**
139
- * 截图识别文本
140
- * @param param0 识别参数
141
- * @returns 截图识别结果
142
- */
143
- static recognizeTextInScreenshot(targetText: string, options?: {
144
- rotationDegrees?: number;
145
- overlayHiddenScreenshotDelayMillis?: number;
146
- restoreOverlay?: boolean;
147
- region?: RecognizeTextRegion;
148
- timeout?: number;
149
- }): Promise<RecognizeTextInScreenshotResult>;
150
- static scanQR(timeout?: number): Promise<string>;
151
- static loadWebViewOverlay(url: string, options?: WebFloatingWindowOptions & {
152
- timeout?: number;
153
- }): Promise<any>;
154
- /**
155
- * 关闭当前 WebView 悬浮窗
156
- * @param timeout 超时时间(秒),默认30秒
157
- * @returns 是否关闭成功(当前页面在悬浮窗内时返回 true,否则 false)
158
- */
159
- static closeOverlay(timeout?: number): Promise<boolean>;
160
- /**
161
- * 点击节点
162
- * @param node 要点击的节点
163
- * @param timeout 超时时间(秒),默认30秒
164
- * @returns 是否点击成功
165
- */
166
- static click(node: Node, timeout?: number): Promise<boolean>;
167
- /**
168
- * 长按节点
169
- * @param node 要长按的节点
170
- * @param timeout 超时时间(秒),默认30秒
171
- * @returns 是否长按成功
172
- */
173
- static longClick(node: Node, timeout?: number): Promise<boolean>;
174
- /**
175
- * 启动应用
176
- * @param packageName 应用包名
177
- * @param timeout 超时时间(秒),默认30秒
178
- * @returns 是否启动成功
179
- */
180
- static launchApp(packageName: string, timeout?: number): Promise<boolean>;
181
- /**
182
- * 获取当前应用包名
183
- * @param timeout 超时时间(秒),默认30秒
184
- * @returns 包名
185
- */
186
- static getPackageName(timeout?: number): Promise<string>;
187
- /**
188
- * 显示悬浮提示
189
- * @param text 提示文本
190
- * @param delay 显示时长(毫秒)
191
- * @param timeout 超时时间(秒),默认30秒
192
- * @returns 是否显示成功
193
- */
194
- static overlayToast(text: string, delay?: number, timeout?: number): Promise<boolean>;
195
- /**
196
- * 通过ID查找节点
197
- * @param id 节点ID
198
- * @param filterClass 类名过滤
199
- * @param filterText 文本过滤
200
- * @param filterDes 描述过滤
201
- * @param node 父节点范围
202
- * @param timeout 超时时间(秒),默认30秒
203
- * @returns 节点数组
204
- */
205
- static findById(id: string, { filterClass, filterText, filterDes, node, timeout, }?: {
206
- filterClass?: string;
207
- filterText?: string;
208
- filterDes?: string;
209
- node?: Node;
210
- timeout?: number;
211
- }): Promise<Node[]>;
212
- /**
213
- * 通过文本查找节点
214
- * @param text 要查找的文本
215
- * @param filterClass 类名过滤
216
- * @param filterViewId 视图ID过滤
217
- * @param filterDes 描述过滤
218
- * @param node 父节点范围
219
- * @param timeout 超时时间(秒),默认30秒
220
- * @returns 节点数组
221
- */
222
- static findByText(text: string, { filterClass, filterViewId, filterDes, node, timeout, }?: {
223
- filterClass?: string;
224
- filterViewId?: string;
225
- filterDes?: string;
226
- node?: Node;
227
- timeout?: number;
228
- }): Promise<Node[]>;
229
- /**
230
- * 通过标签查找节点
231
- * @param className 类名
232
- * @param filterText 文本过滤
233
- * @param filterViewId 视图ID过滤
234
- * @param filterDes 描述过滤
235
- * @param node 父节点范围
236
- * @param timeout 超时时间(秒),默认30秒
237
- * @returns 节点数组
238
- */
239
- static findByTags(className: string, { filterText, filterViewId, filterDes, node, timeout, }?: {
240
- filterText?: string;
241
- filterViewId?: string;
242
- filterDes?: string;
243
- node?: Node;
244
- timeout?: number;
245
- }): Promise<Node[]>;
246
- /**
247
- * 查找所有匹配文本的节点
248
- * @param text 要查找的文本
249
- * @param timeout 超时时间(秒),默认30秒
250
- * @returns 节点数组
251
- */
252
- static findByTextAllMatch(text: string, timeout?: number): Promise<Node[]>;
253
- /**
254
- * 检查是否包含指定文本
255
- * @param text 要检查的文本
256
- * @param timeout 超时时间(秒),默认30秒
257
- * @returns 是否包含
258
- */
259
- static containsText(text: string, timeout?: number): Promise<boolean>;
260
- /**
261
- * 获取所有文本
262
- * @param timeout 超时时间(秒),默认30秒
263
- * @returns 文本数组
264
- */
265
- static getAllText(timeout?: number): Promise<string[]>;
266
- /**
267
- * 查找第一个匹配标签的父节点
268
- * @param className 类名
269
- * @param timeout 超时时间(秒),默认30秒
270
- * @returns 父节点
271
- */
272
- static findFirstParentByTags(node: Node, className: string, timeout?: number): Promise<Node>;
273
- /**
274
- * 获取节点的所有子节点
275
- * @param node 父节点
276
- * @param timeout 超时时间(秒),默认30秒
277
- * @returns 子节点数组
278
- */
279
- static getNodes(node: Node, timeout?: number): Promise<Node[]>;
280
- /**
281
- * 获取节点的直接子节点
282
- * @param node 父节点
283
- * @param timeout 超时时间(秒),默认30秒
284
- * @returns 子节点数组
285
- */
286
- static getChildren(node: Node, timeout?: number): Promise<Node[]>;
287
- /**
288
- * 查找第一个可点击的父节点
289
- * @param node 起始节点
290
- * @param timeout 超时时间(秒),默认30秒
291
- * @returns 可点击的父节点
292
- */
293
- static findFirstParentClickable(node: Node, timeout?: number): Promise<Node>;
294
- /**
295
- * 获取节点在屏幕中的边界
296
- * @param node 目标节点
297
- * @param timeout 超时时间(秒),默认30秒
298
- * @returns 边界对象
299
- */
300
- static getBoundsInScreen(node: Node, timeout?: number): Promise<Bounds>;
301
- /**
302
- * 检查节点是否可见
303
- * @param node 目标节点
304
- * @param compareNode 比较节点
305
- * @param isFullyByCompareNode 是否完全可见
306
- * @param timeout 超时时间(秒),默认30秒
307
- * @returns 是否可见
308
- */
309
- static isVisible(node: Node, { compareNode, isFullyByCompareNode, timeout, }?: {
310
- compareNode?: Node;
311
- isFullyByCompareNode?: boolean;
312
- timeout?: number;
313
- }): Promise<boolean>;
314
- /**
315
- * 执行点击手势
316
- * @param x 横坐标
317
- * @param y 纵坐标
318
- * @param duration 持续时间
319
- * @param timeout 超时时间(秒),默认30秒
320
- * @returns 是否成功
321
- */
322
- static clickByGesture(x: number, y: number, duration: number, timeout?: number): Promise<boolean>;
323
- /**
324
- * 返回操作
325
- * @param timeout 超时时间(秒),默认30秒
326
- * @returns 是否成功
327
- */
328
- static back(timeout?: number): Promise<boolean>;
329
- /**
330
- * 回到主页
331
- * @param timeout 超时时间(秒),默认30秒
332
- * @returns 是否成功
333
- */
334
- static home(timeout?: number): Promise<boolean>;
335
- /**
336
- * 打开通知栏
337
- * @param timeout 超时时间(秒),默认30秒
338
- * @returns 是否成功
339
- */
340
- static notifications(timeout?: number): Promise<boolean>;
341
- /**
342
- * 显示最近应用
343
- * @param timeout 超时时间(秒),默认30秒
344
- * @returns 是否成功
345
- */
346
- static recentApps(timeout?: number): Promise<boolean>;
347
- /**
348
- * 在节点中粘贴文本
349
- * @param node 目标节点
350
- * @param text 要粘贴的文本
351
- * @param timeout 超时时间(秒),默认30秒
352
- * @returns 是否成功
353
- */
354
- static paste(node: Node, text: string, timeout?: number): Promise<boolean>;
355
- static focus(node: Node, timeout?: number): Promise<boolean>;
356
- /**
357
- * 选择文本
358
- * @param node 目标节点
359
- * @param selectionStart 选择起始位置
360
- * @param selectionEnd 选择结束位置
361
- * @param timeout 超时时间(秒),默认30秒
362
- * @returns 是否成功
363
- */
364
- static selectionText(node: Node, selectionStart: number, selectionEnd: number, timeout?: number): Promise<boolean>;
365
- /**
366
- * 向前滚动
367
- * @param node 可滚动节点
368
- * @param timeout 超时时间(秒),默认30秒
369
- * @returns 是否成功
370
- */
371
- static scrollForward(node: Node, timeout?: number): Promise<boolean>;
372
- /**
373
- * 向后滚动
374
- * @param node 可滚动节点
375
- * @param timeout 超时时间(秒),默认30秒
376
- * @returns 是否成功
377
- */
378
- static scrollBackward(node: Node, timeout?: number): Promise<boolean>;
379
- /**
380
- * 对节点执行点击手势
381
- * @param node 目标节点
382
- * @param offsetX X轴偏移
383
- * @param offsetY Y轴偏移
384
- * @param switchWindowIntervalDelay 窗口切换延迟
385
- * @param clickDuration 点击持续时间
386
- * @param timeout 超时时间(秒),默认30秒
387
- * @returns 是否成功
388
- */
389
- static clickNodeByGesture(node: Node, { offsetX, offsetY, switchWindowIntervalDelay, clickDuration, timeout, }?: {
390
- offsetX?: number;
391
- offsetY?: number;
392
- switchWindowIntervalDelay?: number;
393
- clickDuration?: number;
394
- timeout?: number;
395
- }): Promise<boolean>;
396
- /**
397
- * 对节点执行双击手势
398
- * @param node 目标节点
399
- * @param offsetX X轴偏移
400
- * @param offsetY Y轴偏移
401
- * @param switchWindowIntervalDelay 窗口切换延迟
402
- * @param clickDuration 点击持续时间
403
- * @param clickInterval 点击间隔
404
- * @param timeout 超时时间(秒),默认30秒
405
- * @returns 是否成功
406
- */
407
- static doubleClickNodeByGesture(node: Node, { offsetX, offsetY, switchWindowIntervalDelay, clickDuration, clickInterval, timeout, }?: {
408
- offsetX?: number;
409
- offsetY?: number;
410
- switchWindowIntervalDelay?: number;
411
- clickDuration?: number;
412
- clickInterval?: number;
413
- timeout?: number;
414
- }): Promise<boolean>;
415
- /**
416
- * 执行线型手势
417
- * @param startPoint
418
- * @param endPoint
419
- * @param param2
420
- * @param timeout 超时时间(秒),默认30秒
421
- * @returns
422
- */
423
- static performLinearGesture(startPoint: {
424
- x: number;
425
- y: number;
426
- }, endPoint: {
427
- x: number;
428
- y: number;
429
- }, { duration, timeout }?: {
430
- duration?: number;
431
- timeout?: number;
432
- }): Promise<boolean>;
433
- static longPressNodeByGestureAutoPaste(node: Node, text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration, timeout, }?: {
434
- matchedPackageName?: string;
435
- matchedText?: string;
436
- timeoutMillis?: number;
437
- longPressDuration?: number;
438
- timeout?: number;
439
- }): Promise<boolean>;
440
- static longPressGestureAutoPaste(point: {
441
- x: number;
442
- y: number;
443
- }, text: string, { matchedPackageName, matchedText, timeoutMillis, longPressDuration, timeout, }?: {
444
- matchedPackageName?: string;
445
- matchedText?: string;
446
- timeoutMillis?: number;
447
- longPressDuration?: number;
448
- timeout?: number;
449
- }): Promise<boolean>;
450
- static getAppInfo(packageName: string, timeout?: number): Promise<AppInfo>;
451
- static getUniqueDeviceId(timeout?: number): Promise<any>;
452
- static getAndroidID(timeout?: number): Promise<any>;
453
- static getMacAddress(timeout?: number): Promise<any>;
454
- static getDeviceInfo(timeout?: number): Promise<DeviceInfo>;
455
- /**
456
- * 获取屏幕尺寸
457
- * @param timeout 超时时间(秒),默认30秒
458
- * @returns 屏幕尺寸对象
459
- */
460
- static getScreenSize(timeout?: number): Promise<any>;
461
- /**
462
- * 获取应用窗口尺寸
463
- * @param timeout 超时时间(秒),默认30秒
464
- * @returns 应用窗口尺寸对象
465
- */
466
- static getAppScreenSize(timeout?: number): Promise<any>;
467
- /**
468
- * 在浏览器中打开URL
469
- * @param url 要打开的URL
470
- * @param timeout 超时时间(秒),默认30秒
471
- * @returns 是否成功打开
472
- */
473
- static openUrlInBrowser(url: string, timeout?: number): Promise<boolean>;
474
- static download(url: string, timeout?: number): Promise<string | null | undefined>;
475
- static audioPlayFromFile(filePath: string, { volume, useAbsoluteVolume, timeout, }: {
476
- volume?: number;
477
- useAbsoluteVolume?: boolean;
478
- timeout?: number;
479
- }): Promise<string | null | undefined>;
480
- static audioStop({ timeout, }: {
481
- timeout?: number;
482
- }): Promise<boolean | null | undefined>;
483
- /**
484
- * 播放系统电话铃声
485
- * @param timeout 超时时间(秒),默认30秒
486
- * @returns 播放结果消息
487
- */
488
- static audioPlayRingtone({ timeout, }: {
489
- timeout?: number;
490
- }): Promise<string>;
491
- /**
492
- * 停止播放系统电话铃声
493
- * @param timeout 超时时间(秒),默认30秒
494
- * @returns 停止结果消息
495
- */
496
- static audioStopRingtone({ timeout, }: {
497
- timeout?: number;
498
- }): Promise<string>;
499
- /**
500
- * 添加联系人
501
- * @param name 联系人姓名(必填)
502
- * @param phoneNumber 电话号码(必填)
503
- * @param timeout 超时时间(秒),默认30秒
504
- * @returns 是否添加成功
505
- */
506
- static addContact(name: string, phoneNumber: string, timeout?: number): Promise<boolean>;
507
- /**
508
- * 获取所有联系人
509
- * @param timeout 超时时间(秒),默认30秒
510
- * @returns 联系人列表
511
- */
512
- static getAllContacts(timeout?: number): Promise<Contact[]>;
513
- /**
514
- * 保存根节点树为JSON文件
515
- * @param options 保存选项
516
- * @param options.filePath 文件路径(可选,不提供则自动生成)
517
- * @param options.prettyPrint 是否格式化输出,默认为 true
518
- * @param options.timeout 超时时间(秒),默认30秒
519
- * @returns 保存的文件路径
520
- */
521
- static saveRootNodeTreeJson(options?: {
522
- filePath?: string;
523
- prettyPrint?: boolean;
524
- timeout?: number;
525
- }): Promise<string>;
526
- /**
527
- * 获取剪贴板文本内容
528
- * @param timeout 超时时间(秒),默认30秒
529
- * @returns 剪贴板文本内容,如果获取失败则返回空字符串
530
- */
531
- static getClipboardText(timeout?: number): Promise<string>;
532
- }