/**
 * Copyright Microsoft Corporation. All rights reserved.
 *
 * 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 'events';
import { FullConfigInternal, ipc } from '../common';
import type { TestPausedParams, TestRunOptions } from './tasks';
import type * as reporterTypes from '../../types/testReporter';
import type { ConfigLocation } from '../common';
import type { AnyReporter } from '../reporters/reporterV2';
export declare const TestRunnerEvent: {
    readonly TestFilesChanged: "testFilesChanged";
    readonly TestPaused: "testPaused";
};
export type TestRunnerEventMap = {
    [TestRunnerEvent.TestFilesChanged]: [testFiles: string[]];
    [TestRunnerEvent.TestPaused]: [params: TestPausedParams];
};
export type ListTestsParams = {
    projects?: string[];
    locations?: string[];
    grep?: string;
    grepInvert?: string;
    onlyChanged?: string;
};
export type RunTestsParams = {
    timeout?: number;
    locations: string[];
    grep?: string;
    grepInvert?: string;
    testIds?: string[];
    headed?: boolean;
    workers?: number | string;
    updateSnapshots?: 'all' | 'changed' | 'missing' | 'none';
    updateSourceMethod?: 'overwrite' | 'patch' | '3way';
    reporters?: string[];
    trace?: 'on' | 'off';
    video?: 'on' | 'off';
    projects?: string[];
    reuseContext?: boolean;
    connectWsEndpoint?: string;
    actionTimeout?: number;
    pauseOnError?: boolean;
    pauseAtEnd?: boolean;
    doNotRunDepsOutsideProjectFilter?: boolean;
    disableConfigReporters?: boolean;
    failOnLoadErrors?: boolean;
};
export type FullResultStatus = reporterTypes.FullResult['status'];
export declare class TestRunner extends EventEmitter<TestRunnerEventMap> {
    readonly configLocation: ConfigLocation;
    private _configCLIOverrides;
    private _watcher;
    private _watchedProjectDirs;
    private _ignoredProjectOutputs;
    private _watchedTestDependencies;
    private _testRun;
    private _queue;
    private _globalSetup;
    private _plugins;
    private _watchTestDirs;
    private _populateDependenciesOnList;
    private _startingEnv;
    constructor(configLocation: ConfigLocation, configCLIOverrides: ipc.ConfigCLIOverrides);
    initialize(params: {
        watchTestDirs?: boolean;
        populateDependenciesOnList?: boolean;
    }): Promise<void>;
    resizeTerminal(params: {
        cols: number;
        rows: number;
    }): void;
    hasSomeBrowsers(): boolean;
    installBrowsers(): Promise<void>;
    loadConfig(): Promise<FullConfigInternal>;
    runGlobalSetup(userReporters: AnyReporter[]): Promise<{
        status: FullResultStatus;
        env: [string, string | null][];
    }>;
    runGlobalTeardown(): Promise<{
        status: any;
    }>;
    clearCache(userReporter?: AnyReporter): Promise<{
        status: FullResultStatus;
    }>;
    listFiles(userReporter: AnyReporter, projects?: string[]): Promise<{
        status: FullResultStatus;
    }>;
    listTests(userReporter: AnyReporter, params: ListTestsParams): Promise<{
        status: FullResultStatus;
    }>;
    private _innerListTests;
    private _updateWatchedDirs;
    private _updateWatcher;
    runTests(userReporter: AnyReporter, params: RunTestsParams): Promise<{
        status: FullResultStatus;
    }>;
    private _innerRunTests;
    watch(fileNames: string[]): Promise<void>;
    findRelatedTestFiles(files: string[], userReporter?: AnyReporter): Promise<{
        testFiles: string[];
        errors?: reporterTypes.TestError[];
    }>;
    stopTests(): Promise<void>;
    closeGracefully(): Promise<void>;
    stop(): Promise<void>;
    private _loadConfig;
    private _loadConfigOrReportError;
}
export declare function runAllTestsWithConfig(config: FullConfigInternal, options: TestRunOptions): Promise<FullResultStatus>;
//# sourceMappingURL=testRunner.d.ts.map