import type { Constructor, Container } from '../../Container.js'; import type { Broadcastable } from '../Broadcastable.js'; import type { Channel } from '../Channel.js'; import type { EventDispatcher } from '../EventDispatcher.js'; /** * Test double for {@link EventDispatcher}. * * Captures dispatched events without running listeners or broadcasting. */ export declare class EventFake { private readonly dispatcher; private readonly eventsToFake; private dispatchedEvents; private broadcastEvents; private queuedListeners; constructor(dispatcher: EventDispatcher, eventsToFake: Constructor[]); /** * Swap container binding with an {@link EventFake}. */ static fake(app: Container, events?: Constructor[]): EventFake; private shouldFake; dispatch(event: object): Promise; dispatchSync(event: object): void; /** Assertions **/ assertDispatched(eventClass: Constructor, callback?: (event: object) => boolean): void; assertDispatchedTimes(eventClass: Constructor, times: number): void; assertNotDispatched(eventClass: Constructor, callback?: (event: object) => boolean): void; assertNothingDispatched(): void; assertListenerQueued(listenerClass: Constructor): void; /** * Assert a listener was queued (alias of {@link assertListenerQueued}). * * @param listenerClass - Listener constructor. */ assertListening(listenerClass: Constructor): void; assertListenerNotQueued(listenerClass: Constructor): void; assertBroadcast(eventClass: Constructor, callback?: (event: Broadcastable) => boolean): void; assertBroadcastOn(channel: string | Channel, eventClass: Constructor): void; assertNothingBroadcast(): void; /** Inspection **/ dispatched(eventClass: Constructor): object[]; hasDispatched(eventClass: Constructor): boolean; assertDispatchedWithPayload(eventClass: Constructor, payload: Partial): void; reset(): void; /** * @internal Allow tests to record a queued listener. */ _recordQueuedListener(listenerClass: Constructor): void; } //# sourceMappingURL=EventFake.d.ts.map