Related to https://github.com/ethereum/web3.js/issues/2266
There should be a way to overload the TypeScript definition of Web3 constructor to accept custom providers. I've tried everything, even declaration merging won't work. The easiest solution I foresee, which would not be a breaking change, is to provide a basic Provider interface which all providers must implement. Using a generic type parameter would be even more ideal, because it means properties like currentProvider could be strongly typed, even if they are custom/non-standard.
Right now the only workaround is to cast the provider to any, which is not ideal.
Web3 instance with non-standard provider@nivida @smithki I am picking it up. Will update once I am done :)
This issue hasn't been updated in a month, so I created #3451
Most helpful comment
@nivida @smithki I am picking it up. Will update once I am done :)