import { Disposable } from "./util"; export interface Event { (listener: (value: T) => void): Disposable; (id: number | string, listener: (value: T) => void): Disposable; } /** * Emitter typecasts for a single event type. You can optionally use IDs, but * using undefined with IDs will not work. If you emit without an ID, *all* * listeners regardless of their ID (or lack thereof) will receive the event. * Similarly, if you listen without an ID you will get *all* events for any or * no ID. */ export declare class Emitter { private listeners; private readonly idListeners; readonly event: Event; /** * Emit an event with a value. */ emit(value: T): void; emit(id: number | string, value: T): void; /** * Dispose the current events. */ dispose(): void; dispose(id: number | string): void; readonly counts: { [key: string]: number; }; }