UNPKG

neroxbailx

Version:

baileys whatsapp-api

1,211 lines 195 kB
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ "use strict"; var $protobuf = require("protobufjs/minimal"); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); $root.SignalLocalStorageProtocol = (function() { /** * Namespace SignalLocalStorageProtocol. * @exports SignalLocalStorageProtocol * @namespace */ var SignalLocalStorageProtocol = {}; SignalLocalStorageProtocol.SenderKeyRecordStructure = (function() { /** * Properties of a SenderKeyRecordStructure. * @memberof SignalLocalStorageProtocol * @interface ISenderKeyRecordStructure * @property {Array.<SignalLocalStorageProtocol.ISenderKeyStateStructure>|null} [senderKeyStates] SenderKeyRecordStructure senderKeyStates */ /** * Constructs a new SenderKeyRecordStructure. * @memberof SignalLocalStorageProtocol * @classdesc Represents a SenderKeyRecordStructure. * @implements ISenderKeyRecordStructure * @constructor * @param {SignalLocalStorageProtocol.ISenderKeyRecordStructure=} [properties] Properties to set */ function SenderKeyRecordStructure(properties) { this.senderKeyStates = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SenderKeyRecordStructure senderKeyStates. * @member {Array.<SignalLocalStorageProtocol.ISenderKeyStateStructure>} senderKeyStates * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @instance */ SenderKeyRecordStructure.prototype.senderKeyStates = $util.emptyArray; /** * Creates a new SenderKeyRecordStructure instance using the specified properties. * @function create * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {SignalLocalStorageProtocol.ISenderKeyRecordStructure=} [properties] Properties to set * @returns {SignalLocalStorageProtocol.SenderKeyRecordStructure} SenderKeyRecordStructure instance */ SenderKeyRecordStructure.create = function create(properties) { return new SenderKeyRecordStructure(properties); }; /** * Encodes the specified SenderKeyRecordStructure message. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyRecordStructure.verify|verify} messages. * @function encode * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {SignalLocalStorageProtocol.ISenderKeyRecordStructure} message SenderKeyRecordStructure message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderKeyRecordStructure.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.senderKeyStates != null && message.senderKeyStates.length) for (var i = 0; i < message.senderKeyStates.length; ++i) $root.SignalLocalStorageProtocol.SenderKeyStateStructure.encode(message.senderKeyStates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** * Encodes the specified SenderKeyRecordStructure message, length delimited. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyRecordStructure.verify|verify} messages. * @function encodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {SignalLocalStorageProtocol.ISenderKeyRecordStructure} message SenderKeyRecordStructure message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderKeyRecordStructure.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SenderKeyRecordStructure message from the specified reader or buffer. * @function decode * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {SignalLocalStorageProtocol.SenderKeyRecordStructure} SenderKeyRecordStructure * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderKeyRecordStructure.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalLocalStorageProtocol.SenderKeyRecordStructure(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { if (!(message.senderKeyStates && message.senderKeyStates.length)) message.senderKeyStates = []; message.senderKeyStates.push($root.SignalLocalStorageProtocol.SenderKeyStateStructure.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SenderKeyRecordStructure message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {SignalLocalStorageProtocol.SenderKeyRecordStructure} SenderKeyRecordStructure * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderKeyRecordStructure.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SenderKeyRecordStructure message. * @function verify * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SenderKeyRecordStructure.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.senderKeyStates != null && message.hasOwnProperty("senderKeyStates")) { if (!Array.isArray(message.senderKeyStates)) return "senderKeyStates: array expected"; for (var i = 0; i < message.senderKeyStates.length; ++i) { var error = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.verify(message.senderKeyStates[i]); if (error) return "senderKeyStates." + error; } } return null; }; /** * Creates a SenderKeyRecordStructure message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {Object.<string,*>} object Plain object * @returns {SignalLocalStorageProtocol.SenderKeyRecordStructure} SenderKeyRecordStructure */ SenderKeyRecordStructure.fromObject = function fromObject(object) { if (object instanceof $root.SignalLocalStorageProtocol.SenderKeyRecordStructure) return object; var message = new $root.SignalLocalStorageProtocol.SenderKeyRecordStructure(); if (object.senderKeyStates) { if (!Array.isArray(object.senderKeyStates)) throw TypeError(".SignalLocalStorageProtocol.SenderKeyRecordStructure.senderKeyStates: array expected"); message.senderKeyStates = []; for (var i = 0; i < object.senderKeyStates.length; ++i) { if (typeof object.senderKeyStates[i] !== "object") throw TypeError(".SignalLocalStorageProtocol.SenderKeyRecordStructure.senderKeyStates: object expected"); message.senderKeyStates[i] = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.fromObject(object.senderKeyStates[i]); } } return message; }; /** * Creates a plain object from a SenderKeyRecordStructure message. Also converts values to other types if specified. * @function toObject * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {SignalLocalStorageProtocol.SenderKeyRecordStructure} message SenderKeyRecordStructure * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ SenderKeyRecordStructure.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.senderKeyStates = []; if (message.senderKeyStates && message.senderKeyStates.length) { object.senderKeyStates = []; for (var j = 0; j < message.senderKeyStates.length; ++j) object.senderKeyStates[j] = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.toObject(message.senderKeyStates[j], options); } return object; }; /** * Converts this SenderKeyRecordStructure to JSON. * @function toJSON * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @instance * @returns {Object.<string,*>} JSON object */ SenderKeyRecordStructure.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for SenderKeyRecordStructure * @function getTypeUrl * @memberof SignalLocalStorageProtocol.SenderKeyRecordStructure * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ SenderKeyRecordStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/SignalLocalStorageProtocol.SenderKeyRecordStructure"; }; return SenderKeyRecordStructure; })(); SignalLocalStorageProtocol.SenderKeyStateStructure = (function() { /** * Properties of a SenderKeyStateStructure. * @memberof SignalLocalStorageProtocol * @interface ISenderKeyStateStructure * @property {number|null} [senderKeyId] SenderKeyStateStructure senderKeyId * @property {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderChainKey|null} [senderChainKey] SenderKeyStateStructure senderChainKey * @property {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderSigningKey|null} [senderSigningKey] SenderKeyStateStructure senderSigningKey * @property {Array.<SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderMessageKey>|null} [senderMessageKeys] SenderKeyStateStructure senderMessageKeys */ /** * Constructs a new SenderKeyStateStructure. * @memberof SignalLocalStorageProtocol * @classdesc Represents a SenderKeyStateStructure. * @implements ISenderKeyStateStructure * @constructor * @param {SignalLocalStorageProtocol.ISenderKeyStateStructure=} [properties] Properties to set */ function SenderKeyStateStructure(properties) { this.senderMessageKeys = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SenderKeyStateStructure senderKeyId. * @member {number|null|undefined} senderKeyId * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance */ SenderKeyStateStructure.prototype.senderKeyId = null; /** * SenderKeyStateStructure senderChainKey. * @member {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderChainKey|null|undefined} senderChainKey * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance */ SenderKeyStateStructure.prototype.senderChainKey = null; /** * SenderKeyStateStructure senderSigningKey. * @member {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderSigningKey|null|undefined} senderSigningKey * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance */ SenderKeyStateStructure.prototype.senderSigningKey = null; /** * SenderKeyStateStructure senderMessageKeys. * @member {Array.<SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderMessageKey>} senderMessageKeys * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance */ SenderKeyStateStructure.prototype.senderMessageKeys = $util.emptyArray; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * SenderKeyStateStructure _senderKeyId. * @member {"senderKeyId"|undefined} _senderKeyId * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance */ Object.defineProperty(SenderKeyStateStructure.prototype, "_senderKeyId", { get: $util.oneOfGetter($oneOfFields = ["senderKeyId"]), set: $util.oneOfSetter($oneOfFields) }); /** * SenderKeyStateStructure _senderChainKey. * @member {"senderChainKey"|undefined} _senderChainKey * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance */ Object.defineProperty(SenderKeyStateStructure.prototype, "_senderChainKey", { get: $util.oneOfGetter($oneOfFields = ["senderChainKey"]), set: $util.oneOfSetter($oneOfFields) }); /** * SenderKeyStateStructure _senderSigningKey. * @member {"senderSigningKey"|undefined} _senderSigningKey * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance */ Object.defineProperty(SenderKeyStateStructure.prototype, "_senderSigningKey", { get: $util.oneOfGetter($oneOfFields = ["senderSigningKey"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new SenderKeyStateStructure instance using the specified properties. * @function create * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {SignalLocalStorageProtocol.ISenderKeyStateStructure=} [properties] Properties to set * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure} SenderKeyStateStructure instance */ SenderKeyStateStructure.create = function create(properties) { return new SenderKeyStateStructure(properties); }; /** * Encodes the specified SenderKeyStateStructure message. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.verify|verify} messages. * @function encode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {SignalLocalStorageProtocol.ISenderKeyStateStructure} message SenderKeyStateStructure message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderKeyStateStructure.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.senderKeyId != null && Object.hasOwnProperty.call(message, "senderKeyId")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.senderKeyId); if (message.senderChainKey != null && Object.hasOwnProperty.call(message, "senderChainKey")) $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.encode(message.senderChainKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.senderSigningKey != null && Object.hasOwnProperty.call(message, "senderSigningKey")) $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.encode(message.senderSigningKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.senderMessageKeys != null && message.senderMessageKeys.length) for (var i = 0; i < message.senderMessageKeys.length; ++i) $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.encode(message.senderMessageKeys[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** * Encodes the specified SenderKeyStateStructure message, length delimited. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.verify|verify} messages. * @function encodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {SignalLocalStorageProtocol.ISenderKeyStateStructure} message SenderKeyStateStructure message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderKeyStateStructure.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SenderKeyStateStructure message from the specified reader or buffer. * @function decode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure} SenderKeyStateStructure * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderKeyStateStructure.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.senderKeyId = reader.uint32(); break; } case 2: { message.senderChainKey = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.decode(reader, reader.uint32()); break; } case 3: { message.senderSigningKey = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.decode(reader, reader.uint32()); break; } case 4: { if (!(message.senderMessageKeys && message.senderMessageKeys.length)) message.senderMessageKeys = []; message.senderMessageKeys.push($root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.decode(reader, reader.uint32())); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SenderKeyStateStructure message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure} SenderKeyStateStructure * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderKeyStateStructure.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SenderKeyStateStructure message. * @function verify * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SenderKeyStateStructure.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.senderKeyId != null && message.hasOwnProperty("senderKeyId")) { properties._senderKeyId = 1; if (!$util.isInteger(message.senderKeyId)) return "senderKeyId: integer expected"; } if (message.senderChainKey != null && message.hasOwnProperty("senderChainKey")) { properties._senderChainKey = 1; { var error = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.verify(message.senderChainKey); if (error) return "senderChainKey." + error; } } if (message.senderSigningKey != null && message.hasOwnProperty("senderSigningKey")) { properties._senderSigningKey = 1; { var error = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.verify(message.senderSigningKey); if (error) return "senderSigningKey." + error; } } if (message.senderMessageKeys != null && message.hasOwnProperty("senderMessageKeys")) { if (!Array.isArray(message.senderMessageKeys)) return "senderMessageKeys: array expected"; for (var i = 0; i < message.senderMessageKeys.length; ++i) { var error = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.verify(message.senderMessageKeys[i]); if (error) return "senderMessageKeys." + error; } } return null; }; /** * Creates a SenderKeyStateStructure message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {Object.<string,*>} object Plain object * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure} SenderKeyStateStructure */ SenderKeyStateStructure.fromObject = function fromObject(object) { if (object instanceof $root.SignalLocalStorageProtocol.SenderKeyStateStructure) return object; var message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure(); if (object.senderKeyId != null) message.senderKeyId = object.senderKeyId >>> 0; if (object.senderChainKey != null) { if (typeof object.senderChainKey !== "object") throw TypeError(".SignalLocalStorageProtocol.SenderKeyStateStructure.senderChainKey: object expected"); message.senderChainKey = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.fromObject(object.senderChainKey); } if (object.senderSigningKey != null) { if (typeof object.senderSigningKey !== "object") throw TypeError(".SignalLocalStorageProtocol.SenderKeyStateStructure.senderSigningKey: object expected"); message.senderSigningKey = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.fromObject(object.senderSigningKey); } if (object.senderMessageKeys) { if (!Array.isArray(object.senderMessageKeys)) throw TypeError(".SignalLocalStorageProtocol.SenderKeyStateStructure.senderMessageKeys: array expected"); message.senderMessageKeys = []; for (var i = 0; i < object.senderMessageKeys.length; ++i) { if (typeof object.senderMessageKeys[i] !== "object") throw TypeError(".SignalLocalStorageProtocol.SenderKeyStateStructure.senderMessageKeys: object expected"); message.senderMessageKeys[i] = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.fromObject(object.senderMessageKeys[i]); } } return message; }; /** * Creates a plain object from a SenderKeyStateStructure message. Also converts values to other types if specified. * @function toObject * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure} message SenderKeyStateStructure * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ SenderKeyStateStructure.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) object.senderMessageKeys = []; if (message.senderKeyId != null && message.hasOwnProperty("senderKeyId")) { object.senderKeyId = message.senderKeyId; if (options.oneofs) object._senderKeyId = "senderKeyId"; } if (message.senderChainKey != null && message.hasOwnProperty("senderChainKey")) { object.senderChainKey = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.toObject(message.senderChainKey, options); if (options.oneofs) object._senderChainKey = "senderChainKey"; } if (message.senderSigningKey != null && message.hasOwnProperty("senderSigningKey")) { object.senderSigningKey = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.toObject(message.senderSigningKey, options); if (options.oneofs) object._senderSigningKey = "senderSigningKey"; } if (message.senderMessageKeys && message.senderMessageKeys.length) { object.senderMessageKeys = []; for (var j = 0; j < message.senderMessageKeys.length; ++j) object.senderMessageKeys[j] = $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.toObject(message.senderMessageKeys[j], options); } return object; }; /** * Converts this SenderKeyStateStructure to JSON. * @function toJSON * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @instance * @returns {Object.<string,*>} JSON object */ SenderKeyStateStructure.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for SenderKeyStateStructure * @function getTypeUrl * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ SenderKeyStateStructure.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/SignalLocalStorageProtocol.SenderKeyStateStructure"; }; SenderKeyStateStructure.SenderChainKey = (function() { /** * Properties of a SenderChainKey. * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @interface ISenderChainKey * @property {number|null} [iteration] SenderChainKey iteration * @property {Uint8Array|null} [seed] SenderChainKey seed */ /** * Constructs a new SenderChainKey. * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @classdesc Represents a SenderChainKey. * @implements ISenderChainKey * @constructor * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderChainKey=} [properties] Properties to set */ function SenderChainKey(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SenderChainKey iteration. * @member {number|null|undefined} iteration * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @instance */ SenderChainKey.prototype.iteration = null; /** * SenderChainKey seed. * @member {Uint8Array|null|undefined} seed * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @instance */ SenderChainKey.prototype.seed = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * SenderChainKey _iteration. * @member {"iteration"|undefined} _iteration * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @instance */ Object.defineProperty(SenderChainKey.prototype, "_iteration", { get: $util.oneOfGetter($oneOfFields = ["iteration"]), set: $util.oneOfSetter($oneOfFields) }); /** * SenderChainKey _seed. * @member {"seed"|undefined} _seed * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @instance */ Object.defineProperty(SenderChainKey.prototype, "_seed", { get: $util.oneOfGetter($oneOfFields = ["seed"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new SenderChainKey instance using the specified properties. * @function create * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderChainKey=} [properties] Properties to set * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey} SenderChainKey instance */ SenderChainKey.create = function create(properties) { return new SenderChainKey(properties); }; /** * Encodes the specified SenderChainKey message. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.verify|verify} messages. * @function encode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderChainKey} message SenderChainKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderChainKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.iteration); if (message.seed != null && Object.hasOwnProperty.call(message, "seed")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.seed); return writer; }; /** * Encodes the specified SenderChainKey message, length delimited. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey.verify|verify} messages. * @function encodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderChainKey} message SenderChainKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderChainKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SenderChainKey message from the specified reader or buffer. * @function decode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey} SenderChainKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderChainKey.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.iteration = reader.uint32(); break; } case 2: { message.seed = reader.bytes(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SenderChainKey message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey} SenderChainKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderChainKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SenderChainKey message. * @function verify * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SenderChainKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.iteration != null && message.hasOwnProperty("iteration")) { properties._iteration = 1; if (!$util.isInteger(message.iteration)) return "iteration: integer expected"; } if (message.seed != null && message.hasOwnProperty("seed")) { properties._seed = 1; if (!(message.seed && typeof message.seed.length === "number" || $util.isString(message.seed))) return "seed: buffer expected"; } return null; }; /** * Creates a SenderChainKey message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {Object.<string,*>} object Plain object * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey} SenderChainKey */ SenderChainKey.fromObject = function fromObject(object) { if (object instanceof $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey) return object; var message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey(); if (object.iteration != null) message.iteration = object.iteration >>> 0; if (object.seed != null) if (typeof object.seed === "string") $util.base64.decode(object.seed, message.seed = $util.newBuffer($util.base64.length(object.seed)), 0); else if (object.seed.length >= 0) message.seed = object.seed; return message; }; /** * Creates a plain object from a SenderChainKey message. Also converts values to other types if specified. * @function toObject * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey} message SenderChainKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ SenderChainKey.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.iteration != null && message.hasOwnProperty("iteration")) { object.iteration = message.iteration; if (options.oneofs) object._iteration = "iteration"; } if (message.seed != null && message.hasOwnProperty("seed")) { object.seed = options.bytes === String ? $util.base64.encode(message.seed, 0, message.seed.length) : options.bytes === Array ? Array.prototype.slice.call(message.seed) : message.seed; if (options.oneofs) object._seed = "seed"; } return object; }; /** * Converts this SenderChainKey to JSON. * @function toJSON * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @instance * @returns {Object.<string,*>} JSON object */ SenderChainKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for SenderChainKey * @function getTypeUrl * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ SenderChainKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/SignalLocalStorageProtocol.SenderKeyStateStructure.SenderChainKey"; }; return SenderChainKey; })(); SenderKeyStateStructure.SenderMessageKey = (function() { /** * Properties of a SenderMessageKey. * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @interface ISenderMessageKey * @property {number|null} [iteration] SenderMessageKey iteration * @property {Uint8Array|null} [seed] SenderMessageKey seed */ /** * Constructs a new SenderMessageKey. * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @classdesc Represents a SenderMessageKey. * @implements ISenderMessageKey * @constructor * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderMessageKey=} [properties] Properties to set */ function SenderMessageKey(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SenderMessageKey iteration. * @member {number|null|undefined} iteration * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @instance */ SenderMessageKey.prototype.iteration = null; /** * SenderMessageKey seed. * @member {Uint8Array|null|undefined} seed * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @instance */ SenderMessageKey.prototype.seed = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * SenderMessageKey _iteration. * @member {"iteration"|undefined} _iteration * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @instance */ Object.defineProperty(SenderMessageKey.prototype, "_iteration", { get: $util.oneOfGetter($oneOfFields = ["iteration"]), set: $util.oneOfSetter($oneOfFields) }); /** * SenderMessageKey _seed. * @member {"seed"|undefined} _seed * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @instance */ Object.defineProperty(SenderMessageKey.prototype, "_seed", { get: $util.oneOfGetter($oneOfFields = ["seed"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new SenderMessageKey instance using the specified properties. * @function create * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderMessageKey=} [properties] Properties to set * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey instance */ SenderMessageKey.create = function create(properties) { return new SenderMessageKey(properties); }; /** * Encodes the specified SenderMessageKey message. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.verify|verify} messages. * @function encode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderMessageKey} message SenderMessageKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderMessageKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.iteration != null && Object.hasOwnProperty.call(message, "iteration")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.iteration); if (message.seed != null && Object.hasOwnProperty.call(message, "seed")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.seed); return writer; }; /** * Encodes the specified SenderMessageKey message, length delimited. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey.verify|verify} messages. * @function encodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderMessageKey} message SenderMessageKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderMessageKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SenderMessageKey message from the specified reader or buffer. * @function decode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderMessageKey.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.iteration = reader.uint32(); break; } case 2: { message.seed = reader.bytes(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SenderMessageKey message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderMessageKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SenderMessageKey message. * @function verify * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SenderMessageKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message.iteration != null && message.hasOwnProperty("iteration")) { properties._iteration = 1; if (!$util.isInteger(message.iteration)) return "iteration: integer expected"; } if (message.seed != null && message.hasOwnProperty("seed")) { properties._seed = 1; if (!(message.seed && typeof message.seed.length === "number" || $util.isString(message.seed))) return "seed: buffer expected"; } return null; }; /** * Creates a SenderMessageKey message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {Object.<string,*>} object Plain object * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey} SenderMessageKey */ SenderMessageKey.fromObject = function fromObject(object) { if (object instanceof $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey) return object; var message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey(); if (object.iteration != null) message.iteration = object.iteration >>> 0; if (object.seed != null) if (typeof object.seed === "string") $util.base64.decode(object.seed, message.seed = $util.newBuffer($util.base64.length(object.seed)), 0); else if (object.seed.length >= 0) message.seed = object.seed; return message; }; /** * Creates a plain object from a SenderMessageKey message. Also converts values to other types if specified. * @function toObject * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey} message SenderMessageKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ SenderMessageKey.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (message.iteration != null && message.hasOwnProperty("iteration")) { object.iteration = message.iteration; if (options.oneofs) object._iteration = "iteration"; } if (message.seed != null && message.hasOwnProperty("seed")) { object.seed = options.bytes === String ? $util.base64.encode(message.seed, 0, message.seed.length) : options.bytes === Array ? Array.prototype.slice.call(message.seed) : message.seed; if (options.oneofs) object._seed = "seed"; } return object; }; /** * Converts this SenderMessageKey to JSON. * @function toJSON * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @instance * @returns {Object.<string,*>} JSON object */ SenderMessageKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for SenderMessageKey * @function getTypeUrl * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ SenderMessageKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/SignalLocalStorageProtocol.SenderKeyStateStructure.SenderMessageKey"; }; return SenderMessageKey; })(); SenderKeyStateStructure.SenderSigningKey = (function() { /** * Properties of a SenderSigningKey. * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @interface ISenderSigningKey * @property {Uint8Array|null} ["public"] SenderSigningKey public * @property {Uint8Array|null} ["private"] SenderSigningKey private */ /** * Constructs a new SenderSigningKey. * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure * @classdesc Represents a SenderSigningKey. * @implements ISenderSigningKey * @constructor * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderSigningKey=} [properties] Properties to set */ function SenderSigningKey(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * SenderSigningKey public. * @member {Uint8Array|null|undefined} public * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @instance */ SenderSigningKey.prototype["public"] = null; /** * SenderSigningKey private. * @member {Uint8Array|null|undefined} private * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @instance */ SenderSigningKey.prototype["private"] = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * SenderSigningKey _public. * @member {"public"|undefined} _public * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @instance */ Object.defineProperty(SenderSigningKey.prototype, "_public", { get: $util.oneOfGetter($oneOfFields = ["public"]), set: $util.oneOfSetter($oneOfFields) }); /** * SenderSigningKey _private. * @member {"private"|undefined} _private * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @instance */ Object.defineProperty(SenderSigningKey.prototype, "_private", { get: $util.oneOfGetter($oneOfFields = ["private"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new SenderSigningKey instance using the specified properties. * @function create * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderSigningKey=} [properties] Properties to set * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey} SenderSigningKey instance */ SenderSigningKey.create = function create(properties) { return new SenderSigningKey(properties); }; /** * Encodes the specified SenderSigningKey message. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.verify|verify} messages. * @function encode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderSigningKey} message SenderSigningKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderSigningKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message["public"] != null && Object.hasOwnProperty.call(message, "public")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message["public"]); if (message["private"] != null && Object.hasOwnProperty.call(message, "private")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message["private"]); return writer; }; /** * Encodes the specified SenderSigningKey message, length delimited. Does not implicitly {@link SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey.verify|verify} messages. * @function encodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @static * @param {SignalLocalStorageProtocol.SenderKeyStateStructure.ISenderSigningKey} message SenderSigningKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ SenderSigningKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a SenderSigningKey message from the specified reader or buffer. * @function decode * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey} SenderSigningKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderSigningKey.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message["public"] = reader.bytes(); break; } case 2: { message["private"] = reader.bytes(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a SenderSigningKey message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey} SenderSigningKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SenderSigningKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a SenderSigningKey message. * @function verify * @memberof SignalLocalStorageProtocol.SenderKeyStateStructure.SenderSigningKey * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ SenderSigningKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; if (message["public"] != null && message.hasOwnProperty("public")) { properties._public = 1; if (!(message["public"] && typeof message["public"].length === "number" || $util.isStri