appium-uiautomator2-driver 6.7.6 → 6.7.8

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 (91) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/actions.d.ts +26 -29
  3. package/build/lib/commands/actions.d.ts.map +1 -1
  4. package/build/lib/commands/actions.js +19 -27
  5. package/build/lib/commands/actions.js.map +1 -1
  6. package/build/lib/commands/alert.d.ts +14 -22
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +8 -19
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +7 -10
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +4 -14
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/battery.d.ts +4 -5
  15. package/build/lib/commands/battery.d.ts.map +1 -1
  16. package/build/lib/commands/battery.js +4 -9
  17. package/build/lib/commands/battery.js.map +1 -1
  18. package/build/lib/commands/clipboard.d.ts +9 -13
  19. package/build/lib/commands/clipboard.d.ts.map +1 -1
  20. package/build/lib/commands/clipboard.js +7 -14
  21. package/build/lib/commands/clipboard.js.map +1 -1
  22. package/build/lib/commands/element.d.ts +29 -0
  23. package/build/lib/commands/element.d.ts.map +1 -1
  24. package/build/lib/commands/element.js +29 -0
  25. package/build/lib/commands/element.js.map +1 -1
  26. package/build/lib/commands/find.d.ts +13 -9
  27. package/build/lib/commands/find.d.ts.map +1 -1
  28. package/build/lib/commands/find.js +4 -16
  29. package/build/lib/commands/find.js.map +1 -1
  30. package/build/lib/commands/gestures.d.ts +63 -0
  31. package/build/lib/commands/gestures.d.ts.map +1 -1
  32. package/build/lib/commands/gestures.js +63 -0
  33. package/build/lib/commands/gestures.js.map +1 -1
  34. package/build/lib/commands/keyboard.d.ts +30 -41
  35. package/build/lib/commands/keyboard.d.ts.map +1 -1
  36. package/build/lib/commands/keyboard.js +22 -37
  37. package/build/lib/commands/keyboard.js.map +1 -1
  38. package/build/lib/commands/misc.d.ts +4 -0
  39. package/build/lib/commands/misc.d.ts.map +1 -1
  40. package/build/lib/commands/misc.js +4 -0
  41. package/build/lib/commands/misc.js.map +1 -1
  42. package/build/lib/commands/navigation.d.ts +11 -16
  43. package/build/lib/commands/navigation.d.ts.map +1 -1
  44. package/build/lib/commands/navigation.js +9 -17
  45. package/build/lib/commands/navigation.js.map +1 -1
  46. package/build/lib/commands/viewport.d.ts +23 -22
  47. package/build/lib/commands/viewport.d.ts.map +1 -1
  48. package/build/lib/commands/viewport.js +17 -24
  49. package/build/lib/commands/viewport.js.map +1 -1
  50. package/build/lib/doctor/optional-checks.d.ts +4 -4
  51. package/build/lib/doctor/optional-checks.d.ts.map +1 -1
  52. package/build/lib/doctor/optional-checks.js.map +1 -1
  53. package/build/lib/doctor/required-checks.d.ts +5 -21
  54. package/build/lib/doctor/required-checks.d.ts.map +1 -1
  55. package/build/lib/doctor/required-checks.js.map +1 -1
  56. package/build/lib/index.d.ts +4 -0
  57. package/build/lib/index.d.ts.map +1 -0
  58. package/build/{index.js → lib/index.js} +1 -1
  59. package/build/lib/index.js.map +1 -0
  60. package/build/tsconfig.tsbuildinfo +1 -1
  61. package/lib/commands/actions.ts +95 -0
  62. package/lib/commands/alert.ts +46 -0
  63. package/lib/commands/app-management.ts +25 -0
  64. package/lib/commands/battery.ts +19 -0
  65. package/lib/commands/clipboard.ts +29 -0
  66. package/lib/commands/element.ts +29 -0
  67. package/lib/commands/find.ts +48 -0
  68. package/lib/commands/gestures.ts +63 -0
  69. package/lib/commands/keyboard.ts +102 -0
  70. package/lib/commands/misc.ts +4 -0
  71. package/lib/commands/navigation.ts +32 -0
  72. package/lib/commands/viewport.ts +78 -0
  73. package/lib/doctor/optional-checks.ts +7 -0
  74. package/lib/doctor/required-checks.ts +8 -0
  75. package/{index.js → lib/index.ts} +2 -1
  76. package/npm-shrinkwrap.json +2 -2
  77. package/package.json +3 -7
  78. package/build/index.d.ts +0 -4
  79. package/build/index.d.ts.map +0 -1
  80. package/build/index.js.map +0 -1
  81. package/lib/commands/actions.js +0 -107
  82. package/lib/commands/alert.js +0 -63
  83. package/lib/commands/app-management.js +0 -32
  84. package/lib/commands/battery.js +0 -23
  85. package/lib/commands/clipboard.js +0 -37
  86. package/lib/commands/find.js +0 -47
  87. package/lib/commands/keyboard.js +0 -108
  88. package/lib/commands/navigation.js +0 -33
  89. package/lib/commands/viewport.js +0 -100
  90. package/lib/doctor/optional-checks.js +0 -5
  91. package/lib/doctor/required-checks.js +0 -6
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [6.7.8](https://github.com/appium/appium-uiautomator2-driver/compare/v6.7.7...v6.7.8) (2025-12-25)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * Migrate index to typescript ([#972](https://github.com/appium/appium-uiautomator2-driver/issues/972)) ([381fadd](https://github.com/appium/appium-uiautomator2-driver/commit/381fadd7b3e53ad7fa9bd16e8e60d563ebfc8c24))
6
+
7
+ ## [6.7.7](https://github.com/appium/appium-uiautomator2-driver/compare/v6.7.6...v6.7.7) (2025-12-24)
8
+
9
+ ### Miscellaneous Chores
10
+
11
+ * Migrate the rest of command modules to typescript ([#971](https://github.com/appium/appium-uiautomator2-driver/issues/971)) ([1e7606c](https://github.com/appium/appium-uiautomator2-driver/commit/1e7606ccc41b19ace7b7ced898329f84a4774280))
12
+
1
13
  ## [6.7.6](https://github.com/appium/appium-uiautomator2-driver/compare/v6.7.5...v6.7.6) (2025-12-23)
2
14
 
3
15
  ### Miscellaneous Chores
@@ -1,40 +1,37 @@
1
+ import type { StringRecord } from '@appium/types';
2
+ import type { AndroidUiautomator2Driver } from '../driver';
3
+ import type { ActionResult } from './types';
1
4
  /**
2
- * @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-scheduleaction
3
- * @this {AndroidUiautomator2Driver}
4
- * @param {string} name
5
- * @param {import('@appium/types').StringRecord[]} steps
6
- * @param {number} [maxPass]
7
- * @param {number} [maxFail]
8
- * @param {number} [times]
9
- * @param {number} [intervalMs]
10
- * @param {number} [maxHistoryItems]
11
- * @returns {Promise<any>}
5
+ * Schedules a recurring action to be performed at specified intervals.
6
+ * @param name - Unique name for the scheduled action.
7
+ * @param steps - Array of action steps to be executed.
8
+ * @param maxPass - Maximum number of successful executions before stopping.
9
+ * @param maxFail - Maximum number of failed executions before stopping.
10
+ * @param times - Total number of times to execute the action.
11
+ * @param intervalMs - Interval in milliseconds between action executions.
12
+ * @param maxHistoryItems - Maximum number of history items to keep.
13
+ * @returns The result of scheduling the action.
12
14
  */
13
- export function mobileScheduleAction(this: import("../driver").AndroidUiautomator2Driver, name: string, steps: import("@appium/types").StringRecord[], maxPass?: number, maxFail?: number, times?: number, intervalMs?: number, maxHistoryItems?: number): Promise<any>;
15
+ export declare function mobileScheduleAction(this: AndroidUiautomator2Driver, name: string, steps: StringRecord[], maxPass?: number, maxFail?: number, times?: number, intervalMs?: number, maxHistoryItems?: number): Promise<any>;
14
16
  /**
15
- * @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-getactionhistory
16
- * @this {AndroidUiautomator2Driver}
17
- * @param {string} name
18
- * @returns {Promise<import('./types').ActionResult>}
17
+ * Gets the execution history for a scheduled action.
18
+ * @param name - Name of the scheduled action.
19
+ * @returns The action execution history containing repeats and step results.
19
20
  */
20
- export function mobileGetActionHistory(this: import("../driver").AndroidUiautomator2Driver, name: string): Promise<import("./types").ActionResult>;
21
+ export declare function mobileGetActionHistory(this: AndroidUiautomator2Driver, name: string): Promise<ActionResult>;
21
22
  /**
22
- * @this {AndroidUiautomator2Driver}
23
- * @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-unscheduleaction
24
- * @param {string} name
25
- * @returns {Promise<any>}
23
+ * Unschedules a previously scheduled action.
24
+ * @param name - Name of the scheduled action to unschedule.
25
+ * @returns The result of unscheduling the action.
26
26
  */
27
- export function mobileUnscheduleAction(this: import("../driver").AndroidUiautomator2Driver, name: string): Promise<any>;
27
+ export declare function mobileUnscheduleAction(this: AndroidUiautomator2Driver, name: string): Promise<any>;
28
28
  /**
29
- * @this {AndroidUiautomator2Driver}
30
- * @param {import('@appium/types').StringRecord[]} actions
31
- * @returns {Promise<void>}
29
+ * Performs a sequence of actions.
30
+ * @param actions - Array of action objects to perform. Pointer actions are automatically converted to touch type.
32
31
  */
33
- export function performActions(this: import("../driver").AndroidUiautomator2Driver, actions: import("@appium/types").StringRecord[]): Promise<void>;
32
+ export declare function performActions(this: AndroidUiautomator2Driver, actions: StringRecord[]): Promise<void>;
34
33
  /**
35
- * @this {AndroidUiautomator2Driver}
36
- * @returns {Promise<void>}
34
+ * Releases all currently pressed keys and buttons.
37
35
  */
38
- export function releaseActions(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
39
- export type AndroidUiautomator2Driver = import("../driver").AndroidUiautomator2Driver;
36
+ export declare function releaseActions(this: AndroidUiautomator2Driver): Promise<void>;
40
37
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/actions.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,gGATW,MAAM,SACN,OAAO,eAAe,EAAE,YAAY,EAAE,YACtC,MAAM,YACN,MAAM,UACN,MAAM,eACN,MAAM,oBACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CAwBxB;AAED;;;;;GAKG;AACH,kGAHW,MAAM,GACJ,OAAO,CAAC,OAAO,SAAS,EAAE,YAAY,CAAC,CAUnD;AAED;;;;;GAKG;AACH,kGAHW,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CAQxB;AAED;;;;GAIG;AACH,6FAHW,OAAO,eAAe,EAAE,YAAY,EAAE,GACpC,OAAO,CAAC,IAAI,CAAC,CAyBzB;AAED;;;GAGG;AACH,qFAFa,OAAO,CAAC,IAAI,CAAC,CAIzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../lib/commands/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,yBAAyB,EAC/B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,YAAY,EAAE,EACrB,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,GAAG,CAAC,CAUd;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,yBAAyB,EAC/B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAEvB;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,yBAAyB,EAC/B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,GAAG,CAAC,CAEd;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnF"}
@@ -6,16 +6,15 @@ exports.mobileUnscheduleAction = mobileUnscheduleAction;
6
6
  exports.performActions = performActions;
7
7
  exports.releaseActions = releaseActions;
8
8
  /**
9
- * @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-scheduleaction
10
- * @this {AndroidUiautomator2Driver}
11
- * @param {string} name
12
- * @param {import('@appium/types').StringRecord[]} steps
13
- * @param {number} [maxPass]
14
- * @param {number} [maxFail]
15
- * @param {number} [times]
16
- * @param {number} [intervalMs]
17
- * @param {number} [maxHistoryItems]
18
- * @returns {Promise<any>}
9
+ * Schedules a recurring action to be performed at specified intervals.
10
+ * @param name - Unique name for the scheduled action.
11
+ * @param steps - Array of action steps to be executed.
12
+ * @param maxPass - Maximum number of successful executions before stopping.
13
+ * @param maxFail - Maximum number of failed executions before stopping.
14
+ * @param times - Total number of times to execute the action.
15
+ * @param intervalMs - Interval in milliseconds between action executions.
16
+ * @param maxHistoryItems - Maximum number of history items to keep.
17
+ * @returns The result of scheduling the action.
19
18
  */
20
19
  async function mobileScheduleAction(name, steps, maxPass, maxFail, times, intervalMs, maxHistoryItems) {
21
20
  return await this.uiautomator2.jwproxy.command('/appium/schedule_action', 'POST', {
@@ -29,27 +28,24 @@ async function mobileScheduleAction(name, steps, maxPass, maxFail, times, interv
29
28
  });
30
29
  }
31
30
  /**
32
- * @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-getactionhistory
33
- * @this {AndroidUiautomator2Driver}
34
- * @param {string} name
35
- * @returns {Promise<import('./types').ActionResult>}
31
+ * Gets the execution history for a scheduled action.
32
+ * @param name - Name of the scheduled action.
33
+ * @returns The action execution history containing repeats and step results.
36
34
  */
37
35
  async function mobileGetActionHistory(name) {
38
- return /** @type {import('./types').ActionResult} */ (await this.uiautomator2.jwproxy.command('/appium/action_history', 'POST', { name }));
36
+ return (await this.uiautomator2.jwproxy.command('/appium/action_history', 'POST', { name }));
39
37
  }
40
38
  /**
41
- * @this {AndroidUiautomator2Driver}
42
- * @see https://github.com/appium/appium-uiautomator2-driver/blob/master/docs/scheduled-actions.md#mobile-unscheduleaction
43
- * @param {string} name
44
- * @returns {Promise<any>}
39
+ * Unschedules a previously scheduled action.
40
+ * @param name - Name of the scheduled action to unschedule.
41
+ * @returns The result of unscheduling the action.
45
42
  */
46
43
  async function mobileUnscheduleAction(name) {
47
44
  return await this.uiautomator2.jwproxy.command('/appium/unschedule_action', 'POST', { name });
48
45
  }
49
46
  /**
50
- * @this {AndroidUiautomator2Driver}
51
- * @param {import('@appium/types').StringRecord[]} actions
52
- * @returns {Promise<void>}
47
+ * Performs a sequence of actions.
48
+ * @param actions - Array of action objects to perform. Pointer actions are automatically converted to touch type.
53
49
  */
54
50
  async function performActions(actions) {
55
51
  // This is mandatory, since Selenium API uses MOUSE as the default pointer type
@@ -66,13 +62,9 @@ async function performActions(actions) {
66
62
  });
67
63
  }
68
64
  /**
69
- * @this {AndroidUiautomator2Driver}
70
- * @returns {Promise<void>}
65
+ * Releases all currently pressed keys and buttons.
71
66
  */
72
67
  async function releaseActions() {
73
68
  this.log.info('On this platform, releaseActions is a no-op');
74
69
  }
75
- /**
76
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
77
- */
78
70
  //# sourceMappingURL=actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../lib/commands/actions.js"],"names":[],"mappings":";;AAYA,oDAsBC;AAQD,wDAQC;AAQD,wDAMC;AAOD,wCAuBC;AAMD,wCAEC;AAtGD;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,oBAAoB,CACxC,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAU,EACV,eAAe;IAEf,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAC5C,yBAAyB,EACzB,MAAM,EACN;QACE,IAAI;QACJ,KAAK;QACL,OAAO;QACP,OAAO;QACP,KAAK;QACL,UAAU;QACV,eAAe;KAChB,CACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAAC,IAAI;IAC/C,OAAO,6CAA6C,CAAC,CACnD,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,wBAAwB,EACxB,MAAM,EACN,EAAC,IAAI,EAAC,CACP,CACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAAC,IAAI;IAC/C,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAC5C,2BAA2B,EAC3B,MAAM,EACN,EAAC,IAAI,EAAC,CACP,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAAC,OAAO;IAC1C,+EAA+E;IAC/E,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACjD,MAAM,CAAC,MAAM,CACX,EAAE,EACF,MAAM,EACN,MAAM,CAAC,IAAI,KAAK,SAAS;QACvB,CAAC,CAAC;YACE,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO;aACrB;SACF;QACH,CAAC,CAAC,EAAE,CACP,CACF,CAAC;IACF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3F,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,UAAU,EACV,MAAM,EACN;QACE,OAAO,EAAE,mBAAmB;KAC7B,CACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;AAC/D,CAAC;AAED;;GAEG"}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../lib/commands/actions.ts"],"names":[],"mappings":";;AAeA,oDAmBC;AAOD,wDAKC;AAOD,wDAKC;AAMD,wCAsBC;AAKD,wCAEC;AAzFD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,oBAAoB,CAExC,IAAY,EACZ,KAAqB,EACrB,OAAgB,EAChB,OAAgB,EAChB,KAAc,EACd,UAAmB,EACnB,eAAwB;IAExB,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,yBAAyB,EAAE,MAAM,EAAE;QAChF,IAAI;QACJ,KAAK;QACL,OAAO;QACP,OAAO;QACP,KAAK;QACL,UAAU;QACV,eAAe;KAChB,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,sBAAsB,CAE1C,IAAY;IAEZ,OAAO,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAC,CAAC,CAAiB,CAAC;AAC7G,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,sBAAsB,CAE1C,IAAY;IAEZ,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;AAC9F,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,cAAc,CAElC,OAAuB;IAEvB,+EAA+E;IAC/E,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACjD,MAAM,CAAC,MAAM,CACX,EAAE,EACF,MAAM,EACN,MAAM,CAAC,IAAI,KAAK,SAAS;QACvB,CAAC,CAAC;YACE,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO;aACrB;SACF;QACH,CAAC,CAAC,EAAE,CACP,CACF,CAAC;IACF,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3F,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE;QAC1D,OAAO,EAAE,mBAAmB;KAC7B,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;AAC/D,CAAC"}
@@ -1,33 +1,25 @@
1
+ import type { AndroidUiautomator2Driver } from '../driver';
1
2
  /**
2
- * @this {AndroidUiautomator2Driver}
3
- * @returns {Promise<string>}
3
+ * Gets the text of the currently displayed alert.
4
+ * @returns The alert text as a string.
4
5
  */
5
- export function getAlertText(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
6
+ export declare function getAlertText(this: AndroidUiautomator2Driver): Promise<string>;
6
7
  /**
7
- * @this {AndroidUiautomator2Driver}
8
- * @param {string} [buttonLabel] The name of the button to click in order to accept the alert.
9
- * If the name is not provided
10
- * then the script will try to detect the button automatically.
11
- * @returns {Promise<void>}
8
+ * Accepts the currently displayed alert.
9
+ * @param buttonLabel - Optional label of the button to click. If not provided, the button will be detected automatically.
12
10
  */
13
- export function mobileAcceptAlert(this: import("../driver").AndroidUiautomator2Driver, buttonLabel?: string): Promise<void>;
11
+ export declare function mobileAcceptAlert(this: AndroidUiautomator2Driver, buttonLabel?: string): Promise<void>;
14
12
  /**
15
- * @this {AndroidUiautomator2Driver}
16
- * @returns {Promise<void>}
13
+ * Accepts the currently displayed alert (W3C endpoint).
17
14
  */
18
- export function postAcceptAlert(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
15
+ export declare function postAcceptAlert(this: AndroidUiautomator2Driver): Promise<void>;
19
16
  /**
20
- * @this {AndroidUiautomator2Driver}
21
- * @param {string} [buttonLabel] The name of the button to click in order to dismiss the alert.
22
- * If the name is not provided
23
- * then the script will try to detect the button automatically.
24
- * @returns {Promise<void>}
17
+ * Dismisses the currently displayed alert.
18
+ * @param buttonLabel - Optional label of the button to click. If not provided, the button will be detected automatically.
25
19
  */
26
- export function mobileDismissAlert(this: import("../driver").AndroidUiautomator2Driver, buttonLabel?: string): Promise<void>;
20
+ export declare function mobileDismissAlert(this: AndroidUiautomator2Driver, buttonLabel?: string): Promise<void>;
27
21
  /**
28
- * @this {AndroidUiautomator2Driver}
29
- * @returns {Promise<void>}
22
+ * Dismisses the currently displayed alert (W3C endpoint).
30
23
  */
31
- export function postDismissAlert(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
32
- export type AndroidUiautomator2Driver = import("../driver").AndroidUiautomator2Driver;
24
+ export declare function postDismissAlert(this: AndroidUiautomator2Driver): Promise<void>;
33
25
  //# sourceMappingURL=alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../lib/commands/alert.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,mFAFa,OAAO,CAAC,MAAM,CAAC,CAU3B;AAED;;;;;;GAMG;AACH,qGALW,MAAM,GAGJ,OAAO,CAAC,IAAI,CAAC,CAQzB;AAED;;;GAGG;AACH,sFAFa,OAAO,CAAC,IAAI,CAAC,CAIzB;AAED;;;;;;GAMG;AACH,sGALW,MAAM,GAGJ,OAAO,CAAC,IAAI,CAAC,CAQzB;AAED;;;GAGG;AACH,uFAFa,OAAO,CAAC,IAAI,CAAC,CAIzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../lib/commands/alert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AAEzD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnF;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,yBAAyB,EAC/B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpF;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,yBAAyB,EAC/B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAErF"}
@@ -6,47 +6,36 @@ exports.postAcceptAlert = postAcceptAlert;
6
6
  exports.mobileDismissAlert = mobileDismissAlert;
7
7
  exports.postDismissAlert = postDismissAlert;
8
8
  /**
9
- * @this {AndroidUiautomator2Driver}
10
- * @returns {Promise<string>}
9
+ * Gets the text of the currently displayed alert.
10
+ * @returns The alert text as a string.
11
11
  */
12
12
  async function getAlertText() {
13
13
  return String(await this.uiautomator2.jwproxy.command('/alert/text', 'GET', {}));
14
14
  }
15
15
  /**
16
- * @this {AndroidUiautomator2Driver}
17
- * @param {string} [buttonLabel] The name of the button to click in order to accept the alert.
18
- * If the name is not provided
19
- * then the script will try to detect the button automatically.
20
- * @returns {Promise<void>}
16
+ * Accepts the currently displayed alert.
17
+ * @param buttonLabel - Optional label of the button to click. If not provided, the button will be detected automatically.
21
18
  */
22
19
  async function mobileAcceptAlert(buttonLabel) {
23
20
  await this.uiautomator2.jwproxy.command('/alert/accept', 'POST', { buttonLabel });
24
21
  }
25
22
  /**
26
- * @this {AndroidUiautomator2Driver}
27
- * @returns {Promise<void>}
23
+ * Accepts the currently displayed alert (W3C endpoint).
28
24
  */
29
25
  async function postAcceptAlert() {
30
26
  await this.mobileAcceptAlert();
31
27
  }
32
28
  /**
33
- * @this {AndroidUiautomator2Driver}
34
- * @param {string} [buttonLabel] The name of the button to click in order to dismiss the alert.
35
- * If the name is not provided
36
- * then the script will try to detect the button automatically.
37
- * @returns {Promise<void>}
29
+ * Dismisses the currently displayed alert.
30
+ * @param buttonLabel - Optional label of the button to click. If not provided, the button will be detected automatically.
38
31
  */
39
32
  async function mobileDismissAlert(buttonLabel) {
40
33
  await this.uiautomator2.jwproxy.command('/alert/dismiss', 'POST', { buttonLabel });
41
34
  }
42
35
  /**
43
- * @this {AndroidUiautomator2Driver}
44
- * @returns {Promise<void>}
36
+ * Dismisses the currently displayed alert (W3C endpoint).
45
37
  */
46
38
  async function postDismissAlert() {
47
39
  await this.mobileDismissAlert();
48
40
  }
49
- /**
50
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
51
- */
52
41
  //# sourceMappingURL=alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../lib/commands/alert.js"],"names":[],"mappings":";;AAIA,oCAQC;AASD,8CAMC;AAMD,0CAEC;AASD,gDAMC;AAMD,4CAEC;AA1DD;;;GAGG;AACI,KAAK,UAAU,YAAY;IAChC,OAAO,MAAM,CACX,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,aAAa,EACb,KAAK,EACL,EAAE,CACH,CACF,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,iBAAiB,CAAC,WAAW;IACjD,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,eAAe,EACf,MAAM,EACN,EAAC,WAAW,EAAC,CACd,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,eAAe;IACnC,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,kBAAkB,CAAC,WAAW;IAClD,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,gBAAgB,EAChB,MAAM,EACN,EAAC,WAAW,EAAC,CACd,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,gBAAgB;IACpC,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;AAClC,CAAC;AAED;;GAEG"}
1
+ {"version":3,"file":"alert.js","sourceRoot":"","sources":["../../../lib/commands/alert.ts"],"names":[],"mappings":";;AAMA,oCAEC;AAMD,8CAKC;AAKD,0CAEC;AAMD,gDAKC;AAKD,4CAEC;AA1CD;;;GAGG;AACI,KAAK,UAAU,YAAY;IAChC,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,iBAAiB,CAErC,WAAoB;IAEpB,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,EAAE,EAAC,WAAW,EAAC,CAAC,CAAC;AAClF,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,eAAe;IACnC,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;AACjC,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CAEtC,WAAoB;IAEpB,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,EAAE,EAAC,WAAW,EAAC,CAAC,CAAC;AACnF,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,gBAAgB;IACpC,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;AAClC,CAAC"}
@@ -1,13 +1,10 @@
1
+ import type { AndroidUiautomator2Driver } from '../driver';
2
+ import type { InstallOptions } from './types';
1
3
  /**
2
- * Install multiple APKs with `install-multiple` option.
3
- * @this {AndroidUiautomator2Driver}
4
- * @param {string[]} apks The list of APKs to install. Each APK should be a path to a apk
5
- * or downloadable URL as HTTP/HTTPS.
6
- * @param {import('./types').InstallOptions} [options] Installation options.
7
- * @throws {Error} if an error occured while installing the given APKs.
8
- * @returns {Promise<void>}
4
+ * Installs multiple APKs with `install-multiple` option.
5
+ * @param apks - Array of APK file paths or URLs to install.
6
+ * @param options - Optional installation options (allowTestPackages, useSdcard, grantPermissions, etc.).
7
+ * @throws {errors.InvalidArgumentError} If the apks array is empty or invalid.
9
8
  */
10
- export function mobileInstallMultipleApks(this: import("../driver").AndroidUiautomator2Driver, apks: string[], options?: import("./types").InstallOptions): Promise<void>;
11
- export type AndroidUiautomator2Driver = import("../driver").AndroidUiautomator2Driver;
12
- export type StringRecord<T = any> = import("@appium/types").StringRecord<T>;
9
+ export declare function mobileInstallMultipleApks(this: AndroidUiautomator2Driver, apks: string[], options?: InstallOptions): Promise<void>;
13
10
  //# sourceMappingURL=app-management.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-management.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,qGANW,MAAM,EAAE,YAER,OAAO,SAAS,EAAE,cAAc,GAE9B,OAAO,CAAC,IAAI,CAAC,CAUzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB;yBAI5C,CAAC,UACF,OAAO,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"app-management.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-management.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAE5C;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,yBAAyB,EAC/B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -9,13 +9,10 @@ const bluebird_1 = __importDefault(require("bluebird"));
9
9
  const driver_1 = require("appium/driver");
10
10
  const extensions_1 = require("../extensions");
11
11
  /**
12
- * Install multiple APKs with `install-multiple` option.
13
- * @this {AndroidUiautomator2Driver}
14
- * @param {string[]} apks The list of APKs to install. Each APK should be a path to a apk
15
- * or downloadable URL as HTTP/HTTPS.
16
- * @param {import('./types').InstallOptions} [options] Installation options.
17
- * @throws {Error} if an error occured while installing the given APKs.
18
- * @returns {Promise<void>}
12
+ * Installs multiple APKs with `install-multiple` option.
13
+ * @param apks - Array of APK file paths or URLs to install.
14
+ * @param options - Optional installation options (allowTestPackages, useSdcard, grantPermissions, etc.).
15
+ * @throws {errors.InvalidArgumentError} If the apks array is empty or invalid.
19
16
  */
20
17
  async function mobileInstallMultipleApks(apks, options) {
21
18
  if (!lodash_1.default.isArray(apks) || lodash_1.default.isEmpty(apks)) {
@@ -24,11 +21,4 @@ async function mobileInstallMultipleApks(apks, options) {
24
21
  const configuredApks = await bluebird_1.default.all(apks.map((app) => this.helpers.configureApp(app, [extensions_1.APK_EXTENSION])));
25
22
  await this.adb.installMultipleApks(configuredApks, options);
26
23
  }
27
- /**
28
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
29
- */
30
- /**
31
- * @template [T=any]
32
- * @typedef {import('@appium/types').StringRecord<T>} StringRecord
33
- */
34
24
  //# sourceMappingURL=app-management.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":";;;;;AAcA,8DAQC;AAtBD,oDAAuB;AACvB,wDAAyB;AACzB,0CAAqC;AACrC,8CAA4C;AAE5C;;;;;;;;GAQG;AACI,KAAK,UAAU,yBAAyB,CAAC,IAAI,EAAE,OAAO;IAC3D,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,kBAAC,CAAC,GAAG,CAChC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAC,CACnE,CAAC;IACF,MAAM,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED;;GAEG;AAEH;;;GAGG"}
1
+ {"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.ts"],"names":[],"mappings":";;;;;AAaA,8DAUC;AAvBD,oDAAuB;AACvB,wDAAyB;AACzB,0CAAqC;AACrC,8CAA4C;AAI5C;;;;;GAKG;AACI,KAAK,UAAU,yBAAyB,CAE7C,IAAc,EACd,OAAwB;IAExB,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,kBAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACvG,MAAM,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC"}
@@ -1,9 +1,8 @@
1
+ import type { AndroidUiautomator2Driver } from '../driver';
2
+ import type { BatteryInfo } from './types';
1
3
  /**
2
4
  * Reads the battery information from the device under test.
3
- * @this {AndroidUiautomator2Driver}
4
- * @returns {Promise<import('./types').BatteryInfo>} The actual battery info
5
+ * @returns Battery information including level (0.0-1.0) and state (charging, discharging, etc.).
5
6
  */
6
- export function mobileGetBatteryInfo(this: import("../driver").AndroidUiautomator2Driver): Promise<import("./types").BatteryInfo>;
7
- export type BatteryInfo = import("./types").BatteryInfo;
8
- export type AndroidUiautomator2Driver = import("../driver").AndroidUiautomator2Driver;
7
+ export declare function mobileGetBatteryInfo(this: AndroidUiautomator2Driver): Promise<BatteryInfo>;
9
8
  //# sourceMappingURL=battery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"battery.d.ts","sourceRoot":"","sources":["../../../lib/commands/battery.js"],"names":[],"mappings":"AACA;;;;GAIG;AACH,2FAFa,OAAO,CAAC,OAAO,SAAS,EAAE,WAAW,CAAC,CAalD;0BAGY,OAAO,SAAS,EAAE,WAAW;wCAC7B,OAAO,WAAW,EAAE,yBAAyB"}
1
+ {"version":3,"file":"battery.d.ts","sourceRoot":"","sources":["../../../lib/commands/battery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAEzC;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,WAAW,CAAC,CAUhG"}
@@ -3,19 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mobileGetBatteryInfo = mobileGetBatteryInfo;
4
4
  /**
5
5
  * Reads the battery information from the device under test.
6
- * @this {AndroidUiautomator2Driver}
7
- * @returns {Promise<import('./types').BatteryInfo>} The actual battery info
6
+ * @returns Battery information including level (0.0-1.0) and state (charging, discharging, etc.).
8
7
  */
9
8
  async function mobileGetBatteryInfo() {
10
- const result = /** @type {import('./types').MapKey<BatteryInfo, 'state', 'status'>} */ (await /** @type {import('../uiautomator2').UiAutomator2Server} */ (this.uiautomator2).jwproxy.command('/appium/device/battery_info', 'GET', {}));
11
- const batteryInfo = /** @type {any} */ (result);
9
+ const result = (await this.uiautomator2.jwproxy.command('/appium/device/battery_info', 'GET', {}));
10
+ const batteryInfo = result;
12
11
  // Give it the same name as in iOS
13
12
  batteryInfo.state = result.status;
14
13
  delete batteryInfo.status;
15
- return /** @type {BatteryInfo} */ (batteryInfo);
14
+ return batteryInfo;
16
15
  }
17
- /**
18
- * @typedef {import('./types').BatteryInfo} BatteryInfo
19
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
20
- */
21
16
  //# sourceMappingURL=battery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"battery.js","sourceRoot":"","sources":["../../../lib/commands/battery.js"],"names":[],"mappings":";;AAMA,oDAWC;AAhBD;;;;GAIG;AACI,KAAK,UAAU,oBAAoB;IACxC,MAAM,MAAM,GAAG,uEAAuE,CAAC,CACrF,MAAM,2DAA2D,CAAC,CAChE,IAAI,CAAC,YAAY,CAClB,CAAC,OAAO,CAAC,OAAO,CAAC,6BAA6B,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5D,CAAC;IACF,MAAM,WAAW,GAAG,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,kCAAkC;IAClC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,OAAO,WAAW,CAAC,MAAM,CAAC;IAC1B,OAAO,0BAA0B,CAAC,CAAC,WAAW,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG"}
1
+ {"version":3,"file":"battery.js","sourceRoot":"","sources":["../../../lib/commands/battery.ts"],"names":[],"mappings":";;AAOA,oDAUC;AAdD;;;GAGG;AACI,KAAK,UAAU,oBAAoB;IACxC,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,6BAA6B,EAAE,KAAK,EAAE,EAAE,CAAC,CAGhG,CAAC;IACF,MAAM,WAAW,GAAG,MAAa,CAAC;IAClC,kCAAkC;IAClC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,OAAO,WAAW,CAAC,MAAM,CAAC;IAC1B,OAAO,WAA0B,CAAC;AACpC,CAAC"}
@@ -1,18 +1,14 @@
1
+ import type { AndroidUiautomator2Driver } from '../driver';
1
2
  /**
2
- * @this {AndroidUiautomator2Driver}
3
- * @returns {Promise<string>} Base64-encoded content of the clipboard
4
- * or an empty string if the clipboard is empty.
3
+ * Gets the clipboard content as a base64-encoded string.
4
+ * @returns Base64-encoded clipboard content, or an empty string if the clipboard is empty.
5
5
  */
6
- export function getClipboard(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
6
+ export declare function getClipboard(this: AndroidUiautomator2Driver): Promise<string>;
7
7
  /**
8
- * @this {AndroidUiautomator2Driver}
9
- * @param {string} content Base64-encoded clipboard payload
10
- * @param {'plaintext'} [contentType='plaintext'] Only a single
11
- * content type is supported, which is 'plaintext'
12
- * @param {string} [label] Optinal label to identify the current
13
- * clipboard payload
14
- * @returns {Promise<void>}
8
+ * Sets the clipboard content.
9
+ * @param content - Base64-encoded clipboard payload.
10
+ * @param contentType - Content type. Only 'plaintext' is supported. Defaults to 'plaintext'.
11
+ * @param label - Optional label to identify the current clipboard payload.
15
12
  */
16
- export function setClipboard(this: import("../driver").AndroidUiautomator2Driver, content: string, contentType?: "plaintext", label?: string): Promise<void>;
17
- export type AndroidUiautomator2Driver = import("../driver").AndroidUiautomator2Driver;
13
+ export declare function setClipboard(this: AndroidUiautomator2Driver, content: string, contentType?: 'plaintext', label?: string): Promise<void>;
18
14
  //# sourceMappingURL=clipboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/clipboard.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,mFAHa,OAAO,CAAC,MAAM,CAAC,CAa3B;AAED;;;;;;;;GAQG;AACH,2FAPW,MAAM,gBACN,WAAW,UAEX,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CAQzB;wCAGY,OAAO,WAAW,EAAE,yBAAyB"}
1
+ {"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AAEzD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,CAMnF;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,WAAyB,EACtC,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getClipboard = getClipboard;
4
4
  exports.setClipboard = setClipboard;
5
5
  /**
6
- * @this {AndroidUiautomator2Driver}
7
- * @returns {Promise<string>} Base64-encoded content of the clipboard
8
- * or an empty string if the clipboard is empty.
6
+ * Gets the clipboard content as a base64-encoded string.
7
+ * @returns Base64-encoded clipboard content, or an empty string if the clipboard is empty.
9
8
  */
10
9
  async function getClipboard() {
11
10
  return String((await this.adb.getApiLevel()) < 29
@@ -13,18 +12,12 @@ async function getClipboard() {
13
12
  : await this.settingsApp.getClipboard());
14
13
  }
15
14
  /**
16
- * @this {AndroidUiautomator2Driver}
17
- * @param {string} content Base64-encoded clipboard payload
18
- * @param {'plaintext'} [contentType='plaintext'] Only a single
19
- * content type is supported, which is 'plaintext'
20
- * @param {string} [label] Optinal label to identify the current
21
- * clipboard payload
22
- * @returns {Promise<void>}
15
+ * Sets the clipboard content.
16
+ * @param content - Base64-encoded clipboard payload.
17
+ * @param contentType - Content type. Only 'plaintext' is supported. Defaults to 'plaintext'.
18
+ * @param label - Optional label to identify the current clipboard payload.
23
19
  */
24
- async function setClipboard(content, contentType, label) {
20
+ async function setClipboard(content, contentType = 'plaintext', label) {
25
21
  await this.uiautomator2.jwproxy.command('/appium/device/set_clipboard', 'POST', { content, contentType, label });
26
22
  }
27
- /**
28
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
29
- */
30
23
  //# sourceMappingURL=clipboard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../lib/commands/clipboard.js"],"names":[],"mappings":";;AAKA,oCAUC;AAWD,oCAMC;AAhCD;;;;GAIG;AACI,KAAK,UAAU,YAAY;IAChC,OAAO,MAAM,CACX,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE;QACjC,CAAC,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,8BAA8B,EAC9B,MAAM,EACN,EAAE,CACH;QACH,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAC1C,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,YAAY,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK;IAC5D,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CACrC,8BAA8B,EAC9B,MAAM,EACN,EAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,CAC9B,CAAC;AACJ,CAAC;AAED;;GAEG"}
1
+ {"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../../lib/commands/clipboard.ts"],"names":[],"mappings":";;AAMA,oCAMC;AAQD,oCAOC;AAzBD;;;GAGG;AACI,KAAK,UAAU,YAAY;IAChC,OAAO,MAAM,CACX,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE;QACjC,CAAC,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,8BAA8B,EAAE,MAAM,EAAE,EAAE,CAAC;QACrF,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAC1C,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,YAAY,CAEhC,OAAe,EACf,cAA2B,WAAW,EACtC,KAAc;IAEd,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,8BAA8B,EAAE,MAAM,EAAE,EAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAC,CAAC,CAAC;AACjH,CAAC"}
@@ -3,66 +3,95 @@ import type { Element as AppiumElement, Position, Rect, Size } from '@appium/typ
3
3
  import type { AndroidUiautomator2Driver } from '../driver';
4
4
  /**
5
5
  * Gets the currently active element.
6
+ * @returns The currently active element.
6
7
  */
7
8
  export declare function active(this: AndroidUiautomator2Driver): Promise<AppiumElement>;
8
9
  /**
9
10
  * Gets an element attribute value.
11
+ * @param attribute - Name of the attribute to retrieve.
12
+ * @param elementId - ID of the element.
13
+ * @returns The attribute value as a string.
10
14
  */
11
15
  export declare function getAttribute(this: AndroidUiautomator2Driver, attribute: string, elementId: string): Promise<string>;
12
16
  /**
13
17
  * Returns whether the element is displayed.
18
+ * @param elementId - ID of the element.
19
+ * @returns True if the element is displayed, false otherwise.
14
20
  */
15
21
  export declare function elementDisplayed(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
16
22
  /**
17
23
  * Returns whether the element is enabled.
24
+ * @param elementId - ID of the element.
25
+ * @returns True if the element is enabled, false otherwise.
18
26
  */
19
27
  export declare function elementEnabled(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
20
28
  /**
21
29
  * Returns whether the element is selected.
30
+ * @param elementId - ID of the element.
31
+ * @returns True if the element is selected, false otherwise.
22
32
  */
23
33
  export declare function elementSelected(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
24
34
  /**
25
35
  * Gets the element tag name.
36
+ * @param elementId - ID of the element.
37
+ * @returns The element tag name.
26
38
  */
27
39
  export declare function getName(this: AndroidUiautomator2Driver, elementId: string): Promise<string>;
28
40
  /**
29
41
  * Gets the element location.
42
+ * @param elementId - ID of the element.
43
+ * @returns The element position coordinates (x, y).
30
44
  */
31
45
  export declare function getLocation(this: AndroidUiautomator2Driver, elementId: string): Promise<Position>;
32
46
  /**
33
47
  * Gets the element size.
48
+ * @param elementId - ID of the element.
49
+ * @returns The element size (width, height).
34
50
  */
35
51
  export declare function getSize(this: AndroidUiautomator2Driver, elementId: string): Promise<Size>;
36
52
  /**
37
53
  * Sets the value of an element using the upstream driver API.
54
+ * @param params - Options containing the element ID and value to set.
38
55
  */
39
56
  export declare function doSetElementValue(this: AndroidUiautomator2Driver, params: DoSetElementValueOpts): Promise<void>;
40
57
  /**
41
58
  * Sends text to an element without replacement.
59
+ * @param keys - Text to send, either as a string or array of strings (which will be joined).
60
+ * @param elementId - ID of the element.
42
61
  */
43
62
  export declare function setValueImmediate(this: AndroidUiautomator2Driver, keys: string | string[], elementId: string): Promise<void>;
44
63
  /**
45
64
  * Gets the element text.
65
+ * @param elementId - ID of the element.
66
+ * @returns The element text content.
46
67
  */
47
68
  export declare function getText(this: AndroidUiautomator2Driver, elementId: string): Promise<string>;
48
69
  /**
49
70
  * Clicks the given element.
71
+ * @param element - ID of the element to click.
50
72
  */
51
73
  export declare function click(this: AndroidUiautomator2Driver, element: string): Promise<void>;
52
74
  /**
53
75
  * Takes a screenshot of the element.
76
+ * @param element - ID of the element.
77
+ * @returns Base64-encoded PNG screenshot of the element.
54
78
  */
55
79
  export declare function getElementScreenshot(this: AndroidUiautomator2Driver, element: string): Promise<string>;
56
80
  /**
57
81
  * Clears the element text.
82
+ * @param elementId - ID of the element to clear.
58
83
  */
59
84
  export declare function clear(this: AndroidUiautomator2Driver, elementId: string): Promise<void>;
60
85
  /**
61
86
  * Gets the element rectangle.
87
+ * @param elementId - ID of the element.
88
+ * @returns The element rectangle (x, y, width, height).
62
89
  */
63
90
  export declare function getElementRect(this: AndroidUiautomator2Driver, elementId: string): Promise<Rect>;
64
91
  /**
65
92
  * Replaces the element text.
93
+ * @param elementId - ID of the element.
94
+ * @param text - Text to replace the current element value with.
66
95
  */
67
96
  export declare function mobileReplaceElementValue(this: AndroidUiautomator2Driver, elementId: string, text: string): Promise<void>;
68
97
  //# sourceMappingURL=element.d.ts.map