For my own project I wrote for the AnkiDroid JS API:
- TypeScript type definitions: HelgeUtils/Anki.d.ts at main · silidev/HelgeUtils · GitHub
- A wrapper for the API which does many things, including fixing bugs and checking types: HelgeUtils/AnkiUtils.ts at main · silidev/HelgeUtils · GitHub or compiled: HelgeUtils/dist/AnkiUtils.js at main · silidev/HelgeUtils · GitHub
I offer no support whatsoever for this. Use at your own risk. I license it under the same license as AnkiDroid.
If you are interested in this, please write so here. Because as long as nobody is using this anyway, I will be pretty careless with breaking changes and probably forget to push my updates to GitHub.