/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { EventEmitter } from './eventEmitter';
import { BrowserContext } from './browserContext';
import { ChannelOwner } from './channelOwner';
import { TimeoutSettings } from './timeoutSettings';
import type { Page } from './page';
import type * as types from './types';
import type * as api from '../../types/types';
import type { AndroidServerLauncherImpl } from '../androidServerImpl';
import type * as channels from '@protocol/channels';
import type { Playwright } from './playwright';
type Direction = 'down' | 'up' | 'left' | 'right';
type SpeedOptions = {
    speed?: number;
};
export declare class Android extends ChannelOwner<channels.AndroidChannel> implements api.Android {
    _playwright: Playwright;
    readonly _timeoutSettings: TimeoutSettings;
    _serverLauncher?: AndroidServerLauncherImpl;
    static from(android: channels.AndroidChannel): Android;
    constructor(parent: ChannelOwner, type: string, guid: string, initializer: channels.AndroidInitializer);
    setDefaultTimeout(timeout: number): void;
    devices(options?: {
        port?: number;
    }): Promise<AndroidDevice[]>;
    launchServer(options?: types.LaunchServerOptions): Promise<api.BrowserServer>;
    connect(endpoint: string, options?: Parameters<api.Android['connect']>[1]): Promise<api.AndroidDevice>;
}
export declare class AndroidDevice extends ChannelOwner<channels.AndroidDeviceChannel> implements api.AndroidDevice {
    readonly _timeoutSettings: TimeoutSettings;
    private _webViews;
    private _android;
    _shouldCloseConnectionOnClose: boolean;
    static from(androidDevice: channels.AndroidDeviceChannel): AndroidDevice;
    input: AndroidInput;
    constructor(parent: ChannelOwner, type: string, guid: string, initializer: channels.AndroidDeviceInitializer);
    private _onWebViewAdded;
    private _onWebViewRemoved;
    setDefaultTimeout(timeout: number): void;
    serial(): string;
    model(): string;
    webViews(): AndroidWebView[];
    webView(selector: {
        pkg?: string;
        socketName?: string;
    }, options?: types.TimeoutOptions): Promise<AndroidWebView>;
    wait(selector: api.AndroidSelector, options?: {
        state?: 'gone';
    } & types.TimeoutOptions): Promise<void>;
    fill(selector: api.AndroidSelector, text: string, options?: types.TimeoutOptions): Promise<void>;
    press(selector: api.AndroidSelector, key: api.AndroidKey, options?: types.TimeoutOptions): Promise<void>;
    tap(selector: api.AndroidSelector, options?: {
        duration?: number;
    } & types.TimeoutOptions): Promise<void>;
    drag(selector: api.AndroidSelector, dest: types.Point, options?: SpeedOptions & types.TimeoutOptions): Promise<void>;
    fling(selector: api.AndroidSelector, direction: Direction, options?: SpeedOptions & types.TimeoutOptions): Promise<void>;
    longTap(selector: api.AndroidSelector, options?: types.TimeoutOptions): Promise<void>;
    pinchClose(selector: api.AndroidSelector, percent: number, options?: SpeedOptions & types.TimeoutOptions): Promise<void>;
    pinchOpen(selector: api.AndroidSelector, percent: number, options?: SpeedOptions & types.TimeoutOptions): Promise<void>;
    scroll(selector: api.AndroidSelector, direction: Direction, percent: number, options?: SpeedOptions & types.TimeoutOptions): Promise<void>;
    swipe(selector: api.AndroidSelector, direction: Direction, percent: number, options?: SpeedOptions & types.TimeoutOptions): Promise<void>;
    info(selector: api.AndroidSelector): Promise<api.AndroidElementInfo>;
    screenshot(options?: {
        path?: string;
    }): Promise<Buffer>;
    [Symbol.asyncDispose](): Promise<void>;
    close(): Promise<void>;
    _didClose(): void;
    shell(command: string): Promise<Buffer>;
    open(command: string): Promise<AndroidSocket>;
    installApk(file: string | Buffer, options?: {
        args: string[];
    }): Promise<void>;
    push(file: string | Buffer, path: string, options?: {
        mode: number;
    }): Promise<void>;
    launchBrowser(options?: types.BrowserContextOptions & {
        pkg?: string;
    }): Promise<BrowserContext>;
    waitForEvent(event: string, optionsOrPredicate?: types.WaitForEventOptions): Promise<any>;
}
export declare class AndroidSocket extends ChannelOwner<channels.AndroidSocketChannel> implements api.AndroidSocket {
    static from(androidDevice: channels.AndroidSocketChannel): AndroidSocket;
    constructor(parent: ChannelOwner, type: string, guid: string, initializer: channels.AndroidSocketInitializer);
    write(data: Buffer): Promise<void>;
    close(): Promise<void>;
    [Symbol.asyncDispose](): Promise<void>;
}
export declare class AndroidInput implements api.AndroidInput {
    private _device;
    constructor(device: AndroidDevice);
    type(text: string): Promise<void>;
    press(key: api.AndroidKey): Promise<void>;
    tap(point: types.Point): Promise<void>;
    swipe(from: types.Point, segments: types.Point[], steps: number): Promise<void>;
    drag(from: types.Point, to: types.Point, steps: number): Promise<void>;
}
export declare class AndroidWebView extends EventEmitter implements api.AndroidWebView {
    private _device;
    private _data;
    private _pagePromise;
    constructor(device: AndroidDevice, data: channels.AndroidWebView);
    pid(): number;
    pkg(): string;
    _socketName(): string;
    page(): Promise<Page>;
    private _fetchPage;
}
export {};
//# sourceMappingURL=android.d.ts.map