UNPKG

@sodacore/ws

Version:

Sodacore ws is a core plugin that extends the Http plugin offering WebSocket support to the Sodacore framework.

18 lines 899 B
import type WsContext from '../context/ws'; export default class WsConnections { private connections; addConnection(id: string, context: WsContext): void; removeConnection(id: string): void; getConnection(id: string): WsContext | undefined; hasConnection(id: string): boolean; getConnections(): Map<string, WsContext>; getConnectionCount(): number; clearConnections(reason?: string): void; broadcast(command: string, context?: Record<string, any>): void; broadcastRaw(data: string): void; broadcastFor(id: string | string[], command: string, context?: Record<string, any>): void; broadcastRawFor(id: string | string[], data: string): void; broadcastExcept(id: string | string[], command: string, context?: Record<string, any>): void; broadcastRawExcept(id: string | string[], data: string): void; } //# sourceMappingURL=ws-connections.d.ts.map