import { JWProxy } from 'appium/driver.js';
import { type ServerSigningConfig } from './builder.js';
import type { AppiumLogger, StringRecord, HTTPMethod, HTTPBody, ProxyResponse } from '@appium/types';
import type { ADB } from 'appium-adb';
import type { SubProcess } from 'teen_process';
export interface EspressoRunnerOptions {
    adb: ADB;
    tmpDir: string;
    host: string;
    systemPort: number;
    devicePort: number;
    appPackage: string;
    forceEspressoRebuild: boolean;
    reqBasePath?: string;
    showGradleLog?: boolean;
    espressoBuildConfig?: string;
    serverLaunchTimeout?: number;
    androidInstallTimeout?: number;
    disableSuppressAccessibilityService?: boolean;
    useKeystore?: boolean;
    keystorePath?: string;
    keystorePassword?: string;
    keyAlias?: string;
    keyPassword?: string;
}
interface InstrumentationState {
    crashed: boolean;
    exited: boolean;
}
declare class EspressoProxy extends JWProxy {
    instrumentationState: InstrumentationState;
    proxyCommand(url: string, method: HTTPMethod, body?: HTTPBody): Promise<[ProxyResponse, HTTPBody]>;
}
export declare class EspressoRunner {
    readonly host: string;
    readonly systemPort: number;
    readonly appPackage: string;
    readonly adb: ADB;
    readonly tmpDir: string;
    readonly forceEspressoRebuild: boolean;
    readonly devicePort: number;
    readonly jwproxy: EspressoProxy;
    readonly proxyReqRes: typeof EspressoProxy.prototype.proxyReqRes;
    readonly proxyCommand: typeof EspressoProxy.prototype.command;
    readonly modServerPath: string;
    readonly showGradleLog?: boolean;
    readonly espressoBuildConfig?: string;
    readonly serverLaunchTimeout: number;
    readonly androidInstallTimeout?: number;
    readonly disableSuppressAccessibilityService?: boolean;
    readonly signingConfig: ServerSigningConfig | null;
    instProcess: SubProcess | null;
    private readonly log;
    constructor(log: AppiumLogger, opts: EspressoRunnerOptions);
    isAppPackageChanged(): Promise<boolean>;
    /**
     * Installs Espresso server apk on to the device or emulator.
     * Each adb command uses default timeout by them.
     */
    installServer(): Promise<void>;
    installTestApk(): Promise<void>;
    buildNewModServer(): Promise<void>;
    startSession(caps: StringRecord): Promise<void>;
    deleteSession(): Promise<void>;
    private cleanupSessionLeftovers;
    private recordTargetAppPackage;
    private _verifyServerStatus;
}
/**
 * Recursively copy all files except build directories contents
 * @param sourceBaseDir directory to copy files from
 * @param targetBaseDir directory to copy files to
 */
export declare function copyGradleProjectRecursively(sourceBaseDir: string, targetBaseDir: string): Promise<void>;
export {};
//# sourceMappingURL=runner.d.ts.map