import { Config as BaseConfig, Events as BaseEvents, GenericNode } from './Node';
import Tunnel, { TunnelOptions, DownloadProgressEvent } from 'digdug/Tunnel';
import { BrowserStackOptions } from 'digdug/BrowserStackTunnel';
import { SeleniumOptions } from 'digdug/SeleniumTunnel';
import Server from '../Server';
import Task from '@dojo/core/async/Task';
import Suite from '../Suite';
import Environment from '../Environment';
import Command from 'leadfoot/Command';
export default class WebDriver extends GenericNode<Events, Config> {
    static initialize(config?: Config): WebDriver;
    server: Server;
    tunnel: Tunnel;
    protected _rootSuites: Suite[];
    protected _tunnels: {
        [name: string]: typeof Tunnel;
    };
    constructor(config: Config);
    readonly environment: string;
    registerTunnel(name: string, Class: typeof Tunnel): void;
    protected _afterRun(): Task<void>;
    protected _beforeRun(): Task<any>;
    protected _createServer(): Server;
    protected _createSessionSuites(): Task<void>;
    protected _processOption(name: keyof Config, value: any): void;
    protected _loadSuites(): Task<void>;
    protected _resolveConfig(): Task<any>;
    protected _runTests(): Task<any>;
}
export interface Config extends BaseConfig {
    capabilities?: {
        name?: string;
        build?: string;
        [key: string]: any;
    };
    contactTimeout?: number;
    environments: {
        browserName: string;
        [key: string]: any;
    }[];
    environmentRetries?: number;
    leaveRemoteOpen?: boolean | 'fail';
    maxConcurrency?: number;
    serveOnly?: boolean;
    serverPort?: number;
    serverUrl?: string;
    runInSync?: boolean;
    socketPort?: number;
    tunnel?: string;
    tunnelOptions?: TunnelOptions | BrowserStackOptions | SeleniumOptions;
    suites?: string[];
}
export interface Remote extends Command<any> {
    environmentType?: Environment;
    setHeartbeatInterval(delay: number): Command<any>;
}
export interface TunnelMessage {
    tunnel: Tunnel;
    progress?: DownloadProgressEvent;
    status?: string;
}
export interface Events extends BaseEvents {
    serverEnd: Server;
    serverStart: Server;
    sessionStart: Remote;
    sessionEnd: Remote;
    tunnelDownloadProgress: TunnelMessage;
    tunnelStart: TunnelMessage;
    tunnelStatus: TunnelMessage;
    tunnelStop: TunnelMessage;
}
