@palmares/events
Version:
This is the events framework for palmares, it's responsible for handling everything that is Pub/Sub like websockets, pub/sub like redis, and other types of asynchronous background tasks
12 lines • 623 B
TypeScript
/**
* This interface is supposed to be overriden by the library that we want to use the event emitter of.
*
* It could be an implementation using node.js, or by using the default browser behaviour and so on.
*/
export declare class Emitter {
static new(...args: any[]): Promise<Emitter>;
addEventListener(groupId: string, eventName: string, callback: (...args: any) => any): Promise<void>;
removeEventListener(groupId: string, eventName: string, callback: (...args: any) => any): Promise<void>;
emit(groupId: string, eventName: string, ...data: any): Promise<void>;
}
//# sourceMappingURL=index.d.ts.map