1export declare type EventType = string | symbol; 2export declare type Handler<T = any> = (event?: T) => void; 3export declare type WildcardHandler = (type: EventType, event?: any) => void; 4export declare type EventHandlerList = Array<Handler>; 5export declare type WildCardEventHandlerList = Array<WildcardHandler>; 6export declare type EventHandlerMap = Map<EventType, EventHandlerList | WildCardEventHandlerList>; 7export interface Emitter { 8 all: EventHandlerMap; 9 on<T = any>(type: EventType, handler: Handler<T>): void; 10 on(type: '*', handler: WildcardHandler): void; 11 off<T = any>(type: EventType, handler: Handler<T>): void; 12 off(type: '*', handler: WildcardHandler): void; 13 emit<T = any>(type: EventType, event?: T): void; 14 emit(type: '*', event?: any): void; 15} 16/** 17 * Mitt: Tiny (~200b) functional event emitter / pubsub. 18 * @name mitt 19 * @returns {Mitt} 20 */ 21export default function mitt(all?: EventHandlerMap): Emitter; 22