appium-remote-debugger 15.2.10 → 15.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [15.2.11](https://github.com/appium/appium-remote-debugger/compare/v15.2.10...v15.2.11) (2026-01-21)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * Migrate the rest of mixins to typescript ([#465](https://github.com/appium/appium-remote-debugger/issues/465)) ([1588bf9](https://github.com/appium/appium-remote-debugger/commit/1588bf90c85ac165f563353cacd03e6b85efd66b))
6
+
1
7
  ## [15.2.10](https://github.com/appium/appium-remote-debugger/compare/v15.2.9...v15.2.10) (2026-01-20)
2
8
 
3
9
  ### Miscellaneous Chores
@@ -1,23 +1,27 @@
1
+ import type { RemoteDebugger } from '../remote-debugger';
2
+ import type { StringRecord } from '@appium/types';
1
3
  /**
4
+ * Retrieves all cookies for the current page by sending a Page.getCookies
5
+ * command to the remote debugger.
2
6
  *
3
- * @this {RemoteDebugger}
4
- * @returns {Promise<import('@appium/types').StringRecord>}
7
+ * @returns A promise that resolves to a dictionary containing the cookies.
5
8
  */
6
- export function getCookies(this: import("../remote-debugger").RemoteDebugger): Promise<import("@appium/types").StringRecord>;
9
+ export declare function getCookies(this: RemoteDebugger): Promise<StringRecord>;
7
10
  /**
11
+ * Sets a cookie on the current page by sending a Page.setCookie command
12
+ * to the remote debugger.
8
13
  *
9
- * @this {RemoteDebugger}
10
- * @param {import('@appium/types').StringRecord} cookie
11
- * @returns {Promise<any>}
14
+ * @param cookie - Dictionary containing the cookie properties to set.
15
+ * @returns A promise that resolves when the cookie has been set.
12
16
  */
13
- export function setCookie(this: import("../remote-debugger").RemoteDebugger, cookie: import("@appium/types").StringRecord): Promise<any>;
17
+ export declare function setCookie(this: RemoteDebugger, cookie: StringRecord): Promise<any>;
14
18
  /**
19
+ * Deletes a cookie from the current page by sending a Page.deleteCookie
20
+ * command to the remote debugger.
15
21
  *
16
- * @this {RemoteDebugger}
17
- * @param {string} cookieName
18
- * @param {string} url
19
- * @returns {Promise<any>}
22
+ * @param cookieName - The name of the cookie to delete.
23
+ * @param url - The URL associated with the cookie to delete.
24
+ * @returns A promise that resolves when the cookie has been deleted.
20
25
  */
21
- export function deleteCookie(this: import("../remote-debugger").RemoteDebugger, cookieName: string, url: string): Promise<any>;
22
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
26
+ export declare function deleteCookie(this: RemoteDebugger, cookieName: string, url: string): Promise<any>;
23
27
  //# sourceMappingURL=cookies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/mixins/cookies.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,+EAFa,OAAO,CAAC,OAAO,eAAe,EAAE,YAAY,CAAC,CAQzD;AAED;;;;;GAKG;AACH,qFAHW,OAAO,eAAe,EAAE,YAAY,GAClC,OAAO,CAAC,GAAG,CAAC,CASxB;AAED;;;;;;GAMG;AACH,4FAJW,MAAM,OACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CAUxB;6BAGY,OAAO,oBAAoB,EAAE,cAAc"}
1
+ {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../lib/mixins/cookies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAM5E;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,GAAG,CAAC,CAOd;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,GAAG,CAAC,CAQd"}
@@ -5,9 +5,10 @@ exports.setCookie = setCookie;
5
5
  exports.deleteCookie = deleteCookie;
6
6
  const property_accessors_1 = require("./property-accessors");
7
7
  /**
8
+ * Retrieves all cookies for the current page by sending a Page.getCookies
9
+ * command to the remote debugger.
8
10
  *
9
- * @this {RemoteDebugger}
10
- * @returns {Promise<import('@appium/types').StringRecord>}
11
+ * @returns A promise that resolves to a dictionary containing the cookies.
11
12
  */
12
13
  async function getCookies() {
13
14
  this.log.debug('Getting cookies');
@@ -17,10 +18,11 @@ async function getCookies() {
17
18
  });
18
19
  }
19
20
  /**
21
+ * Sets a cookie on the current page by sending a Page.setCookie command
22
+ * to the remote debugger.
20
23
  *
21
- * @this {RemoteDebugger}
22
- * @param {import('@appium/types').StringRecord} cookie
23
- * @returns {Promise<any>}
24
+ * @param cookie - Dictionary containing the cookie properties to set.
25
+ * @returns A promise that resolves when the cookie has been set.
24
26
  */
25
27
  async function setCookie(cookie) {
26
28
  this.log.debug('Setting cookie');
@@ -31,11 +33,12 @@ async function setCookie(cookie) {
31
33
  });
32
34
  }
33
35
  /**
36
+ * Deletes a cookie from the current page by sending a Page.deleteCookie
37
+ * command to the remote debugger.
34
38
  *
35
- * @this {RemoteDebugger}
36
- * @param {string} cookieName
37
- * @param {string} url
38
- * @returns {Promise<any>}
39
+ * @param cookieName - The name of the cookie to delete.
40
+ * @param url - The URL associated with the cookie to delete.
41
+ * @returns A promise that resolves when the cookie has been deleted.
39
42
  */
40
43
  async function deleteCookie(cookieName, url) {
41
44
  this.log.debug(`Deleting cookie '${cookieName}' on '${url}'`);
@@ -46,7 +49,4 @@ async function deleteCookie(cookieName, url) {
46
49
  url,
47
50
  });
48
51
  }
49
- /**
50
- * @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
51
- */
52
52
  //# sourceMappingURL=cookies.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/mixins/cookies.js"],"names":[],"mappings":";;AAUA,gCAMC;AAQD,8BAOC;AASD,oCAQC;AAhDD,6DAG8B;AAE9B;;;;GAIG;AACI,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAClC,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;QAC3D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,SAAS,CAAE,MAAM;IACrC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACjC,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC1D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;QAC7B,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,YAAY,CAAE,UAAU,EAAE,GAAG;IACjD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,UAAU,SAAS,GAAG,GAAG,CAAC,CAAC;IAC9D,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE;QAC7D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;QAC7B,UAAU;QACV,GAAG;KACJ,CAAC,CAAC;AACL,CAAC;AAED;;GAEG"}
1
+ {"version":3,"file":"cookies.js","sourceRoot":"","sources":["../../../lib/mixins/cookies.ts"],"names":[],"mappings":";;AAaA,gCAMC;AASD,8BAUC;AAUD,oCAYC;AA5DD,6DAG8B;AAI9B;;;;;GAKG;AACI,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAClC,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;QAC3D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,SAAS,CAE7B,MAAoB;IAEpB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACjC,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC1D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;QAC7B,MAAM;KACP,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,YAAY,CAEhC,UAAkB,EAClB,GAAW;IAEX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,UAAU,SAAS,GAAG,GAAG,CAAC,CAAC;IAC9D,OAAO,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE;QAC7D,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;QAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;QAC7B,UAAU;QACV,GAAG;KACJ,CAAC,CAAC;AACL,CAAC"}
@@ -1,45 +1,46 @@
1
+ import type { RemoteDebugger } from '../remote-debugger';
2
+ import type { EventListener } from '../types';
3
+ export declare const events: {
4
+ readonly EVENT_PAGE_CHANGE: "remote_debugger_page_change";
5
+ readonly EVENT_FRAMES_DETACHED: "remote_debugger_frames_detached";
6
+ readonly EVENT_DISCONNECT: "remote_debugger_disconnect";
7
+ };
1
8
  /**
2
- * Keep track of the client event listeners so they can be removed
9
+ * Adds a client event listener to the RPC client and tracks it for later removal.
10
+ * The listener will be called when the specified event is emitted by the remote debugger.
3
11
  *
4
- * @this {RemoteDebugger}
5
- * @param {string} eventName
6
- * @param {import('../types').EventListener} listener
7
- * @returns {void}
12
+ * @param eventName - The name of the event to listen for.
13
+ * @param listener - The event listener function to call when the event is emitted.
8
14
  */
9
- export function addClientEventListener(this: import("../remote-debugger").RemoteDebugger, eventName: string, listener: import("../types").EventListener): void;
15
+ export declare function addClientEventListener(this: RemoteDebugger, eventName: string, listener: EventListener): void;
10
16
  /**
11
- * @this {RemoteDebugger}
12
- * @param {string} eventName
13
- * @returns {void}
17
+ * Removes all client event listeners for the specified event name from the RPC client.
18
+ * This will stop listening for the event and clean up the tracked listeners.
19
+ *
20
+ * @param eventName - The name of the event to stop listening for.
14
21
  */
15
- export function removeClientEventListener(this: import("../remote-debugger").RemoteDebugger, eventName: string): void;
22
+ export declare function removeClientEventListener(this: RemoteDebugger, eventName: string): void;
16
23
  /**
17
- * @this {RemoteDebugger}
18
- * @param {import('../types').EventListener} listener
19
- * @returns {void}
24
+ * Starts listening for JavaScript console messages by registering listeners
25
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
26
+ *
27
+ * @param listener - The event listener function to call when console messages are received.
20
28
  */
21
- export function startConsole(this: import("../remote-debugger").RemoteDebugger, listener: import("../types").EventListener): void;
29
+ export declare function startConsole(this: RemoteDebugger, listener: EventListener): void;
22
30
  /**
23
- * @this {RemoteDebugger}
24
- * @returns {void}
31
+ * Stops listening for JavaScript console messages by removing listeners
32
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
25
33
  */
26
- export function stopConsole(this: import("../remote-debugger").RemoteDebugger): void;
34
+ export declare function stopConsole(this: RemoteDebugger): void;
27
35
  /**
28
- * @this {RemoteDebugger}
29
- * @param {import('../types').EventListener} listener
30
- * @returns {void}
36
+ * Starts listening for network events by registering a listener for NetworkEvent.
37
+ * This aggregates all Network.* events into a single NetworkEvent.
38
+ *
39
+ * @param listener - The event listener function to call when network events are received.
31
40
  */
32
- export function startNetwork(this: import("../remote-debugger").RemoteDebugger, listener: import("../types").EventListener): void;
41
+ export declare function startNetwork(this: RemoteDebugger, listener: EventListener): void;
33
42
  /**
34
- * @this {RemoteDebugger}
35
- * @returns {void}
43
+ * Stops listening for network events by removing the listener for NetworkEvent.
36
44
  */
37
- export function stopNetwork(this: import("../remote-debugger").RemoteDebugger): void;
38
- export namespace events {
39
- let EVENT_PAGE_CHANGE: "remote_debugger_page_change";
40
- let EVENT_FRAMES_DETACHED: "remote_debugger_frames_detached";
41
- let EVENT_DISCONNECT: "remote_debugger_disconnect";
42
- }
43
- export default events;
44
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
45
+ export declare function stopNetwork(this: RemoteDebugger): void;
45
46
  //# sourceMappingURL=events.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../lib/mixins/events.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,qGAJW,MAAM,YACN,OAAO,UAAU,EAAE,aAAa,GAC9B,IAAI,CAMhB;AAED;;;;GAIG;AACH,wGAHW,MAAM,GACJ,IAAI,CAMhB;AAED;;;;GAIG;AACH,0FAHW,OAAO,UAAU,EAAE,aAAa,GAC9B,IAAI,CAMhB;AAED;;;GAGG;AACH,gFAFa,IAAI,CAMhB;AAED;;;;GAIG;AACH,0FAHW,OAAO,UAAU,EAAE,aAAa,GAC9B,IAAI,CAKhB;AAED;;;GAGG;AACH,gFAFa,IAAI,CAKhB;;;;;;;6BAKY,OAAO,oBAAoB,EAAE,cAAc"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../lib/mixins/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,eAAO,MAAM,MAAM;;;;CAIT,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,GAChB,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAIN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAItD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,aAAa,GACtB,IAAI,CAGN;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAGtD"}
@@ -9,18 +9,17 @@ exports.startNetwork = startNetwork;
9
9
  exports.stopNetwork = stopNetwork;
10
10
  const property_accessors_1 = require("./property-accessors");
11
11
  // event emitted publically
12
- exports.events = ({
12
+ exports.events = {
13
13
  EVENT_PAGE_CHANGE: 'remote_debugger_page_change',
14
14
  EVENT_FRAMES_DETACHED: 'remote_debugger_frames_detached',
15
15
  EVENT_DISCONNECT: 'remote_debugger_disconnect',
16
- });
16
+ };
17
17
  /**
18
- * Keep track of the client event listeners so they can be removed
18
+ * Adds a client event listener to the RPC client and tracks it for later removal.
19
+ * The listener will be called when the specified event is emitted by the remote debugger.
19
20
  *
20
- * @this {RemoteDebugger}
21
- * @param {string} eventName
22
- * @param {import('../types').EventListener} listener
23
- * @returns {void}
21
+ * @param eventName - The name of the event to listen for.
22
+ * @param listener - The event listener function to call when the event is emitted.
24
23
  */
25
24
  function addClientEventListener(eventName, listener) {
26
25
  (0, property_accessors_1.getClientEventListeners)(this)[eventName] ??= [];
@@ -28,9 +27,10 @@ function addClientEventListener(eventName, listener) {
28
27
  this.requireRpcClient().on(eventName, listener);
29
28
  }
30
29
  /**
31
- * @this {RemoteDebugger}
32
- * @param {string} eventName
33
- * @returns {void}
30
+ * Removes all client event listeners for the specified event name from the RPC client.
31
+ * This will stop listening for the event and clean up the tracked listeners.
32
+ *
33
+ * @param eventName - The name of the event to stop listening for.
34
34
  */
35
35
  function removeClientEventListener(eventName) {
36
36
  for (const listener of ((0, property_accessors_1.getClientEventListeners)(this)[eventName] || [])) {
@@ -38,9 +38,10 @@ function removeClientEventListener(eventName) {
38
38
  }
39
39
  }
40
40
  /**
41
- * @this {RemoteDebugger}
42
- * @param {import('../types').EventListener} listener
43
- * @returns {void}
41
+ * Starts listening for JavaScript console messages by registering listeners
42
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
43
+ *
44
+ * @param listener - The event listener function to call when console messages are received.
44
45
  */
45
46
  function startConsole(listener) {
46
47
  this.log.debug('Starting to listen for JavaScript console');
@@ -48,8 +49,8 @@ function startConsole(listener) {
48
49
  this.addClientEventListener('Console.messageRepeatCountUpdated', listener);
49
50
  }
50
51
  /**
51
- * @this {RemoteDebugger}
52
- * @returns {void}
52
+ * Stops listening for JavaScript console messages by removing listeners
53
+ * for Console.messageAdded and Console.messageRepeatCountUpdated events.
53
54
  */
54
55
  function stopConsole() {
55
56
  this.log.debug('Stopping to listen for JavaScript console');
@@ -57,24 +58,20 @@ function stopConsole() {
57
58
  this.removeClientEventListener('Console.messageRepeatCountUpdated');
58
59
  }
59
60
  /**
60
- * @this {RemoteDebugger}
61
- * @param {import('../types').EventListener} listener
62
- * @returns {void}
61
+ * Starts listening for network events by registering a listener for NetworkEvent.
62
+ * This aggregates all Network.* events into a single NetworkEvent.
63
+ *
64
+ * @param listener - The event listener function to call when network events are received.
63
65
  */
64
66
  function startNetwork(listener) {
65
67
  this.log.debug('Starting to listen for network events');
66
68
  this.addClientEventListener('NetworkEvent', listener);
67
69
  }
68
70
  /**
69
- * @this {RemoteDebugger}
70
- * @returns {void}
71
+ * Stops listening for network events by removing the listener for NetworkEvent.
71
72
  */
72
73
  function stopNetwork() {
73
74
  this.log.debug('Stopping to listen for network events');
74
75
  this.removeClientEventListener('NetworkEvent');
75
76
  }
76
- exports.default = exports.events;
77
- /**
78
- * @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
79
- */
80
77
  //# sourceMappingURL=events.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../../lib/mixins/events.js"],"names":[],"mappings":";;;AAmBA,wDAIC;AAOD,8DAIC;AAOD,oCAIC;AAMD,kCAIC;AAOD,oCAGC;AAMD,kCAGC;AA1ED,6DAE8B;AAE9B,2BAA2B;AACd,QAAA,MAAM,GAAwB,CAAC;IAC1C,iBAAiB,EAAE,6BAA6B;IAChD,qBAAqB,EAAE,iCAAiC;IACxD,gBAAgB,EAAE,4BAA4B;CAC/C,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,SAAgB,sBAAsB,CAAE,SAAS,EAAE,QAAQ;IACzD,IAAA,4CAAuB,EAAC,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IAChD,IAAA,4CAAuB,EAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,IAAI,CAAC,gBAAgB,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,SAAgB,yBAAyB,CAAE,SAAS;IAClD,KAAK,MAAM,QAAQ,IAAI,CAAC,IAAA,4CAAuB,EAAC,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QACxE,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,CAAC,SA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D,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW;IACzB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACxD,IAAI,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC;AACjD,CAAC"}
@@ -1,34 +1,45 @@
1
+ import type { RemoteDebugger } from '../remote-debugger';
1
2
  /**
2
- * Execute a Selenium atom in Safari
3
+ * Executes a Selenium atom in Safari by generating the atom script and
4
+ * executing it in the page context.
3
5
  *
4
- * @this {RemoteDebugger}
5
- * @param {string} atom Name of Selenium atom (see atoms/ directory)
6
- * @param {any[]} args Arguments passed to the atom
7
- * @param {string[]} frames
8
- * @returns {Promise<any>} The result received from the atom
6
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
7
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
8
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
9
+ * @returns A promise that resolves to the result received from the atom execution.
9
10
  */
10
- export function executeAtom(this: import("../remote-debugger").RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
11
+ export declare function executeAtom(this: RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
11
12
  /**
12
- * @this {RemoteDebugger}
13
- * @param {string} atom
14
- * @param {any[]} [args]
15
- * @param {string[]} [frames]
16
- * @returns {Promise<any>}
13
+ * Executes a Selenium atom asynchronously by creating a Promise in the page context
14
+ * and waiting for the atom to resolve it. Falls back to polling if Runtime.awaitPromise
15
+ * is not available.
16
+ *
17
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
18
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
19
+ * If args[2] is provided, it will be used as the timeout in milliseconds.
20
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
21
+ * @returns A promise that resolves to the result received from the atom execution.
17
22
  */
18
- export function executeAtomAsync(this: import("../remote-debugger").RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
23
+ export declare function executeAtomAsync(this: RemoteDebugger, atom: string, args?: any[], frames?: string[]): Promise<any>;
19
24
  /**
20
- * @this {RemoteDebugger}
21
- * @param {string} command
22
- * @param {boolean} [override] - Deprecated and unused
23
- * @returns {Promise<any>}
25
+ * Executes a JavaScript command in the page context and returns the result.
26
+ * Optionally performs garbage collection before execution if configured.
27
+ *
28
+ * @param command - The JavaScript command string to execute.
29
+ * @param override - Deprecated and unused parameter.
30
+ * @returns A promise that resolves to the result of the JavaScript evaluation,
31
+ * converted to a usable format.
24
32
  */
25
- export function execute(this: import("../remote-debugger").RemoteDebugger, command: string, override?: boolean): Promise<any>;
33
+ export declare function execute(this: RemoteDebugger, command: string, override?: boolean): Promise<any>;
26
34
  /**
27
- * @this {RemoteDebugger}
28
- * @param {string} objectId
29
- * @param {any} fn
30
- * @param {any[]} [args]
35
+ * Calls a JavaScript function on a remote object identified by objectId.
36
+ * Optionally performs garbage collection before execution if configured.
37
+ *
38
+ * @param objectId - The object identifier of the remote object to call the function on.
39
+ * @param fn - The function declaration string to execute on the object.
40
+ * @param args - Optional array of arguments to pass to the function.
41
+ * @returns A promise that resolves to the result of the function call,
42
+ * converted to a usable format.
31
43
  */
32
- export function callFunction(this: import("../remote-debugger").RemoteDebugger, objectId: string, fn: any, args?: any[]): Promise<any>;
33
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
44
+ export declare function callFunction(this: RemoteDebugger, objectId: string, fn: string, args?: any[]): Promise<any>;
34
45
  //# sourceMappingURL=execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/mixins/execute.js"],"names":[],"mappings":"AAoBA;;;;;;;;GAQG;AACH,qFALW,MAAM,SACN,GAAG,EAAE,WACL,MAAM,EAAE,GACN,OAAO,CAAC,GAAG,CAAC,CAQxB;AAED;;;;;;GAMG;AACH,0FALW,MAAM,SACN,GAAG,EAAE,WACL,MAAM,EAAE,GACN,OAAO,CAAC,GAAG,CAAC,CAoFxB;AAED;;;;;GAKG;AAEH,oFALW,MAAM,aACN,OAAO,GACL,OAAO,CAAC,GAAG,CAAC,CA0BxB;AAED;;;;;GAKG;AACH,0FAJW,MAAM,MACN,GAAG,SACH,GAAG,EAAE,gBAuBf;6BAGY,OAAO,oBAAoB,EAAE,cAAc"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../lib/mixins/execute.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,GAAG,EAAO,EAChB,MAAM,GAAE,MAAM,EAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CAQd;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,GAAG,EAAO,EAChB,MAAM,GAAE,MAAM,EAAO,GACpB,OAAO,CAAC,GAAG,CAAC,CAkFd;AAED;;;;;;;;GAQG;AAEH,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAuBrG;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,GAAG,EAAE,GACX,OAAO,CAAC,GAAG,CAAC,CAqBd"}
@@ -17,27 +17,33 @@ const property_accessors_1 = require("./property-accessors");
17
17
  /* How many milliseconds to wait for webkit to return a response before timing out */
18
18
  const RPC_RESPONSE_TIMEOUT_MS = 5000;
19
19
  /**
20
- * Execute a Selenium atom in Safari
20
+ * Executes a Selenium atom in Safari by generating the atom script and
21
+ * executing it in the page context.
21
22
  *
22
- * @this {RemoteDebugger}
23
- * @param {string} atom Name of Selenium atom (see atoms/ directory)
24
- * @param {any[]} args Arguments passed to the atom
25
- * @param {string[]} frames
26
- * @returns {Promise<any>} The result received from the atom
23
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
24
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
25
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
26
+ * @returns A promise that resolves to the result received from the atom execution.
27
27
  */
28
28
  async function executeAtom(atom, args = [], frames = []) {
29
29
  this.log.debug(`Executing atom '${atom}' with 'args=${JSON.stringify(args)}; frames=${frames}'`);
30
30
  const script = await (0, atoms_1.getScriptForAtom)(atom, args, frames);
31
31
  const value = await this.execute(script);
32
- this.log.debug(`Received result for atom '${atom}' execution: ${lodash_1.default.truncate((0, utils_1.simpleStringify)(value), { length: utils_1.RESPONSE_LOG_LENGTH })}`);
32
+ this.log.debug(`Received result for atom '${atom}' execution: ${lodash_1.default.truncate((0, utils_1.simpleStringify)(value), {
33
+ length: utils_1.RESPONSE_LOG_LENGTH
34
+ })}`);
33
35
  return value;
34
36
  }
35
37
  /**
36
- * @this {RemoteDebugger}
37
- * @param {string} atom
38
- * @param {any[]} [args]
39
- * @param {string[]} [frames]
40
- * @returns {Promise<any>}
38
+ * Executes a Selenium atom asynchronously by creating a Promise in the page context
39
+ * and waiting for the atom to resolve it. Falls back to polling if Runtime.awaitPromise
40
+ * is not available.
41
+ *
42
+ * @param atom - Name of the Selenium atom to execute (see atoms/ directory).
43
+ * @param args - Arguments to pass to the atom function. Defaults to empty array.
44
+ * If args[2] is provided, it will be used as the timeout in milliseconds.
45
+ * @param frames - Frame context array for frame-specific execution. Defaults to empty array.
46
+ * @returns A promise that resolves to the result received from the atom execution.
41
47
  */
42
48
  async function executeAtomAsync(atom, args = [], frames = []) {
43
49
  // helper to send directly to the web inspector
@@ -119,10 +125,13 @@ async function executeAtomAsync(atom, args = [], frames = []) {
119
125
  return (0, utils_1.convertJavascriptEvaluationResult)(res);
120
126
  }
121
127
  /**
122
- * @this {RemoteDebugger}
123
- * @param {string} command
124
- * @param {boolean} [override] - Deprecated and unused
125
- * @returns {Promise<any>}
128
+ * Executes a JavaScript command in the page context and returns the result.
129
+ * Optionally performs garbage collection before execution if configured.
130
+ *
131
+ * @param command - The JavaScript command string to execute.
132
+ * @param override - Deprecated and unused parameter.
133
+ * @returns A promise that resolves to the result of the JavaScript evaluation,
134
+ * converted to a usable format.
126
135
  */
127
136
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
128
137
  async function execute(command, override) {
@@ -134,9 +143,7 @@ async function execute(command, override) {
134
143
  await this.garbageCollect();
135
144
  }
136
145
  const rpcClient = this.requireRpcClient(true);
137
- await rpcClient.waitForPage(
138
- /** @type {import('../types').AppIdKey} */ (appIdKey),
139
- /** @type {import('../types').PageIdKey} */ (pageIdKey));
146
+ await rpcClient.waitForPage(appIdKey, pageIdKey);
140
147
  this.log.debug(`Sending javascript command: '${lodash_1.default.truncate(command, { length: 50 })}'`);
141
148
  const res = await rpcClient.send('Runtime.evaluate', {
142
149
  expression: command,
@@ -147,10 +154,14 @@ async function execute(command, override) {
147
154
  return (0, utils_1.convertJavascriptEvaluationResult)(res);
148
155
  }
149
156
  /**
150
- * @this {RemoteDebugger}
151
- * @param {string} objectId
152
- * @param {any} fn
153
- * @param {any[]} [args]
157
+ * Calls a JavaScript function on a remote object identified by objectId.
158
+ * Optionally performs garbage collection before execution if configured.
159
+ *
160
+ * @param objectId - The object identifier of the remote object to call the function on.
161
+ * @param fn - The function declaration string to execute on the object.
162
+ * @param args - Optional array of arguments to pass to the function.
163
+ * @returns A promise that resolves to the result of the function call,
164
+ * converted to a usable format.
154
165
  */
155
166
  async function callFunction(objectId, fn, args) {
156
167
  const { appIdKey, pageIdKey } = (0, utils_1.checkParams)({
@@ -171,7 +182,4 @@ async function callFunction(objectId, fn, args) {
171
182
  });
172
183
  return (0, utils_1.convertJavascriptEvaluationResult)(res);
173
184
  }
174
- /**
175
- * @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
176
- */
177
185
  //# sourceMappingURL=execute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../lib/mixins/execute.js"],"names":[],"mappings":";;;;;AA6BA,kCAMC;AASD,4CAkFC;AASD,0BAuBC;AAQD,oCAqBC;AA3LD,qDAA6C;AAC7C,oCAKkB;AAClB,oCAA4C;AAC5C,6CAA+C;AAC/C,uCAAyC;AACzC,oDAAuB;AACvB,6DAI8B;AAE9B,qFAAqF;AACrF,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAErC;;;;;;;;GAQG;AACI,KAAK,UAAU,WAAW,CAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE;IAC7D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,IAAI,gBAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,MAAM,GAAG,CAAC,CAAC;IACjG,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAgB,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6BAA6B,IAAI,gBAAgB,gBAAC,CAAC,QAAQ,CAAC,IAAA,uBAAe,EAAC,KAAK,CAAC,EAAE,EAAC,MAAM,EAAE,2BAAmB,EAAC,CAAC,EAAE,CAAC,CAAC;IACrI,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,gBAAgB,CAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE;IAClE,+CAA+C;IAC/C,MAAM,QAAQ,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,gBAA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ger}
3
- * @returns {Promise<void>}
3
+ * Launches Safari application on the device by sending a launch command
4
+ * to the remote debugger.
4
5
  */
5
- export function launchSafari(this: import("../remote-debugger").RemoteDebugger): Promise<void>;
6
+ export declare function launchSafari(this: RemoteDebugger): Promise<void>;
6
7
  /**
7
- * @this {RemoteDebugger}
8
- * @param {import('../types').EventListener} fn
9
- * @returns {Promise<any>}
8
+ * Starts recording the timeline by registering an event listener and
9
+ * sending the Timeline.start command to the remote debugger.
10
+ *
11
+ * @param fn - Event listener function that will be called when timeline events are recorded.
12
+ * @returns A promise that resolves when the timeline recording has started.
10
13
  */
11
- export function startTimeline(this: import("../remote-debugger").RemoteDebugger, fn: import("../types").EventListener): Promise<any>;
14
+ export declare function startTimeline(this: RemoteDebugger, fn: import('../types').EventListener): Promise<any>;
12
15
  /**
13
- * @this {RemoteDebugger}
14
- * @returns {Promise<any>}
16
+ * Stops recording the timeline by sending the Timeline.stop command
17
+ * to the remote debugger.
15
18
  */
16
- export function stopTimeline(this: import("../remote-debugger").RemoteDebugger): Promise<any>;
19
+ export declare function stopTimeline(this: RemoteDebugger): Promise<any>;
17
20
  /**
18
- * @this {RemoteDebugger}
19
- * @param {string} value
20
- * @returns {Promise<any>}
21
+ * Overrides the user agent string for the current page.
22
+ * Note: This may not work for mobile Safari.
23
+ *
24
+ * @param value - The user agent string to set.
25
+ * @returns A promise that resolves when the user agent has been overridden.
21
26
  */
22
- export function overrideUserAgent(this: import("../remote-debugger").RemoteDebugger, value: string): Promise<any>;
27
+ export declare function overrideUserAgent(this: RemoteDebugger, value: string): Promise<any>;
23
28
  /**
24
- * @this {RemoteDebugger}
25
- * @param {number} [timeoutMs=1000] The maximum amount of milliseconds to wait for
26
- * a javascript command response
27
- * @returns {Promise<boolean>} Whether the current page responds to javascript commands
29
+ * Checks whether JavaScript execution is currently blocked on the page
30
+ * by attempting to execute a simple JavaScript command with a timeout.
31
+ *
32
+ * @param timeoutMs - The maximum amount of milliseconds to wait for a JavaScript
33
+ * command response. Defaults to 1000ms.
34
+ * @returns A promise that resolves to true if JavaScript execution is blocked,
35
+ * false if it is not blocked.
28
36
  */
29
- export function isJavascriptExecutionBlocked(this: import("../remote-debugger").RemoteDebugger, timeoutMs?: number): Promise<boolean>;
37
+ export declare function isJavascriptExecutionBlocked(this: RemoteDebugger, timeoutMs?: number): Promise<boolean>;
30
38
  /**
31
- * @this {RemoteDebugger}
32
- * @param {number} [timeoutMs=GARBAGE_COLLECT_TIMEOUT_MS]
33
- * @returns {Promise<void>}
39
+ * Triggers garbage collection on the page's JavaScript heap.
40
+ * This method will gracefully handle cases where garbage collection cannot
41
+ * be performed (e.g., when not connected to a page).
42
+ *
43
+ * @param timeoutMs - Maximum time in milliseconds to wait for garbage collection
44
+ * to complete. Defaults to GARBAGE_COLLECT_TIMEOUT_MS (5000ms).
34
45
  */
35
- export function garbageCollect(this: import("../remote-debugger").RemoteDebugger, timeoutMs?: number): Promise<void>;
36
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
46
+ export declare function garbageCollect(this: RemoteDebugger, timeoutMs?: number): Promise<void>;
37
47
  //# sourceMappingURL=misc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../lib/mixins/misc.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH,iFAFa,OAAO,CAAC,IAAI,CAAC,CAMzB;AAED;;;;GAIG;AACH,qFAHW,OAAO,UAAU,EAAE,aAAa,GAC9B,OAAO,CAAC,GAAG,CAAC,CASxB;AAED;;;GAGG;AACH,iFAFa,OAAO,CAAC,GAAG,CAAC,CAQxB;AAGD;;;;GAIG;AACH,4FAHW,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,CASxB;AAED;;;;;GAKG;AACH,4GAJW,MAAM,GAEJ,OAAO,CAAC,OAAO,CAAC,CAgB5B;AAED;;;;GAIG;AACH,8FAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CA8BzB;6BAGY,OAAO,oBAAoB,E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