UNPKG

radius-read

Version:

Realtime Dashboard

62 lines (61 loc) 1.79 kB
/** * Service for managing Socket.IO connections and WebSocket communication. */ export declare class SocketIoService { /** * Initializes a Socket.IO server instance and manages WebSocket connections. * @date Jun 26, 2025 04:04:21 PM * @author Biswaranjan Nayak * * @private * @static * @type {Server} */ private static _io; /** * WebSocket connections indexed by userId and tenantCode. * @date Jun 26, 2025 04:05:15 PM * @author Biswaranjan Nayak * * @private * @static * @type {({ [key: string]: WebSocket | undefined })} */ private static _wsConnections; /** * Creates an instance of SocketIoService. */ constructor(); /** * Initializes the Socket.IO server with the provided WebSocket URL and application instance. * @param wsURL * @param app * @param callback */ static init(wsURL: string, app: any, callback: any): void; /** * Deinitializes the Socket.IO server and closes all WebSocket connections. */ static deinit(): void; /** * Sends a message to a specific user and tenant using Socket.IO. * @param userId * @param tenantCode * @param message */ static sendIoMessage(userId: any, tenantCode: any, message: any): void; /** * Sends a WebSocket message to a specific user and tenant. * @param userId * @param tenantCode * @param message */ static sendWsMessage(userId: any, tenantCode: any, message: any): void; /** * Verifies if a WebSocket connection exists for the given userId and tenantCode. * @param userId * @param tenantCode * @returns */ static isConnectionExists(userId: any, tenantCode: any): boolean; }