src/request.js
function rpc(functionName, ...datatypes) {
  const qrpc = qtypes.QInt.from(Types.RPCCALL);
  const qfunctionName = qtypes.QByteArray.from(`2${functionName}`);
  return function(target, _key, descriptor) {
    return {
      enumerable: false,
      configurable: false,
      writable: false,
      value: function(...args) {
        const data = descriptor.value.apply(this, args);
        this.qtsocket.write([
          qrpc,
          qfunctionName,
          ...data.map((value, index) => datatypes[index].from(value))
        ]);
      }
    };
  };
}
function rpc(functionName, ...datatypes) {
  const qrpc = qtypes.QInt.from(Types.RPCCALL);
  const qfunctionName = qtypes.QByteArray.from(`2${functionName}`);
  return function(target, _key, descriptor) {
    return {
      enumerable: false,
      configurable: false,
      writable: false,
      value: function(...args) {
        const data = descriptor.value.apply(this, args);
        this.qtsocket.write([
          qrpc,
          qfunctionName,
          ...data.map((value, index) => datatypes[index].from(value))
        ]);
      }
    };
  };
}
function rpc ( functionName , ... datatypes ) { const qrpc = qtypes . QInt . from ( Types . RPCCALL ) ; const qfunctionName = qtypes . QByteArray . from ( ` ${ functionName } ` ) ; return function ( target , _key , descriptor ) { return { enumerable : false , configurable : false , writable : false , value : function ( ... args ) { const data = descriptor . value . apply ( this , args ) ; this . qtsocket . write ( [ qrpc , qfunctionName , ... data . map ( ( value , index ) => datatypes [ index ] . from ( value ) ) ] ) ; } } ; } ; }
Decorator for RPC methods
@protected
Decorator for RPC methods