-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add typing support to query #655
base: master
Are you sure you want to change the base?
Add typing support to query #655
Conversation
Updated playground link: https://tsplay.dev/WYQJzW |
Would it be possible to even infer the type from the |
Could you explain what you mean? I don't think its possible to infer the type returned by |
I think this is what @TorstenDittmann meant: TS playground You'll see I added a listDocuments, that checks if the return type from Query.isNull is valid, without having to pass the type to Query.isNull. Doing this for all the query methods would be complicated, but I believe it is possible. |
Modifying your example slightly |
I think it might not be possible to skip the type when creating a query with list documents, at least not with the current implementation. This is because:
I haven't thought this through but I think it might be possible to skip the type by changing the return value of About 2: Usage outside listDocuments is either
or
which looks weird to me. |
I also thought about changing the return types, would be way easier to infer types. But would change how listDocuments works. @TorstenDittmann thoughts? |
For now I don't think we should change the return type of Query. @TorstenDittmann, what do you think of #655 (comment)? |
Anything new on this one? |
It would be very great if we can merge this PR ^^ Anyone can review it ? 🙏 |
Closes #581
What does this PR do?
Adds typing support for web SDK
Test Plan
Manually test. Verified using typescript playground
Related PRs and Issues
#581
Have you read the Contributing Guidelines on issues?
Yes