The answer to your question depends a bit on how you intend to run the code that Blockly is generating for you. If you are loading (or eval-ing) that code into a JavaScript environment that already has your function defined then all you should need to do is have your generator output a string that calls the function. You don't need to use
However, if you want your Blockly code generator to place the definition of
myFunc in its generated code then you probably want to use
provideFunction_. The purpose of that function is to put the definition of a function in your generated code. If you do want Blockly to generate your function definition for you then you'll need to do it in the way that
provideFunction_ wants you to do it. See the
documentation for provideFunction_ for a little more info. Note that you could, potentially, import your
myFunc function and use
myFunc.toString() to generate the string that provideFunction_ wants. You'd have to process it a little bit to substitute javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_ for the name of the function in the resulting string.