Closed schalk-b closed 5 years ago
Yup, just referencing types in package.json does the trick. Once they have typescript setup on their project, typing for the library will work straight after doing an npm install factom.
But I do think we should add information about typescript support in the README, I'll also do up a minimal starter project as an example.
I won't be able to get to this until next weekend.
I just added 2 small util functions generateRandomFctAddress
and generateRandomEcAddress
: https://github.com/PaulBernier/factomjs/blob/master/src/addresses.js#L224
If you get a chance to add those also to your PR. Otherwise it'll be a chance for me to try myself to add those to the typescript file. Thanks!
Hey @schalk-b will you be able to make those changes soon? Otherwise I can just merge the PR as is and I will make the changes.
Thanks a lot for that PR!
I'm not familiar with Typescipt, is adding
"types": "factom.d.ts"
to package.json enough for all Typescript devs to benefit from those definitions out of the box? Should there be any addition instructions in the README for usage or we can legitimately expect that any Typescript developer will know how to leverage your type definition file?