Hello,
It is definitely possible to write TypeScript and talk to Blockly. All code in core Blockly is annotated for the Closure compiler, and those annotations are used to generate typings =) But be warned, if you do decide to go this route there will likely always be a few fixes you need to apply. I believe
#2937 is kept up with the latest fixes.
If you want to /generate/ TypeScript code with Blockly, that is also possible, but there's no built-in language generator for TypeScript, so you'll have to build your own. There's a great
codelab that walks you through creating a JSON language generator, which will help familiarize you with the API. You can also check out the
built-in language generators, for example, the
JavaScript language generator.
I hope that helps! If you have any further questions please reply =)
--Beka