import { Size, Point } from '@midscene/core';
import { ElementInfo } from '@midscene/shared/extractor';
import { AndroidDevicePage } from '@midscene/web';
import { ADB, Device } from 'appium-adb';
import { PageAgent, PageAgentOpt } from '@midscene/web/agent';

declare class AndroidDevice implements AndroidDevicePage {
    private deviceId;
    private screenSize;
    private yadbPushed;
    private deviceRatio;
    private adb;
    private connectingAdb;
    pageType: string;
    constructor(deviceId: string);
    connect(): Promise<ADB>;
    getAdb(): Promise<ADB>;
    launch(uri: string): Promise<AndroidDevice>;
    private execYadb;
    getElementsInfo(): Promise<ElementInfo[]>;
    getElementsNodeTree(): Promise<any>;
    size(): Promise<Size>;
    /**
     * Convert logical coordinates to physical coordinates, handling device ratio
     * @param x Logical X coordinate
     * @param y Logical Y coordinate
     * @returns Physical coordinate point
     */
    private adjustCoordinates;
    /**
     * Convert physical coordinates to logical coordinates, handling device ratio
     * @param x Physical X coordinate
     * @param y Physical Y coordinate
     * @returns Logical coordinate point
     */
    private reverseAdjustCoordinates;
    screenshotBase64(): Promise<string>;
    get mouse(): {
        click: (x: number, y: number) => Promise<void>;
        wheel: (deltaX: number, deltaY: number) => Promise<void>;
        move: (x: number, y: number) => Promise<void>;
        drag: (from: {
            x: number;
            y: number;
        }, to: {
            x: number;
            y: number;
        }) => Promise<void>;
    };
    get keyboard(): {
        type: (text: string) => Promise<void>;
        press: (action: {
            key: string;
            command?: string;
        } | {
            key: string;
            command?: string;
        }[]) => Promise<void>;
    };
    clearInput(element: ElementInfo): Promise<void>;
    private forceScreenshot;
    url(): Promise<string>;
    scrollUntilTop(startPoint?: Point): Promise<void>;
    scrollUntilBottom(startPoint?: Point): Promise<void>;
    scrollUntilLeft(startPoint?: Point): Promise<void>;
    scrollUntilRight(startPoint?: Point): Promise<void>;
    scrollUp(distance?: number, startPoint?: Point): Promise<void>;
    scrollDown(distance?: number, startPoint?: Point): Promise<void>;
    scrollLeft(distance?: number, startPoint?: Point): Promise<void>;
    scrollRight(distance?: number, startPoint?: Point): Promise<void>;
    private ensureYadb;
    private keyboardType;
    private keyboardPress;
    private keyboardPressAction;
    private mouseClick;
    private mouseMove;
    private mouseDrag;
    private mouseWheel;
    destroy(): Promise<void>;
}

declare class AndroidAgent extends PageAgent<AndroidDevice> {
    launch(uri: string): Promise<void>;
}
declare function agentFromAdbDevice(deviceId?: string, opts?: PageAgentOpt): Promise<AndroidAgent>;

declare function getConnectedDevices(): Promise<Device[]>;

export { AndroidAgent, AndroidDevice, agentFromAdbDevice, getConnectedDevices };
