PaulBernier / factomjs

Javascript library to build applications on the Factom blockchain.
MIT License
22 stars 7 forks source link

Added typescript type definition file as well as minor documentation changes. #7

Closed schalk-b closed 5 years ago

PaulBernier commented 5 years ago

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?

schalk-b commented 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.

PaulBernier commented 5 years ago

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!

PaulBernier commented 5 years ago

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.