Web3.js
web3
into the window
object.
Browser Wallets like MetaMask
inject ethereum
into the window
object.
In typescript right now to mitigate compile errors i'm casting as follows (window as any).ethereum
After looking in the Web3
repository and Wallet repo's (such as MetaMask) there are no importable / copyable typescript definitions / interfaces for the Window
object.
A possible solution is to write my own interface and extend the Window, look at the Window object and try to infer the types - not ideal
Other developers that have used web3.js and typescript, how did you get past the Window type interface issues and intellisense suggestions in VSCode?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…