sqlite-async icon indicating copy to clipboard operation
sqlite-async copied to clipboard

Typescript implementation

Open ndp opened this issue 2 years ago • 0 comments

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.

ndp avatar Nov 28 '22 22:11 ndp