/** * Device — high-level abstraction over a connected Android device. * * Combines all ADB operations into a single stateful object that tracks * the device serial, screen dimensions, and provides convenience methods. */ import type { DeviceInfo, ScreenSize, UIElement, ElementSelector, TapOptions, SwipeOptions, TypeOptions, WaitOptions, ScreenshotResult, UITreeResult, AppInfo } from "./types.js"; export declare class Device { readonly serial: string; private screenSize; constructor(serial: string); private get opts(); /** * Connect to a device by serial, or auto-detect the first available. */ static connect(serial?: string): Promise; /** * List all connected devices. */ static listAll(): Promise; getScreenSize(): Promise; isReady(): Promise; tap(x: number, y: number, options?: TapOptions): Promise; swipe(x1: number, y1: number, x2: number, y2: number, options?: SwipeOptions): Promise; typeText(text: string, options?: TypeOptions): Promise; keyEvent(keycode: string | number): Promise; back(): Promise; home(): Promise; enter(): Promise; scrollDown(): Promise; scrollUp(): Promise; screenshot(options?: { prefix?: string; includeBase64?: boolean; }): Promise; screenshotBase64(): Promise; uiDump(): Promise; findElement(selector: ElementSelector): Promise; findElements(selector: ElementSelector): Promise; waitForElement(selector: ElementSelector, options?: WaitOptions): Promise; /** * Get a text summary of the current screen (for LLM context). */ describeScreen(): Promise; /** * Tap an element matching a selector. UI dumps first to get fresh coordinates. */ tapElement(selector: ElementSelector, options?: TapOptions): Promise; /** * Wait for an element and tap it. */ waitAndTap(selector: ElementSelector, options?: WaitOptions & TapOptions): Promise; /** * Type text into an element (taps it first to focus). */ typeInto(selector: ElementSelector, text: string, options?: TypeOptions): Promise; launchApp(packageName: string, activity?: string): Promise; stopApp(packageName: string): Promise; getAppInfo(packageName: string): Promise; keepScreenOn(): Promise; wake(): Promise; isScreenOn(): Promise; /** * Ensure the screen is on and awake. */ ensureAwake(): Promise; }