adamjkb / bark

Materialized path extension for Prisma
https://prisma-extension-bark.gitbook.io
MIT License
33 stars 5 forks source link

Improve user-facing Typescript notations #19

Closed adamjkb closed 11 months ago

adamjkb commented 1 year ago

Types at the moment aren't the best they could be. This is partly due to prisma latest version that broke types for extensions ~using the client callback~ (they are just broken across board). That said a lot of things can be done to improve type safesty (for example return types)

adamjkb commented 1 year ago

Well it broke the notation because .ts file behave differently for .js so basically we cannot just let just Prisma infere the types from usage.


Update 1:

I tried to manually type the expected return value of client.$extends gets back the inside the defineExtension but to no avail.

Beside this, the repo is typed with the exception of return value of the API method. (They are a simple addition once the client extension's type is working).

adamjkb commented 12 months ago

Related issue on Prisma's repo: prisma/prisma#20128