https://github.com/skoppe/spasm-tradingview-example
I have started work on a small project that generates these bindings automatically, leveraging the typescript compiler. This could also be used to interact with javascript libraries which have typescript bindings.