1234567891011121314151617 |
- import { WebSocket as WS } from 'ws';
- abstract class WebSocketHandler {
- public static Event = {
- CONNECTION: 'connection',
- MESSAGE: 'message',
- CLOSE: 'close',
- ERROR: 'error'
- };
- public abstract onConnect: (ws: WS) => any;
- public abstract onMessage: (message: string) => any;
- public abstract onError: () => any;
- public abstract onClose: (code?: number, reason?: string) => any;
- }
- export { WebSocketHandler };
|