UNPKG

rjweb-server

Version:

Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS

13 lines (12 loc) 542 B
/// <reference types="node" /> import { WebsocketData } from "../handle"; export declare abstract class WsContext { abstract type(): 'open' | 'message' | 'close'; abstract write(type: 'text' | 'binary', data: ArrayBuffer, compressed: boolean): void; abstract close(code?: number, reason?: string): void; abstract message(): ArrayBuffer | Buffer | string; abstract messageType(): 'text' | 'binary'; abstract subscribe(id: number): void; abstract unsubscribe(id: number): void; abstract data(): WebsocketData; }