MikeMcl / bignumber.js

A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic
http://mikemcl.github.io/bignumber.js
MIT License
6.68k stars 742 forks source link

Fix #251 #308

Closed jbrower2 closed 2 years ago

jbrower2 commented 2 years ago

Add TypeScript binding to allow instantiating BigNumber without the new keyword

I opted against adding jsdoc to this binding, only because there was no way to link directly to the constructor itself.

MikeMcl commented 2 years ago

Does it work?

jbrower2 commented 2 years ago

I've modified bignumber.d.ts in an existing TypeScript project within the node_modules directory, and TypeScript is happy with the change. I haven't done any thorough testing, but this alleviates the TypeScript error and I can't imagine it would have any negative side-effects.

MikeMcl commented 2 years ago

Okay, I'll try and test it more thoroughly during the week.

andidev commented 2 years ago

@MikeMcl whats the status on this? would be nice to have now that we migrate to typescript! Btw thanks for an awesome lib!