UNPKG

appium-remote-debugger

Version:
81 lines 4.52 kB
import type { RemoteDebugger } from '../remote-debugger'; import type { StringRecord } from '@appium/types'; /** * Handles page change notifications from the remote debugger. * Updates the page array for the specified application and emits a page change * event if the pages have actually changed and navigation is not in progress. * * @param err - Error object if an error occurred, null or undefined otherwise. * @param appIdKey - The application identifier key for which pages have changed. * @param pageDict - Dictionary containing the new page information. */ export declare function onPageChange(this: RemoteDebugger, err: Error | null | undefined, appIdKey: string, pageDict: StringRecord): Promise<void>; /** * Handles notifications when a new application connects to the remote debugger. * Updates the application dictionary with the new application information. * * @param err - Error object if an error occurred, null or undefined otherwise. * @param dict - Dictionary containing the new application information including * the WIRApplicationIdentifierKey. */ export declare function onAppConnect(this: RemoteDebugger, err: Error | null | undefined, dict: StringRecord): Promise<void>; /** * Handles notifications when an application disconnects from the remote debugger. * Removes the application from the dictionary and attempts to find a replacement * if the disconnected app was the currently selected one. Emits a disconnect event * if no applications remain. * * @param err - Error object if an error occurred, null or undefined otherwise. * @param dict - Dictionary containing the disconnected application information * including the WIRApplicationIdentifierKey. */ export declare function onAppDisconnect(this: RemoteDebugger, err: Error | null | undefined, dict: StringRecord): void; /** * Handles notifications when an application's information is updated. * Updates the application dictionary with the new information while preserving * any existing page array data. * * @param err - Error object if an error occurred, null or undefined otherwise. * @param dict - Dictionary containing the updated application information. */ export declare function onAppUpdate(this: RemoteDebugger, err: Error | null | undefined, dict: StringRecord): Promise<void>; /** * Handles notifications containing the list of connected drivers. * Updates the internal connected drivers list with the received information. * * @param err - Error object if an error occurred, null or undefined otherwise. * @param drivers - Dictionary containing the connected driver list with * WIRDriverDictionaryKey. */ export declare function onConnectedDriverList(this: RemoteDebugger, err: Error | null | undefined, drivers: StringRecord): void; /** * Handles notifications about the current automation availability state. * This state changes when 'Remote Automation' setting in Safari's advanced settings * is toggled. The state can be either WIRAutomationAvailabilityAvailable or * WIRAutomationAvailabilityNotAvailable. * * @param err - Error object if an error occurred, null or undefined otherwise. * @param state - Dictionary containing the automation availability state with * WIRAutomationAvailabilityKey. */ export declare function onCurrentState(this: RemoteDebugger, err: Error | null | undefined, state: StringRecord): void; /** * Handles notifications containing the list of connected applications. * Translates the received information into the application dictionary format, * filtering out any applications that are in the skipped apps list. * * @param err - Error object if an error occurred, null or undefined otherwise. * @param apps - Dictionary containing the connected applications list. */ export declare function onConnectedApplicationList(this: RemoteDebugger, err: Error | null | undefined, apps: StringRecord): Promise<void>; /** * Given a bundle ID, finds the correct remote debugger app identifier key * that is currently connected. Also handles proxy applications that may act * on behalf of the requested bundle ID. * * @param bundleId - The bundle identifier to search for. * @returns The application identifier key if found, undefined otherwise. * If a proxy application is found, returns the proxy's app ID instead. */ export declare function getDebuggerAppKey(this: RemoteDebugger, bundleId: string): string | undefined; //# sourceMappingURL=message-handlers.d.ts.map