import { resolveHeavyDepPath, resolveHeavyDepPathInCache, resolveHeavyDepSource, ensureRuntimeInstalled } from "../../runtime/loader.js"; import { type ManagedWdaHit } from "../../runtime/wdaProducts.js"; import { stepTargetsAppSurface } from "../../runtime/browserStepKeys.js"; import { type ActiveSurfaceTracker } from "./activeSurface.js"; export { classifyAppIdentifier, defaultAppSurfaceName, classifyNativeSelector, buildUiaLocator, buildAxLocator, buildUiAutomator2Locator, buildXCUITestLocator, createAppSessionState, appSurfacePreflight, probeMacAccessibility, isAppDriverRequired, stepTargetsAppSurface, resolveAppSurfaceRef, ensureAppForeground, startAppSurface, findAppElement, buildAppLocator, closeAppSurface, teardownAppSession, snapshotAppServerDescendants, reapConsoleOrphans, listWindowsDescendantPids, invalidateStaleAppiumManifest, probeIosToolchain, }; export type { AppSessionState, AppSurfaceEntry }; type AppIdentifierKind = "path" | "aumid" | "id"; declare function classifyAppIdentifier(app: string): AppIdentifierKind; declare function defaultAppSurfaceName(app: string): string; type NativeSelectorKind = "xpath" | "accessibilityId" | "css"; declare function classifyNativeSelector(selector: string): NativeSelectorKind; declare function buildUiaLocator(criteria: { elementText?: string; elementId?: string; elementTestId?: string; elementAria?: { role?: string; name?: string; } | string; [key: string]: any; }): { strategy: string; value: string; } | null; declare function buildAxLocator(criteria: { elementText?: string; elementId?: string; elementTestId?: string; elementAria?: { role?: string; name?: string; } | string; [key: string]: any; }): { strategy: string; value: string; } | null; declare function buildUiAutomator2Locator(criteria: { elementText?: string; elementId?: string; elementTestId?: string; elementAria?: { role?: string; name?: string; } | string; [key: string]: any; }): { strategy: string; value: string; } | null; declare function buildXCUITestLocator(criteria: { elementText?: string; elementId?: string; elementTestId?: string; elementAria?: { role?: string; name?: string; } | string; [key: string]: any; }): { strategy: string; value: string; } | null; interface AppDriverPlatform { driverPackage: string; driverLabel: string; platformName: string; automationName: string; buildLocator(criteria: { [key: string]: any; }): { strategy: string; value: string; } | null; buildCapabilities(descriptor: any, appId: string, extras?: { udid?: string; locateWda?: () => ManagedWdaHit | null; }): Record; nameFieldsCollide: boolean; unsupportedFields: { field: string; isSet(value: any): boolean; guidance: string; }[]; } export declare const APP_DRIVER_PLATFORMS: Record; interface AppSurfaceEntry { name: string; appId: string; driver: any; launchedByUs: boolean; platform?: string; deviceName?: string; activeWindow?: { handle?: string; element?: any; title?: string; }; mainWindowHandle?: string; appPid?: number | null; knownWindows?: string[]; foreignWindows?: Set; baselineWindowHandles?: Set; windowBaseline?: string[]; } interface AppSessionState { server?: { port: number; process: any; }; appiumEntry?: string; appiumHome?: string; surfaces: Map; activeApp?: string; tracker?: ActiveSurfaceTracker; recordingHost: { state: { recordings: any[]; }; }; deviceSessions?: Map; defaultDevice?: any; androidSdkRoot?: string; androidDeviceRegistry?: any; androidDeviceDeps?: any; iosSimulatorRegistry?: any; iosSimulatorDeps?: any; } declare function createAppSessionState(): AppSessionState; declare function isAppDriverRequired({ test }: { test: any; }): boolean; declare function resolveAppSurfaceRef(surface: any, appSession?: AppSessionState): { entry?: AppSurfaceEntry; window?: any; error?: string; } | null; declare function invalidateStaleAppiumManifest(home: string, driverPackage: string): void; declare function probeMacAccessibility(): Promise; declare function probeIosToolchain(deps?: { platform?: NodeJS.Platform; run?: (command: string, args: string[]) => { status: number | null; stdout?: string; stderr?: string; }; }): { ok: true; } | { ok: false; reason: string; }; declare function appSurfacePreflight({ config, platform, deps, }: { config: any; platform: string; deps?: { resolveSource?: typeof resolveHeavyDepSource; resolvePath?: typeof resolveHeavyDepPath; resolvePathInCache?: typeof resolveHeavyDepPathInCache; ensureInstalled?: typeof ensureRuntimeInstalled; probeAccessibility?: () => Promise; probeIosToolchain?: () => { ok: true; } | { ok: false; reason: string; }; }; }): Promise<{ ok: true; appiumEntry: string; appiumHome: string; } | { ok: false; reason: string; }>; declare function buildAppLocator(criteria: { selector?: string; [key: string]: any; }, platform?: string): { strategy: string; value: string; } | { error: string; }; export declare const MAX_FIND_SCROLLS = 5; declare function findAppElement({ driver, criteria, timeout, platform, root, }: { driver: any; criteria: any; timeout?: number; platform?: string; root?: any; }): Promise<{ element?: any; error?: string; }>; declare function startAppSurface({ config, step, appSession, platform, serverDeps, }: { config: any; step: any; appSession: AppSessionState; platform: string; serverDeps: { startServer: (appiumEntry: string, appiumHome: string) => Promise<{ port: number; process: any; }>; startDriver: (capabilities: any, port: number) => Promise; acquireDevice?: (desc: any) => Promise<{ entry: { name: string; udid: string; }; } | { skip: string; }>; locateWda?: () => ManagedWdaHit | null; }; }): Promise; declare function ensureAppForeground(entry: AppSurfaceEntry, appSession?: AppSessionState): Promise<{ error?: string; }>; declare function closeAppSurface({ entry, appSession, }: { entry: AppSurfaceEntry; appSession: AppSessionState; }): Promise; interface ConsoleOrphanTools { /** Rows of the OS process table as {pid, ppid}. */ runQuery?: () => Promise>; /** Descendant pids of `rootPid` (overrides runQuery-based walking). */ listDescendants?: (rootPid: number) => Promise>; /** Whether a pid still refers to a live process. */ isAlive?: (pid: number) => boolean; /** Force-terminate a single pid. */ forceKill?: (pid: number) => void; } declare function listWindowsDescendantPids(rootPid: number, runQuery: () => Promise>): Promise>; declare function snapshotAppServerDescendants(serverPid: number | undefined, tools?: ConsoleOrphanTools): Promise>; declare function reapConsoleOrphans(pids: Iterable, tools?: ConsoleOrphanTools): Promise; declare function teardownAppSession(appSession: AppSessionState | undefined, killServer: (pid: number | undefined) => Promise, tools?: ConsoleOrphanTools): Promise; //# sourceMappingURL=appSurface.d.ts.map