camstreamerlib
Version:
Helper library for CamStreamer ACAP applications.
23 lines (22 loc) • 613 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WsEventClient = void 0;
const WsClient_1 = require("./WsClient");
class WsEventClient {
wsClient;
constructor(options) {
this.wsClient = new WsClient_1.WsClient(options);
this.wsClient.on('message', (data) => {
this.onmessage?.({ data: data.toString() });
});
}
send = (data) => {
this.wsClient.send(data);
};
destroy = () => {
this.wsClient.close();
this.onmessage = null;
};
onmessage = null;
}
exports.WsEventClient = WsEventClient;