UNPKG

@pubby/sdk

Version:
16 lines (15 loc) 623 B
declare const $listeners: unique symbol; interface EventListenerOptions { once?: true; } declare type EventListener = Map<Function, EventListenerOptions>; declare type EventEmitterListeners = Map<string, EventListener>; export declare class EventEmitter { [$listeners]: EventEmitterListeners; on(event: string, ...listeners: Function[]): this; once(event: string, ...listeners: Function[]): this; off(event?: string, ...listeners: Function[]): this; emit(event: string, ...args: any[]): this; stream(event: string): import("./streams").PubbyStream<unknown, unknown>; } export {};