Closed jsonmaur closed 5 years ago
hi @jsonmaur, sorry, I don't mantain that project and I haven't used typescript to be of any help.
I you need to make a PR to this project to fix the issue I'll be happy to review.
Funnily I ran into the exact same problem yesterday too. The problem is that @types/knex-postgis
comes with its own knex
dependency locked at ^0.16.1
. Since knex
is still doing 0.x releases that means npm install
won't install 0.17.0
or higher but instead @types/knex-postgis
gets its own local knex
dependency whose typings are outdated compared to the newer knex
typings which get passed to the KnexPostgis
function.
Possible workarounds without updating the typings (which are missing the function definitions mentioned in the change log but which I don't need):
@types/knex-postgis
to use a newer version of knex
via yarn
's selective dependency resolutions (or maybe npm-force-resolutions
for npm
)knex
version 0.16.3
so the typings match (I wouldn't do that)Edit: I removed the cast to any
as a possible workaround since it would lead to similar problems with further usage.
hi guys, I created a pull request #37 that adds basic support for typescript. To my understanding this will fix this issue. I would like you to review this PR and comment it if it is good enough before merge. You have more experience working with typescript so I would thank you if you can help me to improve the solution.
Thank you! I'll have a look at it.
I just publish v0.10.0 which includes basic support for typescript. I will close this issue for now, but feel free to open it if you have any problem with the new release.
Can't seem to use this library with Typescript cause it looks like the DefinitelyTyped definitions are out of date (don't know if you maintain those or not): https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/knex-postgis
For reference, this is the type error:
Usage: