import type { EntityMetadata } from '../typings.js';
import type { EventArgs, EventSubscriber, FlushEventArgs, TransactionEventArgs } from './EventSubscriber.js';
import { EventType, type TransactionEventType } from '../enums.js';
/** Manages event subscribers and dispatches entity/flush/transaction lifecycle events. */
export declare class EventManager {
  #private;
  constructor(subscribers: Iterable<EventSubscriber>);
  /** Registers an event subscriber and indexes its subscribed entities and event types. */
  registerSubscriber(subscriber: EventSubscriber): void;
  /** Returns the set of all registered event subscribers. */
  getSubscribers(): Set<EventSubscriber>;
  dispatchEvent<T extends object>(
    event: TransactionEventType,
    args: TransactionEventArgs,
    meta?: EntityMetadata<T>,
  ): unknown;
  dispatchEvent<T extends object>(
    event: EventType.onInit,
    args: Partial<EventArgs<T>>,
    meta?: EntityMetadata<T>,
  ): unknown;
  dispatchEvent<T extends object>(
    event: EventType,
    args: Partial<EventArgs<T> | FlushEventArgs>,
    meta?: EntityMetadata<T>,
  ): Promise<unknown>;
  /** Checks whether there are any listeners (hooks or subscribers) for the given event type and entity. */
  hasListeners<T>(event: EventType, meta: EntityMetadata<T>): boolean;
  /** Creates a new EventManager with the same set of subscribers. */
  clone(): EventManager;
  private getSubscribedEntities;
}
