How to develop templater scripts properly typed

One thing I enjoy is programming with proper types.
Some of my templater templates can get complex, and it’s easy to do silly mistakes.
I use templater scripts (javascript filed) to move complex logic to proper source code files, but they are untyped. Is there a way to reference obsidian types and/or templater types so my code editor can help me here?