feat: add declaration file to prevent type error#77
feat: add declaration file to prevent type error#77Overtorment merged 4 commits intobitcoinjs:masterfrom
Conversation
|
Yeah this would be appreciated to have merged. If it's a worry to keep types maintained, JSDoc can be used to both document and derive types, while remaining pure JS. After hearing the Svelte people taking this approach I looked into it and makes a lot of sense from a lib development perspective. https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html |
|
Thx, I updated following your suggestion. |
|
@Overtorment I gave you write permissions. Also, what is your npm user name? |
|
Thank you everyone for getting this in ❤️ |
|
... shouldn't this d.ts file be referenced in package.json? |
|
Yes, in the types property, as you probably read. |
|
add types in package.json in 683e6df |
|
@Overtorment merge when ready. |
|
@junderw i dont have npm account. dont trust them |
|
I made PR #82 to calculate fee more precisely(varying on type of input/output), which also adds |
|
So this type declarations won't be published to npm ? |
|
@griga If u need typed one in npm u can use my forked version. It also supports segwit fee calculation. |


I know it's pure js project, but a lot of typescript dev utilizes this module to optimize UTXO selection for bitcoin transaction. Just adding simple declaration file will make this library much more usable for typescript dev!