type BaseEventMap = Record<string, Record<string, unknown> | void>;
interface VoidEvent<EventMap extends BaseEventMap, EventType extends keyof EventMap> {
    type: EventType;
    target: EventHandler<EventMap>;
}
interface Event<EventMap extends BaseEventMap, EventType extends keyof EventMap> extends VoidEvent<EventMap, EventType> {
    value: EventMap[EventType];
}
type _VoidEventListener<EventMap extends BaseEventMap, EventType extends keyof EventMap> = (e: VoidEvent<EventMap, EventType>) => void;
type _EventListener<EventMap extends BaseEventMap, EventType extends keyof EventMap> = (e: Event<EventMap, EventType>) => void;
type EventListener<EventMap extends BaseEventMap, EventType extends keyof EventMap> = _VoidEventListener<EventMap, EventType> | _EventListener<EventMap, EventType>;
declare class EventHandler<EventMap extends BaseEventMap> {
    private _listeners;
    private _onceOriginals;
    addListener<EventType extends keyof EventMap>(type: EventType, callback: EventListener<EventMap, EventType>): () => void;
    addListenerOnce<EventType extends keyof EventMap>(type: EventType, callback: EventListener<EventMap, EventType>): void;
    removeListener<EventType extends keyof EventMap>(type: EventType, callback: EventListener<EventMap, EventType>): void;
    dispatchEvent<EventType extends keyof EventMap>(type: EventType, ...args: EventMap[EventType] extends void ? [undefined?] : [EventMap[EventType]]): void;
}

export { type Event as E, type VoidEvent as V, EventHandler as a, type EventListener as b };
