web3.js 有 TypeScript 类型定义吗?

You*_*ire 4 javascript typescript ethereum web3js

任何版本都有适用于 Web3 的类型吗?我正在 Node.js 中编写后端 API,并且我更喜欢用 TypeScript 编写。

我问这个问题是因为我一直在尝试使用 Web3 在 TypeScript 中编写 Express 应用程序并遇到此错误(以及更多错误):

This expression is not constructable.
  Type 'typeof import("c:/Users/Archie/node_modules/web3-eth-contract/types/index")' has no construct signatures.

line: const contract = new Contract(abi.json, address);
Run Code Online (Sandbox Code Playgroud)

Mik*_*maa 10

比 1.3.0 更新的最新 web3.js 版本提供了 TypeScript 支持。

web3.js 发行说明中的​​更多信息