-
Notifications
You must be signed in to change notification settings - Fork 604
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
Update window.ethereum type to unknown #432
Conversation
* Set as CoinbaseWalletProvider | ||
*/ | ||
ethereum?: any; | ||
ethereum?: unknown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we could instead declare unknown | PreciseType
so that type hinting is more useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had first attempted that, but it doesn't seem to get picked up.
// In a union an unknown absorbs everything
from microsoft/TypeScript#24439
I'll add back a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, oof then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ljharb Thoughts on addressing this issue? #343
All declarations of 'ethereum' must have identical modifiers
In order to fix the above error, the type would need to be updated to:
interface Window {
ethereum: any | undefined;
}
But I hesitate to make changes based on a library's conflicting type defs
Review Error for bangtoven @ 2022-03-25 19:27:40 UTC |
* Update window.ethereum type to any * Updates to 'unknown' * Add comment * Use JSDOC comments for deprecated api
Summary
window.ethereum