pooliot-client
Version:
33 lines (20 loc) • 958 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.send = send;
var _nodeIpcPromise = require('node-ipc-promise');
var _nodeIpcPromise2 = _interopRequireDefault(_nodeIpcPromise);
var _flowRuntime = require('flow-runtime');
var _flowRuntime2 = _interopRequireDefault(_flowRuntime);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const ipc = (0, _nodeIpcPromise2.default)();
function send(message, ...args) {
let _messageType = _flowRuntime2.default.string();
let _argsType = _flowRuntime2.default.array(_flowRuntime2.default.any());
const _returnType = _flowRuntime2.default.return(_flowRuntime2.default.any());
_flowRuntime2.default.param('message', _messageType).assert(message);
_flowRuntime2.default.rest('args', _argsType).assert(args);
return ipc.exec(message, ...args).then(_arg => _returnType.assert(_arg));
}
//# sourceMappingURL=ipc.js.map