ruimarinho / bitcoin-core

A modern Bitcoin Core REST and RPC client.
477 stars 184 forks source link

Declare Typescript custom typings #140

Open pedrobranco opened 1 year ago

ChandlerFerry commented 1 year ago

@pedrobranco What strategy do you want to work towards for this?

While I do not plan to completely solve the issue, I can begin the process to make it easier for other users to continue to build upon.

pedrobranco commented 1 year ago

@ruimarinho WDYT of using declaration file in DefinitelyTyped?

LeeKorbisCa commented 11 months ago

How is anyone using TS at all in the Bitcoin ecosystem?

Another option not mentioned is using JSDoc. https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html

I'll add the JSDoc annotations since nothing exists and open a PR. I only hope it'll be accepted. :laughing: I'll base it on https://github.com/ruimarinho/bitcoin-core/pull/149 - This makes the types completely orthogonal.

I've done the same with bitcoinjs/coinselect. I'll be opening a PR there as well.

0-don commented 2 months ago

yes types would be nice, why not just add at least the types from index.d.ts in this old puill request https://github.com/ruimarinho/bitcoin-core/pull/65