A plugin which fixes type for code generator modules below:
- "blockly/javascript"
- "blockly/python"
Other language might be added, but be sure that only javascript has been verified to work properly.
This plugin is only for typescript project, and has no effect on how it works after compiled.
- Clone this repository to your project.
- Don't install through npm! This plugin needs to be put outside node_modules to work properly.
- This is because ambient declarations outside node_modules has the highest priority in type definition solving algorism.
- I couldn't find formal document, but shown in this verification (this is written in Japanese)
- Import from "blockly/*". For example:
import * as JavaScript from "blockly/javascript";- Replace all 'Blockly.JavaScript' to 'JavaScript'.
- All properties defined in Blockly.Generator
- ORDER_* constants with numeric literal type
[key:string]:(block:Blockly.Block)=>(string|[string,number])function- You can assign code generator function like
JavaScript['SampleBlock']=sampleBlockCode;. - Using technique shown here
- You can assign code generator function like