fix(web): add MouseEvent & IPolicy types #823
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(some lines got automatically formatted when doing the commit)
added MouseEvent & IPolicy types instead of any types.
There are still a few "any" types but starting to think it would be more confusing to remove them than to let them stay, explanation:
provider: any
this library should have included the type for this I guess, but its a bit messy and not clear. I found this hack, you could add to the package.json the following:
but still didnt work properly as it does with "any" and some other error appeared
maybeObjects: any[] | any
in this function you don't really know what's passing as parameter, so makes sense its any, you could make the type "unknown" too I guess, but its kind of the same
({ query, variables }: { query: string; variables?: any }
this took a while and I ended up thinking it could maybe be more confusing to add a type for this than to leave it like this. This "variables" parameter seems to be the input parameters for the query. At first I did this
but then I realized that you could maybe input objects as the query too, not just 1 string. so, not sure.