@chix/flow
Version:
118 lines • 4.1 kB
JavaScript
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var input_1 = require("../input");
var util_1 = require("./util");
var ExternalInputPort = (function (_super) {
__extends(ExternalInputPort, _super);
function ExternalInputPort(externalPort, internalPort) {
var _this = _super.call(this, util_1.externalToInternalFilter(externalPort, internalPort)) || this;
_this.nodeId = externalPort.nodeId;
_this.name = externalPort.name;
_this._port = internalPort;
if (externalPort) {
if (externalPort.hasOwnProperty('default')) {
_this.setDefault(externalPort.default);
}
if (externalPort.context) {
_this.setContext(externalPort.context);
}
}
return _this;
}
ExternalInputPort.prototype.isSync = function () {
return this._port.isSync();
};
ExternalInputPort.prototype.receive = function (packet, index) {
this._port.receive(packet, index);
return this;
};
ExternalInputPort.prototype.fill = function (_packet) {
console.error('Fill is bypassed for external input port');
return this;
};
ExternalInputPort.prototype.isFilled = function () {
return this._port.isFilled();
};
ExternalInputPort.prototype.isRequired = function () {
return this._port.isRequired();
};
ExternalInputPort.prototype.read = function () {
return this._port.read();
};
ExternalInputPort.prototype.connect = function (link) {
this._port.connect(link);
return this;
};
ExternalInputPort.prototype.plug = function (target) {
this._port.plug(target);
return this;
};
ExternalInputPort.prototype.disconnect = function (link) {
this._port.disconnect(link);
};
ExternalInputPort.prototype.unplug = function (target) {
this._port.unplug(target);
};
ExternalInputPort.prototype.clearInput = function () {
if (this._port) {
this._port.clearInput();
}
return this;
};
ExternalInputPort.prototype.setDefault = function (value) {
if (this._port) {
this._port.setDefault(value);
}
return this;
};
ExternalInputPort.prototype.hasDefault = function () {
return this._port.hasDefault();
};
ExternalInputPort.prototype.clearDefault = function () {
this._port.clearDefault();
return this;
};
ExternalInputPort.prototype.setContext = function (value) {
if (this._port) {
this._port.setContext(value);
}
return this;
};
ExternalInputPort.prototype.hasContext = function () {
return this._port.hasContext();
};
ExternalInputPort.prototype.clearContext = function () {
this._port.clearContext();
return this;
};
ExternalInputPort.prototype.setPersist = function (value) {
this._port.setPersist(value);
return this;
};
ExternalInputPort.prototype.hasPersist = function () {
return this._port.hasPersist();
};
ExternalInputPort.prototype.clearPersist = function () {
this._port.clearPersist();
return this;
};
ExternalInputPort.prototype.destroy = function () {
this._port.destroy();
};
return ExternalInputPort;
}(input_1.InputPort));
exports.ExternalInputPort = ExternalInputPort;
//# sourceMappingURL=input.js.map