/// <reference types="node" />
import Executor, { Events, Handle } from '../executors/Executor';
import { ErrorFormatOptions } from '../common/ErrorFormatter';
/**
 * This is a base class for reporters that provides convenienience features such as event handler registration and a
 * default console.
 */
export default class Reporter implements ReporterProperties {
    readonly executor: Executor;
    protected _console: Console;
    protected _executor: Executor;
    protected _handles: Handle[];
    protected _output: ReporterOutput;
    /**
     * A mapping from event names to the names of methods on this object. This property should be defined on the class
     * prototype. It is automatically created by the @eventHandler decorator.
     */
    protected _eventHandlers: {
        [eventName: string]: string;
    };
    constructor(executor: Executor, options?: ReporterOptions);
    console: Console;
    output: ReporterOutput;
    formatError(error: Error, options?: ErrorFormatOptions): string;
    /**
     * Register any handlers added to the class event handlers map
     */
    protected _registerEventHandlers(): void;
}
/**
 * Create a decorator that will add a decorated method to a class's list of event handlers.
 */
export declare function createEventHandler<E extends Events = Events>(): (name?: (keyof E) | undefined) => <T extends keyof E>(target: any, propertyKey: T, _descriptor: TypedPropertyDescriptor<(data: E[T]) => void>) => void;
/**
 * The default event handler decorator.
 */
export declare const eventHandler: (name?: "error" | "*" | "warning" | "afterRun" | "beforeRun" | "runStart" | "runEnd" | "log" | "coverage" | "deprecated" | "suiteAdd" | "suiteEnd" | "suiteStart" | "testAdd" | "testEnd" | "testStart" | undefined) => <T extends "error" | "*" | "warning" | "afterRun" | "beforeRun" | "runStart" | "runEnd" | "log" | "coverage" | "deprecated" | "suiteAdd" | "suiteEnd" | "suiteStart" | "testAdd" | "testEnd" | "testStart">(target: any, propertyKey: T, _descriptor: TypedPropertyDescriptor<(data: Events[T]) => void>) => void;
export interface ReporterProperties {
    output: ReporterOutput;
    console: Console;
}
export declare type ReporterOptions = Partial<ReporterProperties>;
/**
 * A stream that reporters can write to
 */
export interface ReporterOutput {
    write(chunk: string | Buffer, encoding?: string, callback?: Function): void;
    end(chunk: string | Buffer, encoding?: string, callback?: Function): void;
}
