sqlite-async
sqlite-async copied to clipboard
Typescript implementation
Here is an initial Typescript version of this where the tests pass and it has minimal types.
It's ready for initial review, but I want to try it in my project before considering it a merge candidate.
I initially tried to add a separate types
file to be less disruptive, but it was more tedious and would be much harder to maintain. It was hard to make it hold together as a project. With this PR, I was able to fit the types into the existing .js file pretty seamlessly, so that you can actually read the code and tests and see that nothing has changed.
I imagine there's a much nicer Typescript version that has many fewer any
and any[]
types. For example, the query methods should be able to return a promise of a correctly typed object, if given a type. This, however, would be a little disruptive to the existing JS code, so I resisted the urge. I may pursue this as a second PR, but I need to get back to my main project.