/// <reference types="node" />
import { ChildProcess } from 'child_process';
import { EventEmitter } from 'events';
import { Readable, Writable } from 'stream';
export declare type EventEmitterResultAssertion<T> = (result: any) => T;
declare module '../index' {
    /**
     * Create a promise for an event emitter.
     */
    function awaitable(emitter: EventEmitter, types: string | string[], errorEmitters?: EventEmitter[]): Promise<void>;
    function awaitable<T>(emitter: EventEmitter, types: string | string[], errorEmitters?: EventEmitter[]): Promise<T>;
    function awaitable<T>(emitter: EventEmitter, types: string | string[], assertion: EventEmitterResultAssertion<T>, errorEmitters?: EventEmitter[]): Promise<T>;
    /**
     * Create a promise for a `ChildProcess` object.
     * @param process The process to listen on 'exit' and 'error' events for
     *     fulfillment or rejection.
     */
    function awaitable(process: ChildProcess, errorEmitters?: EventEmitter[]): Promise<void>;
    /**
     * Create a promise for a stream.
     * @param stream The stream to listen on 'close' and 'error' events for
     *     fulfillment or rejection.
     */
    function awaitable(stream: Readable | Writable, errorEmitters?: EventEmitter[]): Promise<void>;
}
