/// <reference types="chai" />
import Suite, { SuiteOptions } from '../Suite';
import Test, { TestOptions } from '../Test';
import { Handle } from '@dojo/interfaces/core';
import Task from '@dojo/core/async/Task';
import Formatter from '../common/Formatter';
import Reporter, { ReporterOptions } from '../reporters/Reporter';
import { ObjectInterface } from '../interfaces/object';
import { TddInterface } from '../interfaces/tdd';
import { BddInterface } from '../interfaces/bdd';
import { BenchmarkInterface } from '../interfaces/benchmark';
import Promise from '@dojo/shim/Promise';
import Deferred from '../Deferred';
export declare abstract class GenericExecutor<E extends Events, C extends Config> {
    protected _assertions: {
        [name: string]: any;
    };
    protected _availableReporters: {
        [name: string]: typeof Reporter;
    };
    protected _config: C;
    protected _formatter: Formatter;
    protected _rootSuite: Suite;
    protected _hasSuiteErrors: boolean;
    protected _interfaces: {
        [name: string]: any;
    };
    protected _loader: Loader;
    protected _listeners: {
        [event: string]: Listener<any>[];
    };
    protected _reporters: Reporter[];
    protected _runTask: Task<void>;
    constructor(config: C);
    readonly abstract environment: string;
    readonly config: C;
    readonly formatter: Formatter;
    abstract loadScript(script: string | string[]): Task<void>;
    addTest(suiteOrTest: Suite | Test | SuiteOptions | TestOptions): void;
    configure(config: C | {
        [key in keyof Config]: string | string[] | true;
    }): void;
    createDeferred<T>(): Deferred<T>;
    emit(eventName: 'afterRun'): Task<any>;
    emit(eventName: 'beforeRun'): Task<any>;
    emit(eventName: 'runStart'): Task<any>;
    emit(eventName: 'runEnd'): Task<any>;
    emit<T extends keyof E>(eventName: T, data: E[T]): Task<any>;
    getAssertions(name: 'assert'): Chai.AssertStatic;
    getAssertions(name: 'expect'): Chai.ExpectStatic;
    getAssertions(name: 'should'): Chai.Should;
    getAssertions(name: string): any;
    getInterface(name: 'object'): ObjectInterface;
    getInterface(name: 'tdd'): TddInterface;
    getInterface(name: 'bdd'): BddInterface;
    getInterface(name: 'benchmark'): BenchmarkInterface;
    getInterface(name: string): any;
    log(...args: any[]): Task<any>;
    on<T extends keyof E>(eventName: T, listener: Listener<E[T]>): Handle;
    registerAssertions(name: string, assertions: any): void;
    registerInterface(name: string, iface: any): void;
    registerLoader(loader: Loader): void;
    registerReporter(name: string, Class: typeof Reporter): void;
    run(): Task<void>;
    setInterface(name: string, iface: any): void;
    protected _afterRun(): Task<void>;
    protected _beforeRun(): Task<any>;
    protected _emitCoverage(): Task<any>;
    protected _getReporter(name: string): typeof Reporter;
    protected _loadSuites(config?: Config): Task<void>;
    protected _preloadScripts(): Task<void>;
    protected _processOption(name: keyof Config, value: any): void;
    protected _resolveConfig(): Task<void>;
    protected _runTests(): Task<any>;
}
export declare function initialize<E extends Events, C extends Config, T extends GenericExecutor<E, C>>(ExecutorClass: ExecutorConstructor<E, C, T>, config?: C): T;
export declare abstract class Executor extends GenericExecutor<Events, Config> {
}
export default Executor;
export interface ExecutorConstructor<E extends Events, C extends Config, T extends GenericExecutor<E, C>> {
    new (config: C): T;
}
export { Handle };
export interface Config {
    bail?: boolean;
    baseline?: boolean;
    benchmark?: boolean;
    benchmarkConfig?: {
        id: string;
        filename: string;
        mode: 'test' | 'baseline';
        thresholds: {
            warn: {
                rme: number;
                mean: number;
            };
            fail: {
                rme: number;
                mean: number;
            };
        };
        verbosity: number;
    };
    debug?: boolean;
    defaultTimeout?: number;
    excludeInstrumentation?: true | RegExp;
    filterErrorStack?: boolean;
    grep?: RegExp;
    instrumenterOptions?: any;
    loader?: {
        script: string;
        config?: {
            [key: string]: any;
        };
    };
    name?: string;
    preload?: string[];
    reporters?: {
        reporter: string;
        options?: ReporterOptions;
    }[];
    suites?: string[];
    [key: string]: any;
}
export interface Listener<T> {
    (arg: T): void | Promise<void>;
}
export interface CoverageMessage {
    sessionId?: string;
    coverage: any;
}
export interface DeprecationMessage {
    original: string;
    replacement?: string;
    message?: string;
}
export interface ExecutorEvent {
    name: string;
    data: any;
}
export interface Events {
    '*': ExecutorEvent;
    afterRun: never;
    beforeRun: never;
    coverage: CoverageMessage;
    deprecated: DeprecationMessage;
    error: Error;
    internPath: string;
    log: string;
    runEnd: never;
    runStart: never;
    suiteEnd: Suite;
    suiteStart: Suite;
    testEnd: Test;
    testStart: Test;
}
export interface Loader {
    (config: Config): Promise<void> | void;
}
