XIBLEDOCS

NodeInput()

Class for inputs of a Node.

Extends

NodeIo

Synopsis

{NodeInput} =new NodeInput();

Event: nodeInput "trigger"

This event is emitted after a node calls trigger() on one of its outputs. The event is fired for each of the input triggers connected to the output where trigger() was called upon.

Parameters

name type description
conn Connector The connector responsible for the trigger.
state FlowState The state provided from the calling node.

Synopsis

nodeInput.on('trigger', (  {Connector} conn,  {FlowState} state) => {});

nodeInput.getConnectors()

Returns a list of all connectors to a NodeIo, including global connections.

Returns

An array of connectors.

Inherited

This method is inherited from nodeIo.getConnectors.

Synopsis

{Array.<Connector>} =nodeInput.getConnectors();

nodeInput.getValues(state)

Fetches all input values for this input.

Parameters

name type required default description
state FlowState yes The flowstate at the time of calling.

Returns

- An array of all values as returned by the outputs on the other ends of connected connectors or globals. If any of the outputs returns an array, it will be concatened to the return array, instead of pushed.

Synopsis

{Promise.<Array>} =nodeInput.getValues(  {FlowState} state);

nodeInput.isConnected()

Confirms whether or not the NodeIo is connected. Also checks for global connections.

Returns

True if connected, false if not.

Inherited

This method is inherited from nodeIo.isConnected.

Synopsis

{Boolean} =nodeInput.isConnected();

nodeInput.matchesTypeDef()

Checks whether any given value matches the typeDef on this NodeInput. Also returns true if the given value equals undefined or null. When there is no typeDef related to the constructor of the value, this also returns true.

Returns

Synopsis

{Boolean} =nodeInput.matchesTypeDef();

NodeIo()

Abstract Node Input/Output class.

Extends

EventEmitter

Synopsis

{NodeIo} =new NodeIo();

nodeIo.getConnectors()

Returns a list of all connectors to a NodeIo, including global connections.

Returns

An array of connectors.

Synopsis

{Array.<Connector>} =nodeIo.getConnectors();

nodeIo.isConnected()

Confirms whether or not the NodeIo is connected. Also checks for global connections.

Returns

True if connected, false if not.

Synopsis

{Boolean} =nodeIo.isConnected();

NodeOutput()

Class for outputs of a Node.

Extends

NodeIo

Synopsis

{NodeOutput} =new NodeOutput();

Event: nodeOutput "trigger"

This event is emitted after a node calls getValues() on one of its inputs. The event is fired for each of the outputs connected to the input where getValues() was called upon. The functions which are called by this event should return a Promise or use the callback function to return their value.

Parameters

name type description
conn Connector The connector responsible for the trigger.
state FlowState The state provided from the calling node.
callback function Use the callback function to return your value. You can only callback once, otherwise an Error is thrown. The same error is thrown if both a Promise is returned and the callback is used.

Returns

Return a promise to return the value.

Synopsis

{Promise} =nodeOutput.on('trigger', (  {Connector} conn,  {FlowState} state,  {function} callback) => {});

nodeOutput.getConnectors()

Returns a list of all connectors to a NodeIo, including global connections.

Returns

An array of connectors.

Inherited

This method is inherited from nodeIo.getConnectors.

Synopsis

{Array.<Connector>} =nodeOutput.getConnectors();

nodeOutput.isConnected()

Confirms whether or not the NodeIo is connected. Also checks for global connections.

Returns

True if connected, false if not.

Inherited

This method is inherited from nodeIo.isConnected.

Synopsis

{Boolean} =nodeOutput.isConnected();

nodeOutput.trigger(state)

Triggers an output with type === 'trigger'.

Parameters

name type required default description
state FlowState yes The flowstate at the time of calling.

Synopsis

nodeOutput.trigger(  {FlowState} state);