declare namespace Jymfony.Component.EventDispatcher { import Event = Jymfony.Contracts.EventDispatcher.Event; import EventDispatcherInterface = Jymfony.Contracts.EventDispatcher.EventDispatcherInterface; import EventSubscriberInterface = Jymfony.Contracts.EventDispatcher.EventSubscriberInterface; interface ListenerDescriptor { listener: Invokable|[object|string, string|symbol]; priority: number; } export class EventDispatcher extends implementationOf(EventDispatcherInterface) { /** * Listeners map. */ private _listeners: Record; /** * Listeners map sorted by priority. */ private _sorted: Record; /** * Constructor. */ __construct(): void; /** * @inheritdoc */ dispatch(event: T, eventName?: string|Newable): Promise; /** * @inheritdoc */ getListeners(eventName?: string|Newable): IterableIterator; /** * @inheritdoc */ addListener(eventName: string|Newable, listener: Invokable|[object|string, string|symbol], priority?: number): void; /** * @inheritdoc */ hasListeners(eventName: string|Newable): boolean; /** * @inheritdoc */ removeListener(eventName: string|Newable, listener: Invokable|[object|string, string|symbol]): void; /** * @inheritdoc */ addSubscriber(subscriber: EventSubscriberInterface): void; /** * @inheritdoc */ removeSubscriber(subscriber: EventSubscriberInterface): void; /** * @inheritdoc */ getListenerPriority(eventName: string|Newable, listener: Invokable|[object|string, string|symbol]): undefined|number; /** * Sorts the array of listeners based on priority. */ private _sortListeners(eventName: string): void; private static _funcEquals(func1: Invokable, func2: Invokable): void; } }