/*! * xev * Copyright (c) 2017 syuilo * MIT Licensed */ /// import { EventEmitter } from 'node:events'; /** * Global Event Emitter */ export default class Xev extends EventEmitter { /** * Namespace */ namespace: string | undefined; /** * Whether is mounted */ private isMounted; /** * Init event emitter * @param namespace Namespace */ constructor(namespace?: string); /** * Dispose this event emitter */ dispose(): void; private onMessage; /** * Mount event system. * This method must be called in the master process. */ mount(): void; private onClusterMessageInMaster; private onProcessMessageInMaster; /** * Broadcast the message to all workers * @param message Message you want to broadcast */ private broadcast; /** * Publish event * @param type The name of the event * @param data The payload of the event * @return Always true */ emit(type: string, data?: any): boolean; }