import { AdbAdapter } from "./adb.js"; import { AccessibilityNode } from "../parsers/ui-dump.js"; import { VisualSnapshot } from "../types/index.js"; import { FindWithFallbacksResult, FindOptions } from "../types/icon-recognition.js"; export interface ScreenMetadata { width: number; height: number; density: number; } export interface CurrentApp { packageName: string; activityName: string; } export interface ScreenshotOptions { localPath?: string; inline?: boolean; maxDimension?: number; raw?: boolean; } export interface ScreenshotResult { mode: "file" | "inline"; path?: string; base64?: string; mimeType?: string; sizeBytes?: number; device?: { width: number; height: number; }; image?: { width: number; height: number; }; scaleFactor?: number; warning?: string; } /** * Tracks the current scaling state between device and image coordinates. * Updated on every screenshot operation. */ export interface ScalingState { scaleFactor: number; deviceWidth: number; deviceHeight: number; imageWidth: number; imageHeight: number; } export declare class UiAutomatorAdapter { private adb; private scalingState; constructor(adb?: AdbAdapter); getScalingState(): ScalingState | null; dump(deviceId: string): Promise; find(deviceId: string, selector: { resourceId?: string; text?: string; textContains?: string; className?: string; }): Promise; tap(deviceId: string, x: number, y: number, deviceSpace?: boolean): Promise; tapElement(deviceId: string, element: AccessibilityNode): Promise; input(deviceId: string, text: string): Promise; scroll(deviceId: string, direction: "up" | "down" | "left" | "right", amount?: number, bounds?: { left: number; top: number; right: number; bottom: number; }): Promise; screenshot(deviceId: string, options?: ScreenshotOptions): Promise; accessibilityCheck(deviceId: string): Promise<{ hasAccessibleElements: boolean; clickableCount: number; textCount: number; totalElements: number; }>; getScreenMetadata(deviceId: string): Promise; getCurrentApp(deviceId: string): Promise; visualSnapshot(deviceId: string, options?: { includeBase64?: boolean; }): Promise; findWithFallbacks(deviceId: string, selector: { resourceId?: string; text?: string; textContains?: string; className?: string; }, options?: FindOptions): Promise; }