declare type ArgumentsOf<T> = [T] extends [(...args: infer U) => any] ? U : [T] extends [void] ? [] : [T];
interface BaseEvents {
    [E: string]: (...args: any[]) => any;
}
export interface AsyncEventEmitterI<Events extends BaseEvents> {
    addListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    on<E extends keyof Events>(event: E, listener: Events[E]): this;
    once<E extends keyof Events>(event: E, listener: Events[E]): this;
    prependListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    prependOnceListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    removeAllListeners<E extends keyof Events>(event: E): this;
    removeListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    listeners<E extends keyof Events>(event?: E): Function[];
    emit<E extends keyof Events>(event: E, ...args: ArgumentsOf<Events[E]>): boolean;
    emitAndGetReturnValue<E extends keyof Events>(event: E, ...args: ArgumentsOf<Events[E]>): Promise<ReturnType<Events[E]>>;
    emitAndGetAllReturnValues<E extends keyof Events>(event: E, ...args: ArgumentsOf<Events[E]>): Promise<ReturnType<Events[E]>[]>;
    eventNames(): (keyof Events)[];
}
export declare class AsyncEventEmitter<Events extends BaseEvents> implements AsyncEventEmitterI<Events> {
    private listenerMap;
    constructor();
    private OnceListenerWrapper;
    addListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    prependListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    /**
     * @alias addListener
     */
    on<E extends keyof Events>(event: E, listener: Events[E]): this;
    once<E extends keyof Events>(event: E, listener: Events[E]): this;
    prependOnceListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    removeListener<E extends keyof Events>(event: E, listener: Events[E]): this;
    removeAllListeners<E extends keyof Events>(event: E): this;
    listeners<E extends keyof Events>(event?: E): Function[];
    emit<E extends keyof Events>(event: E, ...args: ArgumentsOf<Events[E]>): boolean;
    emitAndGetReturnValue<E extends keyof Events>(event: E, ...args: ArgumentsOf<Events[E]>): Promise<any>;
    emitAndGetAllReturnValues<E extends keyof Events>(event: E, ...args: ArgumentsOf<Events[E]>): Promise<any[]>;
    eventNames(): (keyof Events)[];
}
export default AsyncEventEmitter;
