"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RemoteClient = void 0;
const RemotePort_1 = require("./RemotePort");
class RemoteClient {
    constructor(system, port) {
        this._port = port;
        const _port = {
            send: (data) => {
                this._port.send(data);
            },
            onmessage(event) { },
            onerror(event) { },
        };
        this._port.onmessage = (data) => {
            _port.onmessage(data);
        };
        this._remote_port = new RemotePort_1.RemotePort(system, _port);
    }
    port() {
        return this._remote_port;
    }
    invalidate() {
        this._remote_port.close();
    }
}
exports.RemoteClient = RemoteClient;
//# sourceMappingURL=RemoteClient.js.map