Hello @mhauer,
at the openhab-js repo, where the JavaScript library is developed, we (the maintainers) are aware of this issue. Currently, we are missing the type definitions for the RuleBuilder API, but the rest of the library should be covered.
The problem why we haven‘t got type defs for RuleBuilder yet, is the complexity of RuleBuilder, for which I honestly haven‘t found the time yet to add type defs for it.
Just changing the export statement for the type defs is no solution, since your change would disable type definitions for JSRule, runRule, and so on.
About ES6 import: I am not sure if that would work because ES6 import is working asynchronously, and there are limitations which do not allow us to run async tasks. I can probably have a look if we can get ES import working, however this is not high on my (long) priority list.
EDIT: Seems like GraalJS (the JavaScript runtime we use) supports ES6 import, so it may be possible to support this in openHAB.
Support for .ts files is something we definitely will not be able to provide, since TypeScript needs the TypeScript compiler to „compile“ to pure JavaScript. If you want typescript, you can however write your ts code somewhere and then „compile“ it and copy this to openHAB.
Note, that if you want more strict type behaviour in VS Code, you can add // @ts-check to the top of your js files.