src/request.js
function sync(className, functionName, ...datatypes) {
  const qsync = qtypes.QInt.from(Types.SYNC);
  const qclassName = qtypes.QByteArray.from(className);
  const qfunctionName = qtypes.QByteArray.from(functionName);
  return function(target, _key, descriptor) {
    return {
      enumerable: false,
      configurable: false,
      writable: false,
      value: function(...args) {
        const [ id, ...data ] = descriptor.value.apply(this, args);
        this.qtsocket.write([
          qsync,
          qclassName,
          qtypes.QByteArray.from(id),
          qfunctionName,
          ...data.map((value, index) => datatypes[index].from(value))
        ]);
      }
    };
  };
}
function sync(className, functionName, ...datatypes) {
  const qsync = qtypes.QInt.from(Types.SYNC);
  const qclassName = qtypes.QByteArray.from(className);
  const qfunctionName = qtypes.QByteArray.from(functionName);
  return function(target, _key, descriptor) {
    return {
      enumerable: false,
      configurable: false,
      writable: false,
      value: function(...args) {
        const [ id, ...data ] = descriptor.value.apply(this, args);
        this.qtsocket.write([
          qsync,
          qclassName,
          qtypes.QByteArray.from(id),
          qfunctionName,
          ...data.map((value, index) => datatypes[index].from(value))
        ]);
      }
    };
  };
}
function sync ( className , functionName , ... datatypes ) { const qsync = qtypes . QInt . from ( Types . SYNC ) ; const qclassName = qtypes . QByteArray . from ( className ) ; const qfunctionName = qtypes . QByteArray . from ( functionName ) ; return function ( target , _key , descriptor ) { return { enumerable : false , configurable : false , writable : false , value : function ( ... args ) { const [ id , ... data ] = descriptor . value . apply ( this , args ) ; this . qtsocket . write ( [ qsync , qclassName , qtypes . QByteArray . from ( id ) , qfunctionName , ... data . map ( ( value , index ) => datatypes [ index ] . from ( value ) ) ] ) ; } } ; } ; }
Decorator for SYNC methods
@protected
Decorator for SYNC methods