import { type Constructor } from '@poppinss/utils/types';
import type { AllowedEventTypes, BufferedEvent, BufferedEventsList } from './types.ts';
/**
 * Callback function to narrow down an event from
 * the events buffer list
 */
type EventFinderCallback<EventsList extends Record<string | symbol | number, any>, Event extends keyof EventsList | Constructor<any>> = (event: Event extends keyof EventsList ? BufferedEvent<Event, EventsList[Event]> : Event extends Constructor<infer A> ? BufferedEvent<Event, A> : never) => boolean;
/**
 * Exposes API to filter, find events from the events buffer.
 */
export declare class EventsBuffer<EventsList extends Record<string | symbol | number, any>> {
    #private;
    constructor(restoreFn: () => void);
    /**
     * Track emitted event
     *
     * @param event - The event that was emitted
     * @param data - The data passed with the event
     */
    add<Name extends AllowedEventTypes>(event: Name, data: any): void;
    /**
     * Get all the emitted events
     *
     * @returns Array of all buffered events
     */
    all(): BufferedEventsList<EventsList>[];
    /**
     * Returns the size of captured events
     *
     * @returns The number of captured events
     */
    size(): number;
    /**
     * Find if an event was emitted
     *
     * @param event - The event to check for
     * @param finder - Optional callback to filter specific event instances
     * @returns True if the event was emitted
     */
    exists<Event extends keyof EventsList | Constructor<any>>(event: Event, finder?: EventFinderCallback<EventsList, Event>): boolean;
    /**
     * Find a specific event
     *
     * @param event - The event to find
     * @param finder - Optional callback to filter specific event instances
     * @returns The found event or null
     */
    find<Event extends keyof EventsList | Constructor<any>>(event: Event, finder?: EventFinderCallback<EventsList, Event>): (Event extends keyof EventsList ? BufferedEvent<Event, EventsList[Event]> : Event extends Constructor<infer A> ? BufferedEvent<Event, A> : never) | null;
    /**
     * Assert a given event has been emitted
     *
     * @param event - The event to assert was emitted
     * @param finder - Optional callback to filter specific event instances
     * @throws AssertionError if the event was not emitted
     */
    assertEmitted<Event extends keyof EventsList | Constructor<any>>(event: Event, finder?: EventFinderCallback<EventsList, Event>): void;
    /**
     * Assert number of times an event has been emitted
     *
     * @param event - The event to check emission count for
     * @param count - The expected number of emissions
     * @throws AssertionError if the count doesn't match
     */
    assertEmittedCount<Event extends keyof EventsList | Constructor<any>>(event: Event, count: number): void;
    /**
     * Assert a given event has been not been emitted
     *
     * @param event - The event to assert was not emitted
     * @param finder - Optional callback to filter specific event instances
     * @throws AssertionError if the event was emitted
     */
    assertNotEmitted<Event extends keyof EventsList | Constructor<any>>(event: Event, finder?: EventFinderCallback<EventsList, Event>): void;
    /**
     * Assert no events have been emitted
     *
     * @throws AssertionError if any events were emitted
     */
    assertNoneEmitted(): void;
    /**
     * Flush events collected within memory
     */
    flush(): void;
    [Symbol.dispose](): void;
}
export {};
