How to use the protobufjs/minimal.roots function in protobufjs

To help you get started, we’ve selected a few protobufjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tarnadas / net64plus / proto / ClientServerMessage.js View on Github external
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
"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.ClientServerMessage = (function() {

    /**
     * Properties of a ClientServerMessage.
     * @exports IClientServerMessage
     * @interface IClientServerMessage
     * @property {Compression|null} [compression] ClientServerMessage compression
     * @property {number|null} [uncompressedSize] ClientServerMessage uncompressedSize
     * @property {Uint8Array|null} [compressedData] ClientServerMessage compressedData
     * @property {IClientServer|null} [data] ClientServerMessage data
     */

    /**
     * Constructs a new ClientServerMessage.
     * @exports ClientServerMessage
github jnordberg / wsrpc / examples / painter / contents / protocol.js View on Github external
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
"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.Painter = (function() {

    /**
     * Constructs a new Painter service.
     * @exports Painter
     * @classdesc Represents a Painter
     * @extends $protobuf.rpc.Service
     * @constructor
     * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
     * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
     * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
     */
    function Painter(rpcImpl, requestDelimited, responseDelimited) {
        $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
    }
github citizenfx / fivem / ext / cfx-ui / src / app / servers / master.js View on Github external
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
"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.master = (function() {

    /**
     * Namespace master.
     * @exports master
     * @namespace
     */
    var master = {};

    master.Player = (function() {

        /**
         * Properties of a Player.
         * @memberof master
         * @interface IPlayer
github coast-team / sigver / src / proto / index.js View on Github external
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import * as $protobuf from "protobufjs/minimal";

// Common aliases
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

export const Message = $root.Message = (() => {

    /**
     * Properties of a Message.
     * @exports IMessage
     * @interface IMessage
     * @property {boolean|null} [heartbeat] Message heartbeat
     * @property {IContent|null} [content] Message content
     * @property {IGroupData|null} [connect] Message connect
     * @property {boolean|null} [connected] Message connected
     */

    /**
     * Constructs a new Message.
     * @exports Message
github zhengweikeng / blog / posts / 2017 / protobuf / protos / person_pb2.js View on Github external
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
"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.Address = (function() {

    /**
     * Properties of an Address.
     * @exports IAddress
     * @interface IAddress
     * @property {string} [addr] Address addr
     * @property {number} [code] Address code
     */

    /**
     * Constructs a new Address.
     * @exports Address
     * @classdesc Represents an Address.
     * @constructor
github AsynkronIT / protoactor-js / src / actor_pb.js View on Github external
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
"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.actor = (function() {

    /**
     * Namespace actor.
     * @exports actor
     * @namespace
     */
    var actor = {};

    actor.PID = (function() {

        /**
         * Properties of a PID.
         * @typedef actor.PID$Properties
         * @type {Object}
github moleculerjs / moleculer / src / serializers / proto / packets.proto.js View on Github external
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
"use strict";

let $protobuf = require("protobufjs/minimal");

// Common aliases
let $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
let $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

/* istanbul ignore next */
$root.packets = (function() {

	/**
     * Namespace packets.
     * @exports packets
     * @namespace
     */
	let packets = {};

	packets.PacketEvent = (function() {

		/**
         * Properties of a PacketEvent.
         * @memberof packets
github tensorflow / tfjs-converter / src / data / es6 / compiled_api.js View on Github external
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
import * as $protobuf from "protobufjs/minimal";
var $Reader = $protobuf.Reader, $util = $protobuf.util;
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
export var tensorflow = $root.tensorflow = (function () {
    var tensorflow = {};
    tensorflow.Any = (function () {
        function Any(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }
        Any.prototype.typeUrl = "";
        Any.prototype.value = $util.newBuffer([]);
        Any.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.tensorflow.Any();
            while (r.pos < c) {
github coast-team / sigver / lib / signaling_ws.cjs.js View on Github external
}
  }

  validateId(id) {
    if (typeof id !== 'string') {
      throw new SigverError(SigverError.MESSAGE_ERROR, `The joining id is not a string`);
    }
  }
}

/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
const $Reader = $protobuf.Reader;
const $Writer = $protobuf.Writer;
const $util = $protobuf.util;

const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

const Incoming = $root.Incoming = (() => {

    function Incoming(properties) {
        if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
    }

    Incoming.prototype.content = null;
    Incoming.prototype.joined = false;
    Incoming.prototype.ping = false;
    Incoming.prototype.pong = false;

    let $oneOfFields;

    Object.defineProperty(Incoming.prototype, "type", {
        get: $util.oneOfGetter($oneOfFields = ["content", "joined", "ping", "pong"]),