Skip to content

Commit 4f1b80d

Browse files
Daniel Lebrechtdcousens
authored andcommitted
typescript instructions on README
closes: bitcoinjs#815
1 parent f09647b commit 4f1b80d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,25 @@ uglifyjs ... --mangle --reserved 'Array,BigInteger,Boolean,ECPair,Function,Numbe
7979

8080
**NOTE**: If you expect this library to run on an iOS 10 device, ensure that you are using [[email protected]](https://github.com/feross/buffer/pull/155) or greater.
8181

82+
83+
### Typescript or VSCode users
84+
Type declarations for Typescript are available for version 3.0 of the library. To install, run:
85+
86+
``` bash
87+
npm install @types/bitcoinjs-lib
88+
```
89+
90+
You should now be able to use bitcoinjs-lib as if it was a typescript library.
91+
92+
e.g.,
93+
``` javascript
94+
import { HDNode, Transaction } from 'bitcoinjs-lib'
95+
```
96+
97+
VSCode (and possibly other editors) users writing plain javascript are also advised to install the type declarations, as the intelisense uses that information to help you code (autocompletion, static analysis).
98+
99+
Report bugs on the type declaration file at [@dlebrecht DefinitelyTyped fork](https://github.com/dlebrecht/DefinitelyTyped) or do a PR straight at [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped)
100+
82101
### Flow
83102
Definitions for [Flow typechecker](https://flowtype.org/) are available in flow-typed repository.
84103

0 commit comments

Comments
 (0)