Cloud Code do not support CommonJS module, so can not easy use TypeScript to write Cloud Code.
You can compile CommonJS(ts) to CommonJS(js), and use the compile script, compile CommonJS(js) to Cloud Code(js)
Cool man, You improve quite completely the typings
And I see you also have fork and update my repository, thank you:)
But module less code has a troublesome problem, is global namespace pollution
If the script does not write export or import, all variables in the script are exposed to the global space
That as long as there is the same variable name in the code of the two events, there will be a repeated definition warning
BTW, In other post have more discuss, this post is like dead
I tried your way because of the need for more manual checks, so I ended up turning to the present way
I have rewritten more reliable build scripts and created an example.
In addition, I refer to your fork to modify my typings, I hope you do not mind