/**
 * Copyright (c) Microsoft Corporation.
 *
 * 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 type { ReporterV2 } from './reporterV2';
import type { FullConfig, FullResult, Location, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';
import type { Colors } from '@isomorphic/colors';
export type TestResultOutput = {
    chunk: string | Buffer;
    type: 'stdout' | 'stderr';
};
export declare const kOutputSymbol: unique symbol;
type ErrorDetails = {
    message: string;
    location?: Location;
};
type TestSummary = {
    didNotRun: number;
    skipped: number;
    expected: number;
    interrupted: TestCase[];
    unexpected: TestCase[];
    flaky: TestCase[];
    failuresToPrint: TestCase[];
    fatalErrors: TestError[];
};
export type CommonReporterOptions = {
    configDir: string;
    _mode?: 'list' | 'test' | 'merge';
    _commandHash?: string;
};
export type Screen = {
    resolveFiles: 'cwd' | 'rootDir';
    colors: Colors;
    isTTY: boolean;
    ttyWidth: number;
    ttyHeight: number;
    stdout?: NodeJS.WriteStream;
    stderr?: NodeJS.WriteStream;
};
export type TerminalScreen = Screen & {
    stdout: NodeJS.WriteStream;
    stderr: NodeJS.WriteStream;
};
export declare const terminalScreen: TerminalScreen;
export declare const nonTerminalScreen: Screen;
export declare const internalScreen: Screen;
export type TerminalReporterOptions = {
    screen?: TerminalScreen;
    omitFailures?: boolean;
    includeTestId?: boolean;
};
export declare class TerminalReporter implements ReporterV2 {
    screen: TerminalScreen;
    config: FullConfig;
    suite: Suite;
    totalTestCount: number;
    result: FullResult;
    private fileDurations;
    private _options;
    private _fatalErrors;
    private _failureCount;
    constructor(options?: TerminalReporterOptions);
    version(): 'v2';
    onConfigure(config: FullConfig): void;
    onBegin(suite: Suite): void;
    onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult): void;
    onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult): void;
    private _appendOutput;
    onTestEnd(test: TestCase, result: TestResult): void;
    onError(error: TestError): void;
    onEnd(result: FullResult): Promise<void>;
    protected fitToScreen(line: string, prefix?: string): string;
    protected generateStartingMessage(): string;
    protected getSlowTests(): [string, number][];
    protected generateSummaryMessage({ didNotRun, skipped, expected, interrupted, unexpected, flaky, fatalErrors }: TestSummary): string;
    protected generateSummary(): TestSummary;
    epilogue(full: boolean): void;
    private _printFailures;
    private _printSlowTests;
    private _printSummary;
    willRetry(test: TestCase): boolean;
    formatTestTitle(test: TestCase, step?: TestStep): string;
    formatTestHeader(test: TestCase, options?: {
        indent?: string;
        index?: number;
        mode?: 'default' | 'error';
    }): string;
    formatFailure(test: TestCase, index?: number): string;
    formatError(error: TestError): ErrorDetails;
    formatResultErrors(test: TestCase, result: TestResult): string;
    writeLine(line?: string): void;
}
export declare function formatFailure(screen: Screen, config: FullConfig, test: TestCase, index?: number, options?: TerminalReporterOptions): string;
export declare function formatRetry(screen: Screen, result: TestResult): any[];
export declare function markErrorsAsReported(result: TestResult): void;
export declare function formatResultFailure(screen: Screen, test: TestCase, result: TestResult, initialIndent: string): ErrorDetails[];
export declare function relativeFilePath(screen: Screen, config: FullConfig, file: string): string;
export declare function stepSuffix(step: TestStep | undefined): string;
export declare function formatError(screen: Screen, error: TestError): ErrorDetails;
export declare function separator(screen: Screen, text?: string): string;
export declare function prepareErrorStack(stack: string): {
    message: string;
    stackLines: string[];
    location?: Location;
};
export declare function resolveOutputFile(reporterName: string, options: {
    configDir: string;
    outputDir?: string;
    fileName?: string;
    outputFile?: string;
    default?: {
        fileName: string;
        outputDir: string;
    };
}): {
    outputFile: string;
    outputDir?: string;
} | undefined;
export {};
//# sourceMappingURL=base.d.ts.map