Closed datner closed 9 months ago
I'm sorry, this seems confusing to me.
If you think that it can be done better, feel free to open a PR and I'll try to review it, but for now I'm not planning making changes to TS declarations or the default export.
Option to autogenerate a typed client eventually will be handled as part of https://github.com/pocketbase/js-sdk/issues/152.
@ganigeorgiev as I was trying to stress, no changes are required to neither. The only change required by the library is adding Client
to also be a regular named export. This has nothing to do with a generated typed client though that would be lovely regardless. I'll open a PR
Opened a PR
The current method is casting the
Client
to some extended interface that matches itThis is ok in the sense that it works, but it's inelegant..
Client
is currently the default export and is not exported in general. The conversation regarding the pitfalls of default exports aside, ifClient
is also just plainly exported it could then be overloaded in a declaration file, which will allow (just allow! not blocking the current solution that will stay the exact same!!) the followingMaking the client typed "by default" instead of needing to cast it. While
Client
is only default exported, this is impossible to do without workarounds.the only change required is changing
to
so there are no breaking changes