export declare type EventTypes = Record; export interface IEventEmitter> { /** * Register an event handler for single invocation (subscribe) * @param eventType - The event type to listen to * @param onFunction - The function to call * @param that - (optional) The context with which to call onFunction (useful also for unsubscribing only a instance) */ one(eventType: Event, onFunction: Events[Event], that?: any): ChainedType extends IEventEmitter ? this : ChainedType; /** * Register an event handler (subscribe) * @param eventType - The event type to listen to * @param onFunction - The function to call * @param that - (optional) The context with which to call onFunction (useful also for unsubscribing only a instance) */ on(eventType: Event, onFunction: Events[Event], that?: any): ChainedType extends IEventEmitter ? this : ChainedType; /** * Stop listening to events (unsubscribe) * @param eventType - (optional) The event type to unsubscribe * @param onFunction - (optional) The function to call * @param that - (optional) The context with which to call onFunction (useful also for unsubscribing only a instance) */ off(eventType?: Event | null, onFunction?: Events[Event] | null, that?: any): ChainedType extends IEventEmitter ? this : ChainedType; /** * Triggers an event * @param eventType - The event type to trigger * @param args - (optional) Arguments to pass to all listeners */ trigger(eventType: Event, ...args: Parameters): ChainedType extends IEventEmitter ? this : ChainedType; } export interface Callback { (...args: any[]): void; } declare class MicroEmitter implements IEventEmitter { private subscribers; private addSubscriber; one(eventType: Event, onFunction: Events[Event], that?: any): this; on(eventType: Event, onFunction: Events[Event], that?: any): this; off(eventType?: Event | null, onFunction?: Events[Event] | null, that?: any): this; trigger(eventType: Event, ...args: Parameters): this; } export default MicroEmitter;