import { EventEmitter } from "events"; import { CommunicationEvents, ICommunicationInterface } from "../dispatcher/nopeDispatcher"; /** * Event Layer. */ export class EventLayer implements ICommunicationInterface { protected _emitter = new EventEmitter(); on(event: CommunicationEvents, cb: (...args: any[]) => void) { this._emitter.on(event, cb); } send(data: any): void { this._emitter.emit('event', data) } }