indutny / bn.js

BigNum in pure javascript
MIT License
1.2k stars 151 forks source link

Problem with typescript #230

Closed stefdelec closed 5 years ago

stefdelec commented 5 years ago

` Module '"/someproject/node_modules/@types/bn.js/index"' can only be default-imported using the 'esModuleInterop' flag

import BN from "bn.js";`

You should import * as BN from 'bn.js' export default BN; to be more typescript friendly in your interface.

fanatid commented 5 years ago

But this repo not contain any ts definitions and package too, how we can fix it? Probably you should create issue in ts definitions collection repo?

stefdelec commented 5 years ago

Ok. I thought you were publishing yourself the declaration files.

Thanks for your quick answer. I close the issue.

stefdelec commented 5 years ago

FYI https://github.com/DefinitelyTyped/DefinitelyTyped/compare/master...stefdelec:patch-4

SerhiiKozachenko commented 3 years ago

Hey, @stefdelec was it merged? Still having this issue, manually patched local node_modules works.