I am trying to generate code from blocks that can have any input type to JavaScript. But to do so I need to know what type these blocks are during generation time.
Most blocks already have a type internally for the type check
"output": ["Integer","Number"],
or
this.setOutput(true, 'String');
but I can't find a function to access the 'output' field with.
Ideally I want to access the type in the generator function like this:
var return_type = block.getChildren()[0].functionToAccessOutputWith;
There is the '.type' field but that one gives the name of the block type not the return value defined with output.
It seems like a very common problem but I can't find anything online.