Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit f427400

Browse files
levinofrozeman
authored andcommitted
Fix: Remove typescript typings (#1660)
* Fix #1658 by removing the typings files and all references to typescript specific things in the codebase. * Add documentation usage with TypeScript.
1 parent 9bf5803 commit f427400

File tree

4 files changed

+19
-511
lines changed

4 files changed

+19
-511
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,25 @@ web3.eth.getAccounts()
8181
.then(console.log);
8282
```
8383

84+
### Usage with TypeScript
85+
86+
Type definitions are maintained at [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) by others. You can install them with
87+
88+
```bash
89+
npm install --dev @types/web3.js
90+
```
91+
92+
You might need to install type definitions for `bignumber.js` and `lodash` too.
93+
94+
And then use `web3.js` as follows:
95+
96+
```typescript
97+
import Web3 = require("web3"); // Note the special syntax! Copy this line when in doubt!
98+
const web3 = new Web3("ws://localhost:8546");
99+
```
100+
101+
**Please note:** We do not support TypeScript ourselves. If you have any issue with TypeScript and `web3.js` do not create an issue here. Go over to DefinitelyTyped and do it there.
102+
84103
## Documentation
85104

86105
Documentation can be found at [read the docs][docs]

packages/web3/index.d.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

packages/web3/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3",
77
"license": "LGPL-3.0",
88
"main": "src/index.js",
9-
"types": "index.d.ts",
109
"bugs": {
1110
"url": "https://github.com/ethereum/web3.js/issues"
1211
},
@@ -43,8 +42,6 @@
4342
}
4443
],
4544
"dependencies": {
46-
"@types/underscore": "^1.8.0",
47-
"@types/bignumber.js": "^4.0.2",
4845
"web3-bzz": "1.0.0-beta.35",
4946
"web3-core": "1.0.0-beta.35",
5047
"web3-eth": "1.0.0-beta.35",

0 commit comments

Comments
 (0)