appium-remote-debugger 15.2.9 → 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.
Files changed (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/mixins/connect.d.ts +47 -31
  3. package/build/lib/mixins/connect.d.ts.map +1 -1
  4. package/build/lib/mixins/connect.js +105 -86
  5. package/build/lib/mixins/connect.js.map +1 -1
  6. package/build/lib/mixins/cookies.d.ts +17 -13
  7. package/build/lib/mixins/cookies.d.ts.map +1 -1
  8. package/build/lib/mixins/cookies.js +12 -12
  9. package/build/lib/mixins/cookies.js.map +1 -1
  10. package/build/lib/mixins/events.d.ts +32 -31
  11. package/build/lib/mixins/events.d.ts.map +1 -1
  12. package/build/lib/mixins/events.js +21 -24
  13. package/build/lib/mixins/events.js.map +1 -1
  14. package/build/lib/mixins/execute.d.ts +35 -24
  15. package/build/lib/mixins/execute.d.ts.map +1 -1
  16. package/build/lib/mixins/execute.js +34 -26
  17. package/build/lib/mixins/execute.js.map +1 -1
  18. package/build/lib/mixins/message-handlers.d.ts +63 -43
  19. package/build/lib/mixins/message-handlers.d.ts.map +1 -1
  20. package/build/lib/mixins/message-handlers.js +74 -57
  21. package/build/lib/mixins/message-handlers.js.map +1 -1
  22. package/build/lib/mixins/misc.d.ts +34 -24
  23. package/build/lib/mixins/misc.d.ts.map +1 -1
  24. package/build/lib/mixins/misc.js +27 -21
  25. package/build/lib/mixins/misc.js.map +1 -1
  26. package/build/lib/mixins/navigate.d.ts +39 -27
  27. package/build/lib/mixins/navigate.d.ts.map +1 -1
  28. package/build/lib/mixins/navigate.js +31 -31
  29. package/build/lib/mixins/navigate.js.map +1 -1
  30. package/build/lib/mixins/screenshot.d.ts +21 -11
  31. package/build/lib/mixins/screenshot.d.ts.map +1 -1
  32. package/build/lib/mixins/screenshot.js +10 -14
  33. package/build/lib/mixins/screenshot.js.map +1 -1
  34. package/build/tsconfig.tsbuildinfo +1 -1
  35. package/lib/mixins/{connect.js → connect.ts} +153 -113
  36. package/lib/mixins/cookies.ts +61 -0
  37. package/lib/mixins/events.ts +91 -0
  38. package/lib/mixins/{execute.js → execute.ts} +59 -33
  39. package/lib/mixins/message-handlers.ts +272 -0
  40. package/lib/mixins/misc.ts +136 -0
  41. package/lib/mixins/{navigate.js → navigate.ts} +44 -41
  42. package/lib/mixins/screenshot.ts +52 -0
  43. package/package.json +1 -1
  44. package/lib/mixins/cookies.js +0 -53
  45. package/lib/mixins/events.js +0 -81
  46. package/lib/mixins/message-handlers.js +0 -224
  47. package/lib/mixins/misc.js +0 -121
  48. package/lib/mixins/screenshot.js +0 -43
@@ -20,11 +20,13 @@ const property_accessors_1 = require("./property-accessors");
20
20
  * These will be added to the prototype.
21
21
  */
22
22
  /**
23
- * @this {RemoteDebugger}
24
- * @param {Error?} err
25
- * @param {string} appIdKey
26
- * @param {Record<string, any>} pageDict
27
- * @returns {Promise<void>}
23
+ * Handles page change notifications from the remote debugger.
24
+ * Updates the page array for the specified application and emits a page change
25
+ * event if the pages have actually changed and navigation is not in progress.
26
+ *
27
+ * @param err - Error object if an error occurred, null or undefined otherwise.
28
+ * @param appIdKey - The application identifier key for which pages have changed.
29
+ * @param pageDict - Dictionary containing the new page information.
28
30
  */
29
31
  async function onPageChange(err, appIdKey, pageDict) {
30
32
  if (lodash_1.default.isEmpty(pageDict)) {
@@ -54,10 +56,12 @@ async function onPageChange(err, appIdKey, pageDict) {
54
56
  });
55
57
  }
56
58
  /**
57
- * @this {RemoteDebugger}
58
- * @param {Error?} err
59
- * @param {Record<string, any>} dict
60
- * @returns {Promise<void>}
59
+ * Handles notifications when a new application connects to the remote debugger.
60
+ * Updates the application dictionary with the new application information.
61
+ *
62
+ * @param err - Error object if an error occurred, null or undefined otherwise.
63
+ * @param dict - Dictionary containing the new application information including
64
+ * the WIRApplicationIdentifierKey.
61
65
  */
62
66
  async function onAppConnect(err, dict) {
63
67
  const appIdKey = dict.WIRApplicationIdentifierKey;
@@ -65,10 +69,14 @@ async function onAppConnect(err, dict) {
65
69
  updateAppsWithDict.bind(this)(dict);
66
70
  }
67
71
  /**
68
- * @this {RemoteDebugger}
69
- * @param {Error?} err
70
- * @param {import('@appium/types').StringRecord} dict
71
- * @returns {void}
72
+ * Handles notifications when an application disconnects from the remote debugger.
73
+ * Removes the application from the dictionary and attempts to find a replacement
74
+ * if the disconnected app was the currently selected one. Emits a disconnect event
75
+ * if no applications remain.
76
+ *
77
+ * @param err - Error object if an error occurred, null or undefined otherwise.
78
+ * @param dict - Dictionary containing the disconnected application information
79
+ * including the WIRApplicationIdentifierKey.
72
80
  */
73
81
  function onAppDisconnect(err, dict) {
74
82
  const appIdKey = dict.WIRApplicationIdentifierKey;
@@ -80,7 +88,7 @@ function onAppDisconnect(err, dict) {
80
88
  // if the disconnected app is the one we are connected to, try to find another
81
89
  if ((0, property_accessors_1.getAppIdKey)(this) === appIdKey) {
82
90
  this.log.debug(`No longer have app id. Attempting to find new one.`);
83
- (0, property_accessors_1.setAppIdKey)(this, getDebuggerAppKey.bind(this)(/** @type {string} */ ((0, property_accessors_1.getBundleId)(this))));
91
+ (0, property_accessors_1.setAppIdKey)(this, getDebuggerAppKey.bind(this)((0, property_accessors_1.getBundleId)(this)));
84
92
  }
85
93
  if (lodash_1.default.isEmpty((0, property_accessors_1.getAppDict)(this))) {
86
94
  // this means we no longer have any apps. what the what?
@@ -89,30 +97,38 @@ function onAppDisconnect(err, dict) {
89
97
  }
90
98
  }
91
99
  /**
92
- * @this {RemoteDebugger}
93
- * @param {Error?} err
94
- * @param {Record<string, any>} dict
95
- * @returns {Promise<void>}
100
+ * Handles notifications when an application's information is updated.
101
+ * Updates the application dictionary with the new information while preserving
102
+ * any existing page array data.
103
+ *
104
+ * @param err - Error object if an error occurred, null or undefined otherwise.
105
+ * @param dict - Dictionary containing the updated application information.
96
106
  */
97
107
  async function onAppUpdate(err, dict) {
98
108
  this.log.debug(`Notified that an application has been updated`);
99
109
  updateAppsWithDict.bind(this)(dict);
100
110
  }
101
111
  /**
102
- * @this {RemoteDebugger}
103
- * @param {Error?} err
104
- * @param {Record<string, any>} drivers
105
- * @returns {void}
112
+ * Handles notifications containing the list of connected drivers.
113
+ * Updates the internal connected drivers list with the received information.
114
+ *
115
+ * @param err - Error object if an error occurred, null or undefined otherwise.
116
+ * @param drivers - Dictionary containing the connected driver list with
117
+ * WIRDriverDictionaryKey.
106
118
  */
107
119
  function onConnectedDriverList(err, drivers) {
108
120
  (0, property_accessors_1.setConnectedDrivers)(this, drivers.WIRDriverDictionaryKey);
109
121
  this.log.debug(`Received connected driver list: ${JSON.stringify(this.connectedDrivers)}`);
110
122
  }
111
123
  /**
112
- * @this {RemoteDebugger}
113
- * @param {Error?} err
114
- * @param {Record<string, any>} state
115
- * @returns {void}
124
+ * Handles notifications about the current automation availability state.
125
+ * This state changes when 'Remote Automation' setting in Safari's advanced settings
126
+ * is toggled. The state can be either WIRAutomationAvailabilityAvailable or
127
+ * WIRAutomationAvailabilityNotAvailable.
128
+ *
129
+ * @param err - Error object if an error occurred, null or undefined otherwise.
130
+ * @param state - Dictionary containing the automation availability state with
131
+ * WIRAutomationAvailabilityKey.
116
132
  */
117
133
  function onCurrentState(err, state) {
118
134
  (0, property_accessors_1.setCurrentState)(this, state.WIRAutomationAvailabilityKey);
@@ -121,16 +137,18 @@ function onCurrentState(err, state) {
121
137
  this.log.debug(`Received connected automation availability state: ${JSON.stringify(this.currentState)}`);
122
138
  }
123
139
  /**
124
- * @this {RemoteDebugger}
125
- * @param {Error?} err
126
- * @param {Record<string, any>} apps
127
- * @returns {Promise<void>}
140
+ * Handles notifications containing the list of connected applications.
141
+ * Translates the received information into the application dictionary format,
142
+ * filtering out any applications that are in the skipped apps list.
143
+ *
144
+ * @param err - Error object if an error occurred, null or undefined otherwise.
145
+ * @param apps - Dictionary containing the connected applications list.
128
146
  */
129
147
  async function onConnectedApplicationList(err, apps) {
130
148
  this.log.debug(`Received connected applications list: ${lodash_1.default.keys(apps).join(', ')}`);
131
149
  // translate the received information into an easier-to-manage
132
150
  // hash with app id as key, and app info as value
133
- let newDict = {};
151
+ const newDict = {};
134
152
  for (const dict of lodash_1.default.values(apps)) {
135
153
  const [id, entry] = (0, utils_1.appInfoFromDict)(dict);
136
154
  if ((0, property_accessors_1.getSkippedApps)(this).includes(entry.name)) {
@@ -142,32 +160,13 @@ async function onConnectedApplicationList(err, apps) {
142
160
  lodash_1.default.defaults((0, property_accessors_1.getAppDict)(this), newDict);
143
161
  }
144
162
  /**
163
+ * Given a bundle ID, finds the correct remote debugger app identifier key
164
+ * that is currently connected. Also handles proxy applications that may act
165
+ * on behalf of the requested bundle ID.
145
166
  *
146
- * @this {RemoteDebugger}
147
- * @param {import('@appium/types').StringRecord} dict
148
- * @returns {void}
149
- */
150
- function updateAppsWithDict(dict) {
151
- // get the dictionary entry into a nice form, and add it to the
152
- // application dictionary
153
- const [id, entry] = (0, utils_1.appInfoFromDict)(dict);
154
- if ((0, property_accessors_1.getAppDict)(this)[id]?.pageArray) {
155
- // preserve the page dictionary for this entry
156
- entry.pageArray = (0, property_accessors_1.getAppDict)(this)[id].pageArray;
157
- }
158
- (0, property_accessors_1.getAppDict)(this)[id] = entry;
159
- // try to get the app id from our connected apps
160
- if (!(0, property_accessors_1.getAppIdKey)(this)) {
161
- (0, property_accessors_1.setAppIdKey)(this, getDebuggerAppKey.bind(this)(/** @type {string} */ ((0, property_accessors_1.getBundleId)(this))));
162
- }
163
- }
164
- /**
165
- * Given a bundle id, finds the correct remote debugger app that is
166
- * connected.
167
- *
168
- * @this {RemoteDebugger}
169
- * @param {string} bundleId
170
- * @returns {string|undefined}
167
+ * @param bundleId - The bundle identifier to search for.
168
+ * @returns The application identifier key if found, undefined otherwise.
169
+ * If a proxy application is found, returns the proxy's app ID instead.
171
170
  */
172
171
  function getDebuggerAppKey(bundleId) {
173
172
  let appId;
@@ -197,6 +196,24 @@ function getDebuggerAppKey(bundleId) {
197
196
  return appId;
198
197
  }
199
198
  /**
200
- * @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
199
+ * Updates the application dictionary with information from the provided dictionary.
200
+ * Preserves existing page array data if the application already exists in the dictionary.
201
+ * Attempts to set the app ID key if one is not currently set.
202
+ *
203
+ * @param dict - Dictionary containing application information to add or update.
201
204
  */
205
+ function updateAppsWithDict(dict) {
206
+ // get the dictionary entry into a nice form, and add it to the
207
+ // application dictionary
208
+ const [id, entry] = (0, utils_1.appInfoFromDict)(dict);
209
+ if ((0, property_accessors_1.getAppDict)(this)[id]?.pageArray) {
210
+ // preserve the page dictionary for this entry
211
+ entry.pageArray = (0, property_accessors_1.getAppDict)(this)[id].pageArray;
212
+ }
213
+ (0, property_accessors_1.getAppDict)(this)[id] = entry;
214
+ // try to get the app id from our connected apps
215
+ if (!(0, property_accessors_1.getAppIdKey)(this)) {
216
+ (0, property_accessors_1.setAppIdKey)(this, getDebuggerAppKey.bind(this)((0, property_accessors_1.getBundleId)(this)));
217
+ }
218
+ }
202
219
  //# sourceMappingURL=message-handlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"message-handlers.js","sourceRoot":"","sources":["../../../lib/mixins/message-handlers.js"],"names":[],"mappings":";;;;;AA6BA,oCAiCC;AAQD,oCAIC;AAQD,0CAoBC;AAQD,kCAGC;AAQD,sDAGC;AAQD,wCAKC;AAQD,gEAeC;AAgCD,8CA2BC;AA3ND,qCAAkC;AAClC,oCAGkB;AAClB,oDAAuB;AACvB,6DAS8B;AAE9B;;;GAGG;AAEH;;;;;;GAMG;AACI,KAAK,UAAU,YAAY,CAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ;IACzD,IAAI,gBAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,yBAAiB,EAAC,QAAQ,CAAC,CAAC;IACjD,kCAAkC;IAClC,IAAI,IAAA,+BAAU,EAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,E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AAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;IAE7B,gDAAgD;IAChD,IAAI,CAAC,IAAA,gCAAW,EAAC,IAAI,CAAC,EAAE,CAAC;QACvB,IAAA,gCAAW,EAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAA,gCAAW,EAAC,IAAI,CAAW,CAAC,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
@@ -1,37 +1,47 @@
1
+ import type { RemoteDebugger } from '../remote-debugger';
1
2
  /**
2
- * @this {RemoteDebugger}
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,O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1 = require("./property-accessors");
45
45
  const SAFARI_BUNDLE_ID = 'com.apple.mobilesafari';
46
46
  const GARBAGE_COLLECT_TIMEOUT_MS = 5000;
47
47
  /**
48
- * @this {RemoteDebugger}
49
- * @returns {Promise<void>}
48
+ * Launches Safari application on the device by sending a launch command
49
+ * to the remote debugger.
50
50
  */
51
51
  async function launchSafari() {
52
52
  await this.requireRpcClient().send('launchApplication', {
@@ -54,9 +54,11 @@ async function launchSafari() {
54
54
  });
55
55
  }
56
56
  /**
57
- * @this {RemoteDebugger}
58
- * @param {import('../types').EventListener} fn
59
- * @returns {Promise<any>}
57
+ * Starts recording the timeline by registering an event listener and
58
+ * sending the Timeline.start command to the remote debugger.
59
+ *
60
+ * @param fn - Event listener function that will be called when timeline events are recorded.
61
+ * @returns A promise that resolves when the timeline recording has started.
60
62
  */
61
63
  async function startTimeline(fn) {
62
64
  this.log.debug('Starting to record the timeline');
@@ -67,8 +69,8 @@ async function startTimeline(fn) {
67
69
  });
68
70
  }
69
71
  /**
70
- * @this {RemoteDebugger}
71
- * @returns {Promise<any>}
72
+ * Stops recording the timeline by sending the Timeline.stop command
73
+ * to the remote debugger.
72
74
  */
73
75
  async function stopTimeline() {
74
76
  this.log.debug('Stopping to record the timeline');
@@ -77,11 +79,12 @@ async function stopTimeline() {
77
79
  pageIdKey: (0, property_accessors_1.getPageIdKey)(this),
78
80
  });
79
81
  }
80
- // Potentially this does not work for mobile safari
81
82
  /**
82
- * @this {RemoteDebugger}
83
- * @param {string} value
84
- * @returns {Promise<any>}
83
+ * Overrides the user agent string for the current page.
84
+ * Note: This may not work for mobile Safari.
85
+ *
86
+ * @param value - The user agent string to set.
87
+ * @returns A promise that resolves when the user agent has been overridden.
85
88
  */
86
89
  async function overrideUserAgent(value) {
87
90
  this.log.debug('Setting overrideUserAgent');
@@ -92,10 +95,13 @@ async function overrideUserAgent(value) {
92
95
  });
93
96
  }
94
97
  /**
95
- * @this {RemoteDebugger}
96
- * @param {number} [timeoutMs=1000] The maximum amount of milliseconds to wait for
97
- * a javascript command response
98
- * @returns {Promise<boolean>} Whether the current page responds to javascript commands
98
+ * Checks whether JavaScript execution is currently blocked on the page
99
+ * by attempting to execute a simple JavaScript command with a timeout.
100
+ *
101
+ * @param timeoutMs - The maximum amount of milliseconds to wait for a JavaScript
102
+ * command response. Defaults to 1000ms.
103
+ * @returns A promise that resolves to true if JavaScript execution is blocked,
104
+ * false if it is not blocked.
99
105
  */
100
106
  async function isJavascriptExecutionBlocked(timeoutMs = 1000) {
101
107
  try {
@@ -112,9 +118,12 @@ async function isJavascriptExecutionBlocked(timeoutMs = 1000) {
112
118
  }
113
119
  }
114
120
  /**
115
- * @this {RemoteDebugger}
116
- * @param {number} [timeoutMs=GARBAGE_COLLECT_TIMEOUT_MS]
117
- * @returns {Promise<void>}
121
+ * Triggers garbage collection on the page's JavaScript heap.
122
+ * This method will gracefully handle cases where garbage collection cannot
123
+ * be performed (e.g., when not connected to a page).
124
+ *
125
+ * @param timeoutMs - Maximum time in milliseconds to wait for garbage collection
126
+ * to complete. Defaults to GARBAGE_COLLECT_TIMEOUT_MS (5000ms).
118
127
  */
119
128
  async function garbageCollect(timeoutMs = GARBAGE_COLLECT_TIMEOUT_MS) {
120
129
  this.log.debug(`Garbage collecting with ${timeoutMs}ms timeout`);
@@ -144,7 +153,4 @@ async function garbageCollect(timeoutMs = GARBAGE_COLLECT_TIMEOUT_MS) {
144
153
  }
145
154
  }
146
155
  }
147
- /**
148
- * @typedef {import('../remote-debugger').RemoteDebugger} RemoteDebugger
149
- */
150
156
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../lib/mixins/misc.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,oCAIC;AAOD,sCAOC;AAMD,oCAMC;AAQD,8CAOC;AAQD,oEAcC;AAOD,wCA4BC;AApHD,oCAAuC;AACvC,qDAA4D;AAC5D,6DAG8B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AC,GAAG,CAAC,KAAK,CAAC,2BAA2B,SAAS,YAAY,CAAC,CAAC;IAEjE,IAAI,CAAC;QACH,IAAA,mBAAW,EAAC;YACV,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;YAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QACzD,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,kBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAC1C,SAAS,EAAE;YACT,QAAQ,EAAE,IAAA,gCAAW,EAAC,IAAI,CAAC;YAC3B,SAAS,EAAE,IAAA,iCAAY,EAAC,IAAI,CAAC;SAC9B,CAAC,CACH,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,CAAC,YAAY,uBAAa,EAAE,CAAC;YAC/B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,sCAAsC,SAAS,IAAI,CAAC,CAAC;QACtE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,41 +1,53 @@
1
+ import { timing } from '@appium/support';
2
+ import type { RemoteDebugger } from '../remote-debugger';
3
+ export declare const DEFAULT_PAGE_READINESS_TIMEOUT_MS: number;
1
4
  /**
2
- * @this {RemoteDebugger}
3
- * @returns {void}
5
+ * Emits a frame detached event when a frame is detached from the page.
6
+ * This is typically called by the RPC client when receiving a Page.frameDetached event.
4
7
  */
5
- export function frameDetached(this: import("../remote-debugger").RemoteDebugger): void;
8
+ export declare function frameDetached(this: RemoteDebugger): void;
6
9
  /**
7
- * @this {RemoteDebugger}
8
- * @returns {void}
10
+ * Cancels the current page load operation by unregistering from page readiness
11
+ * notifications and canceling any pending page load delay.
9
12
  */
10
- export function cancelPageLoad(this: import("../remote-debugger").RemoteDebugger): void;
13
+ export declare function cancelPageLoad(this: RemoteDebugger): void;
11
14
  /**
12
- * Return if current readState can be handles as page load completes
13
- * for the given page load strategy.
15
+ * Determines if the current readyState indicates that page loading is completed
16
+ * based on the configured page load strategy.
14
17
  *
15
- * @this {RemoteDebugger}
16
- * @param {string} readyState
17
- * @returns {boolean}
18
+ * @param readyState - The document readyState value ('loading', 'interactive', or 'complete').
19
+ * @returns True if the page load is considered complete for the current strategy:
20
+ * - 'eager': returns true when readyState is not 'loading'
21
+ * - 'none': always returns true
22
+ * - 'normal' (default): returns true only when readyState is 'complete'
18
23
  */
19
- export function isPageLoadingCompleted(this: import("../remote-debugger").RemoteDebugger, readyState: string): boolean;
24
+ export declare function isPageLoadingCompleted(this: RemoteDebugger, readyState: string): boolean;
20
25
  /**
21
- * @this {RemoteDebugger}
22
- * @param {timing.Timer?} [startPageLoadTimer]
23
- * @returns {Promise<void>}
26
+ * Waits for the DOM to be ready by periodically checking the page readiness state.
27
+ * Uses exponential backoff for retry intervals and respects the configured page load
28
+ * strategy and timeout settings.
29
+ *
30
+ * @param startPageLoadTimer - Optional timer instance to use for tracking elapsed time.
31
+ * If not provided, a new timer will be created and started.
24
32
  */
25
- export function waitForDom(this: import("../remote-debugger").RemoteDebugger, startPageLoadTimer?: timing.Timer | null): Promise<void>;
33
+ export declare function waitForDom(this: RemoteDebugger, startPageLoadTimer?: timing.Timer): Promise<void>;
26
34
  /**
27
- * @this {RemoteDebugger}
28
- * @param {number} [timeoutMs]
29
- * @returns {Promise<boolean>}
35
+ * Checks if the current page is ready by executing a JavaScript command to
36
+ * retrieve the document readyState and evaluating it against the page load strategy.
37
+ *
38
+ * @param timeoutMs - Optional timeout in milliseconds for the readyState check.
39
+ * If not provided, uses the configured page ready timeout.
40
+ * @returns A promise that resolves to true if the page is ready according to
41
+ * the page load strategy, false otherwise or if the check times out.
30
42
  */
31
- export function checkPageIsReady(this: import("../remote-debugger").RemoteDebugger, timeoutMs?: number): Promise<boolean>;
43
+ export declare function checkPageIsReady(this: RemoteDebugger, timeoutMs?: number): Promise<boolean>;
32
44
  /**
33
- * @this {RemoteDebugger}
34
- * @param {string} url
35
- * @returns {Promise<void>}
45
+ * Navigates to a new URL and waits for the page to be ready.
46
+ * Validates the URL format, waits for the page to be available, sends the navigation
47
+ * command, and monitors for the Page.loadEventFired event or timeout.
48
+ *
49
+ * @param url - The URL to navigate to. Must be a valid URL format.
50
+ * @throws TypeError if the provided URL is not a valid URL format.
36
51
  */
37
- export function navToUrl(this: import("../remote-debugger").RemoteDebugger, url: string): Promise<void>;
38
- export const DEFAULT_PAGE_READINESS_TIMEOUT_MS: number;
39
- export type RemoteDebugger = import("../remote-debugger").RemoteDebugger;
40
- import { timing } from '@appium/support';
52
+ export declare function navToUrl(this: RemoteDebugger, url: string): Promise<void>;
41
53
  //# sourceMappingURL=navigate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigate.d.ts","sourceRoot":"","sources":["../../../lib/mixins/navigate.js"],"names":[],"mappings":"AA4BA;;;GAGG;AACH,kFAFa,IAAI,CAIhB;AAED;;;GAGG;AACH,mFAFa,IAAI,CAMhB;AAED;;;;;;;GAOG;AACH,sGAHW,MAAM,GACJ,OAAO,CAcnB;AAED;;;;GAIG;AACH,mGAHW,MAAM,CAAC,KAAK,OAAC,GACX,OAAO,CAAC,IAAI,CAAC,CA+DzB;AAED;;;;GAIG;AACH,gGAHW,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CAuB5B;AAED;;;;GAIG;AACH,iFAHW,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAwFzB;AA/OD,uDAA2D;6BAkP9C,OAAO,oBAAoB,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