UNPKG

modular-json-rpc

Version:

Modular JSON-RPC 2.0 library that allows easy addition of transports

13 lines (12 loc) 400 B
/// <reference types="ws" /> import { Transport, TransportCb } from './Transport'; import * as WebSocket from 'ws'; declare class WSTransport implements Transport { ws: WebSocket; private downstreamCb; constructor(ws: WebSocket); onReceive(message: string): void; SendUpstream(data: string): void; SetDownstreamCb(cb: TransportCb): void; } export { WSTransport };