WebSocketHandler.d.ts 424 B

1234567891011121314
  1. import { WebSocket as WS } from 'ws';
  2. declare abstract class WebSocketHandler {
  3. static Event: {
  4. CONNECTION: string;
  5. MESSAGE: string;
  6. CLOSE: string;
  7. ERROR: string;
  8. };
  9. abstract onConnect: (ws: WS) => any;
  10. abstract onMessage: (message: string) => any;
  11. abstract onError: () => any;
  12. abstract onClose: (code?: number, reason?: string) => any;
  13. }
  14. export { WebSocketHandler };