If a user is working with a non-typescript project, they simply cannot use the bindings generated by spacetimedb. Hence, we should generate .js files as bindings. We can type the files in 2 ways:
JSDoc: JSDoc are types-in-comments, and work well too!
.js + .d.ts: THis will be a bit more complicated, but it requires generating 2 files, .js with all the logic, and .d.ts with the correct types specified, TypeScript will automatically combine the two while checking.
Best of both worlds
We scan through user's files and if we see .ts files, we generate .ts by default. Otherwise switch to .js(or .js+.d.ts). Can be overriden by a CLI flag (--use-typescript)
If a user is working with a non-typescript project, they simply cannot use the bindings generated by spacetimedb. Hence, we should generate .js files as bindings. We can type the files in 2 ways:
Best of both worlds
We scan through user's files and if we see .ts files, we generate .ts by default. Otherwise switch to .js(or .js+.d.ts). Can be overriden by a CLI flag (--use-typescript)