appium-uiautomator2-driver 6.7.4 → 6.7.6

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.
@@ -1,51 +1,31 @@
1
+ import type { Orientation, StringRecord } from '@appium/types';
2
+ import type { AndroidUiautomator2Driver } from '../driver';
1
3
  /**
2
- * @this {AndroidUiautomator2Driver}
3
- * @returns {Promise<string>}
4
+ * Retrieves the current page source.
4
5
  */
5
- export function getPageSource(this: import("../driver").AndroidUiautomator2Driver): Promise<string>;
6
+ export declare function getPageSource(this: AndroidUiautomator2Driver): Promise<string>;
6
7
  /**
7
- * @this {AndroidUiautomator2Driver}
8
- * @returns {Promise<import('@appium/types').Orientation>}
8
+ * Gets the current device orientation.
9
9
  */
10
- export function getOrientation(this: import("../driver").AndroidUiautomator2Driver): Promise<import("@appium/types").Orientation>;
10
+ export declare function getOrientation(this: AndroidUiautomator2Driver): Promise<Orientation>;
11
11
  /**
12
- * @this {AndroidUiautomator2Driver}
13
- * @param {import('@appium/types').Orientation} orientation
14
- * @returns {Promise<void>}
12
+ * Sets the device orientation.
15
13
  */
16
- export function setOrientation(this: import("../driver").AndroidUiautomator2Driver, orientation: import("@appium/types").Orientation): Promise<void>;
14
+ export declare function setOrientation(this: AndroidUiautomator2Driver, orientation: Orientation): Promise<void>;
17
15
  /**
18
- * @this {AndroidUiautomator2Driver}
19
- * @returns {Promise<void>}
16
+ * Opens the device notification shade.
20
17
  */
21
- export function openNotifications(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
18
+ export declare function openNotifications(this: AndroidUiautomator2Driver): Promise<void>;
22
19
  /**
23
- * Stop proxying to any Chromedriver and redirect to uiautomator2
24
- * @this {AndroidUiautomator2Driver}
25
- * @returns {void}
20
+ * Stops proxying to Chromedriver and restores UIA2 proxy.
26
21
  */
27
- export function suspendChromedriverProxy(this: import("../driver").AndroidUiautomator2Driver): void;
28
- export class suspendChromedriverProxy {
29
- chromedriver: any;
30
- proxyReqRes: any;
31
- proxyCommand: (<TReq = any, TRes = unknown>(url: string, method: import("@appium/types").HTTPMethod, body?: TReq) => Promise<TRes>) | undefined;
32
- jwpProxyActive: boolean | undefined;
33
- }
22
+ export declare function suspendChromedriverProxy(this: AndroidUiautomator2Driver): void;
34
23
  /**
35
- * The list of available info entries can be found at
36
- * https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java
37
- * @this {AndroidUiautomator2Driver}
38
- * @returns {Promise<StringRecord>}
24
+ * Retrieves device info via the UIA2 server.
39
25
  */
40
- export function mobileGetDeviceInfo(this: import("../driver").AndroidUiautomator2Driver): Promise<StringRecord>;
26
+ export declare function mobileGetDeviceInfo(this: AndroidUiautomator2Driver): Promise<StringRecord>;
41
27
  /**
42
28
  * Resets the accessibility cache on the device.
43
- * This can be useful when the accessibility service cache becomes stale
44
- * and needs to be refreshed to reflect the current UI state.
45
- * @this {AndroidUiautomator2Driver}
46
- * @returns {Promise<void>}
47
29
  */
48
- export function mobileResetAccessibilityCache(this: import("../driver").AndroidUiautomator2Driver): Promise<void>;
49
- export type StringRecord<T = any> = import("@appium/types").StringRecord<T>;
50
- export type AndroidUiautomator2Driver<T = any> = import("../driver").AndroidUiautomator2Driver;
30
+ export declare function mobileResetAccessibilityCache(this: AndroidUiautomator2Driver): Promise<void>;
51
31
  //# sourceMappingURL=misc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../lib/commands/misc.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oFAFa,OAAO,CAAC,MAAM,CAAC,CAU3B;AAED;;;GAGG;AACH,qFAFa,OAAO,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC,CAUxD;AAED;;;;GAIG;AACH,iGAHW,OAAO,eAAe,EAAE,WAAW,GACjC,OAAO,CAAC,IAAI,CAAC,CASzB;AAED;;;GAGG;AACH,wFAFa,OAAO,CAAC,IAAI,CAAC,CAQzB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endChromedriverProxy = suspendChromedriverProxy;
8
8
  exports.mobileGetDeviceInfo = mobileGetDeviceInfo;
9
9
  exports.mobileResetAccessibilityCache = mobileResetAccessibilityCache;
10
10
  /**
11
- * @this {AndroidUiautomator2Driver}
12
- * @returns {Promise<string>}
11
+ * Retrieves the current page source.
13
12
  */
14
13
  async function getPageSource() {
15
14
  return String(await this.uiautomator2.jwproxy.command('/source', 'GET', {}));
16
15
  }
17
16
  /**
18
- * @this {AndroidUiautomator2Driver}
19
- * @returns {Promise<import('@appium/types').Orientation>}
17
+ * Gets the current device orientation.
20
18
  */
21
19
  async function getOrientation() {
22
- return /** @type {import('@appium/types').Orientation} */ (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {}));
20
+ return (await this.uiautomator2.jwproxy.command(`/orientation`, 'GET', {}));
23
21
  }
24
22
  /**
25
- * @this {AndroidUiautomator2Driver}
26
- * @param {import('@appium/types').Orientation} orientation
27
- * @returns {Promise<void>}
23
+ * Sets the device orientation.
28
24
  */
29
25
  async function setOrientation(orientation) {
30
- orientation = /** @type {import('@appium/types').Orientation} */ (orientation.toUpperCase());
31
- await this.uiautomator2.jwproxy.command(`/orientation`, 'POST', { orientation });
26
+ const normalizedOrientation = orientation.toUpperCase();
27
+ await this.uiautomator2.jwproxy.command(`/orientation`, 'POST', { orientation: normalizedOrientation });
32
28
  }
33
29
  /**
34
- * @this {AndroidUiautomator2Driver}
35
- * @returns {Promise<void>}
30
+ * Opens the device notification shade.
36
31
  */
37
32
  async function openNotifications() {
38
33
  await this.uiautomator2.jwproxy.command('/appium/device/open_notifications', 'POST', {});
39
34
  }
40
35
  /**
41
- * Stop proxying to any Chromedriver and redirect to uiautomator2
42
- * @this {AndroidUiautomator2Driver}
43
- * @returns {void}
36
+ * Stops proxying to Chromedriver and restores UIA2 proxy.
44
37
  */
45
38
  function suspendChromedriverProxy() {
46
39
  if (!this.uiautomator2?.proxyReqRes || !this.uiautomator2?.proxyCommand) {
@@ -48,31 +41,19 @@ function suspendChromedriverProxy() {
48
41
  }
49
42
  this.chromedriver = undefined;
50
43
  this.proxyReqRes = this.uiautomator2.proxyReqRes.bind(this.uiautomator2);
51
- this.proxyCommand = /** @type {typeof this.proxyCommand} */ (this.uiautomator2.proxyCommand.bind(this.uiautomator2));
44
+ this.proxyCommand = this.uiautomator2.proxyCommand.bind(this.uiautomator2);
52
45
  this.jwpProxyActive = true;
53
46
  }
54
47
  /**
55
- * The list of available info entries can be found at
56
- * https://github.com/appium/appium-uiautomator2-server/blob/master/app/src/main/java/io/appium/uiautomator2/handler/GetDeviceInfo.java
57
- * @this {AndroidUiautomator2Driver}
58
- * @returns {Promise<StringRecord>}
48
+ * Retrieves device info via the UIA2 server.
59
49
  */
60
50
  async function mobileGetDeviceInfo() {
61
- return /** @type {StringRecord} */ (await this.uiautomator2.jwproxy.command('/appium/device/info', 'GET'));
51
+ return (await this.uiautomator2.jwproxy.command('/appium/device/info', 'GET'));
62
52
  }
63
53
  /**
64
54
  * Resets the accessibility cache on the device.
65
- * This can be useful when the accessibility service cache becomes stale
66
- * and needs to be refreshed to reflect the current UI state.
67
- * @this {AndroidUiautomator2Driver}
68
- * @returns {Promise<void>}
69
55
  */
70
56
  async function mobileResetAccessibilityCache() {
71
57
  await this.uiautomator2.jwproxy.command('/appium/reset_ax_cache', 'POST', {});
72
58
  }
73
- /**
74
- * @template [T=any]
75
- * @typedef {import('@appium/types').StringRecord<T>} StringRecord
76
- * @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
77
- */
78
59
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../lib/commands/misc.js"],"names":[],"mappings":";;AAIA,sCAQC;AAMD,wCAQC;AAOD,wCAOC;AAMD,8CAMC;AAOD,4DAaC;AAQD,kDAOC;AASD,sEAMC;AAtGD;;;GAGG;AACI,KAAK,UAAU,aAAa;IACjC,OAAO,MAAM,CACX,MAAM,IAAI,CAAC,YAAY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