/**
 * 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 { ManualPromise } from '@isomorphic/manualPromise';
import { Dispatcher } from './dispatcher';
import { config as commonConfig, FullConfigInternal, test as testNs } from '../common';
import type { TestGroup } from '../runner/testGroups';
import type { Task } from './taskRunner';
import type { ReporterDescription } from '../../types/test';
import type { FullResult, TestError } from '../../types/testReporter';
import type { Matcher, TestCaseFilter } from '../util';
import type { InternalReporter } from '../reporters/internalReporter';
type ProjectWithTestGroups = {
    project: commonConfig.FullProjectInternal;
    projectSuite: testNs.Suite;
    testGroups: TestGroup[];
};
type Phase = {
    dispatcher: Dispatcher;
    projects: ProjectWithTestGroups[];
};
export type TestRunOptions = {
    locations?: string[];
    grep?: string;
    grepInvert?: string;
    onlyChanged?: string;
    projectFilter?: string[];
    listMode?: boolean;
    passWithNoTests?: boolean;
    lastFailed?: boolean;
    testList?: string;
    testListInvert?: string;
    lastFailedTestIds?: string[];
    pauseOnError?: boolean;
    pauseAtEnd?: boolean;
    onTestPaused?: (params: TestPausedParams) => void;
    preserveOutputDir?: boolean;
    additionalReporters?: ReporterDescription[];
    shardWeights?: number[];
};
export type TestPausedParams = {
    errors: TestError[];
    sendMessage: (params: {
        request: any;
    }) => Promise<{
        response: any;
        error?: TestError;
    }>;
};
export declare class TestRun {
    readonly config: FullConfigInternal;
    readonly options: TestRunOptions;
    readonly reporter: InternalReporter;
    rootSuite: testNs.Suite | undefined;
    readonly phases: Phase[];
    readonly filteredProjects: commonConfig.FullProjectInternal[];
    projectFiles: Map<commonConfig.FullProjectInternal, string[]>;
    projectSuites: Map<commonConfig.FullProjectInternal, testNs.Suite[]>;
    topLevelProjects: commonConfig.FullProjectInternal[];
    hasWorkerErrors: boolean;
    failedTestCount: number;
    readonly loadFileFilters: Matcher[];
    readonly preOnlyTestFilters: TestCaseFilter[];
    readonly postShardTestFilters: TestCaseFilter[];
    constructor(config: FullConfigInternal, reporter: InternalReporter, options?: TestRunOptions);
    onTestPaused(params: TestPausedParams): void;
    hasReachedMaxFailures(): boolean;
    result(): 'failed' | 'passed';
}
export declare function runTasks(testRun: TestRun, tasks: Task<TestRun>[], globalTimeout?: number, cancelPromise?: ManualPromise<void>): Promise<"failed" | "passed" | "interrupted" | "timedout">;
export declare function runTasksDeferCleanup(testRun: TestRun, tasks: Task<TestRun>[]): Promise<{
    status: "failed" | "passed" | "interrupted" | "timedout";
    cleanup: () => Promise<FullResult["status"]>;
}>;
export declare function createGlobalSetupTasks(config: FullConfigInternal): Task<TestRun>[];
export declare function createRunTestsTasks(config: FullConfigInternal): Task<TestRun>[];
export declare function createClearCacheTask(config: FullConfigInternal): Task<TestRun>;
export declare function createReportBeginTask(): Task<TestRun>;
export declare function createPluginSetupTasks(config: FullConfigInternal): Task<TestRun>[];
export declare function createListFilesTask(): Task<TestRun>;
export declare function createLoadTask(mode: 'out-of-process' | 'in-process', options: {
    filterOnly: boolean;
    failOnLoadErrors: boolean;
    doNotRunDepsOutsideProjectFilter?: boolean;
    populateDependencies?: boolean;
}): Task<TestRun>;
export declare function createApplyRebaselinesTask(): Task<TestRun>;
export {};
//# sourceMappingURL=tasks.d.ts.map