diffusion
Version:
Diffusion JavaScript client
57 lines (56 loc) • 2.85 kB
JavaScript
;
/**
* @module Services.GatewayControl
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GatewayClientConnectedClientDetailsSerialiser = exports.GatewayClientConnectedClientDetailsSerialiserClass = void 0;
var gateway_control_1 = require("./../../features/gateway-control");
var Codec = require("./../../io/codec");
var BEES = require("./../../serialisers/byte-encoded-enum-serialiser");
var serialiser_1 = require("./../../serialisers/serialiser");
/**
* Serialiser for {@link GatewayConnectedClientDetails}
*/
var GatewayClientConnectedClientDetailsSerialiserClass = /** @class */ (function (_super) {
__extends(GatewayClientConnectedClientDetailsSerialiserClass, _super);
function GatewayClientConnectedClientDetailsSerialiserClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Read a {@link GatewayConnectedClientDetails} from the stream
*
* @param bis the input stream
* @return the {@link GatewayConnectedClientDetails} that was read
*/
GatewayClientConnectedClientDetailsSerialiserClass.prototype.read = function (bis) {
var activeSessionId = Codec.readByte(bis) ? Codec.readString(bis) : undefined;
var passiveSessionIds = Codec.readCollection(bis, Codec.readString);
var configurationMode = Codec.readByte(bis) ? BEES.read(bis, gateway_control_1.ConfigurationMode) : undefined;
return {
activeSessionId: activeSessionId,
passiveSessionIds: passiveSessionIds,
configurationMode: configurationMode
};
};
return GatewayClientConnectedClientDetailsSerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.GatewayClientConnectedClientDetailsSerialiserClass = GatewayClientConnectedClientDetailsSerialiserClass;
/**
* The {@link GatewayClientConnectedClientDetailsSerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.GatewayClientConnectedClientDetailsSerialiser = new GatewayClientConnectedClientDetailsSerialiserClass();