type UnkObj = {
    [key: string]: unknown;
};
export type Listener<T> = (value: T) => void;
export interface Emitter<T extends object = UnkObj> {
    emit<K extends keyof T>(type: K, data: T[K]): void;
}
export interface Receiver<T extends object = UnkObj> {
    on<K extends keyof T>(type: K, listener: Listener<T[K]>): void;
    off<K extends keyof T>(type: K, listener: Listener<T[K]>): void;
}
export declare class EventEmitter<T extends object = UnkObj> implements Emitter<T>, Receiver<T> {
    protected _listeners: Map<keyof T, Listener<any>[]>;
    on<K extends keyof T>(type: K, listener: Listener<T[K]>): void;
    off<K extends keyof T>(type: K, listener: Listener<T[K]>): void;
    emit<K extends keyof T>(type: K, value: T[K]): void;
}
export declare class SafeEventEmitter<T extends object = UnkObj> extends EventEmitter<T> {
    private onError;
    constructor(options?: {
        onError?: (error: unknown) => void;
    });
    emit<K extends keyof T>(type: K, value: T[K]): void;
    private safeExec;
}
export {};
