Typescript definition file generator for Google's Blockly.
This project generates the Typescript definition file (d.ts file) for Google's Blockly required to get type safety via the Typescript compiler. Currenlty, this only generates the type defintions for Blockly's core folder. This is intended to generate the files that can eventually be added to Definitely Typed (i.e., @types
).
Since you currenlty can't consume the definition file via npm
, the last generated d.ts file is checked in for reference. You should generate your own if you're using a different version of Blockly.
- If you need to generate a new version of the definition file, see instructions.
- Generated definition file location: dist/blockly-core.d.ts
- Let
tsc
know about the new typing file.- See Typescript Handbook if you need more guidance in including Typescript definition files.
- Add matching version of Blockly to your project.
- This project only provides the definition file; you still need to include the Blockly library.
- Blockly uses the closure-library and some of the reference types found there (e.g.,
goog.math
). Fortsc
to be happy, you'll have to define these referenced closure-library types. I currently don't do this for you.
git clone https://github.com/trodi/blockly-d.ts.git
npm install
npm start
- Generated files found in dist/