export type EventMap = Record<string, unknown>;
export type EventListener<TPayload> = (payload: TPayload) => void | Promise<void>;
export interface IEventDispatcher<TEvents extends EventMap = EventMap> {
    on<K extends keyof TEvents & string>(event: K, listener: EventListener<TEvents[K]>): () => void;
    once<K extends keyof TEvents & string>(event: K, listener: EventListener<TEvents[K]>): () => void;
    off<K extends keyof TEvents & string>(event: K, listener: EventListener<TEvents[K]>): void;
    emit<K extends keyof TEvents & string>(event: K, payload: TEvents[K]): void;
    emitAsync<K extends keyof TEvents & string>(event: K, payload: TEvents[K]): Promise<void>;
    listenerCount<K extends keyof TEvents & string>(event: K): number;
    clear<K extends keyof TEvents & string>(event?: K): void;
}
export declare const EventDispatcher: Readonly<{
    create<TEvents extends EventMap = EventMap>(): IEventDispatcher<TEvents>;
}>;
export default EventDispatcher;
//# sourceMappingURL=EventDispatcher.d.ts.map