Spaces:
Runtime error
Runtime error
| import { WebSocket } from "ws"; | |
| export interface WebSocketInterface { | |
| send: (data: string | Buffer) => void; | |
| readyState: () => 0 | 1 | 2 | 3; | |
| } | |
| export default class WebSocketWrapper implements WebSocketInterface { | |
| ws: WebSocket; | |
| constructor(ws: WebSocket) { | |
| this.ws = ws; | |
| } | |
| send(data: string | Buffer) { | |
| this.ws.send(data); | |
| } | |
| readyState() { | |
| return this.ws.readyState; | |
| } | |
| } | |