BN.js typings that allow natural imports.
yarn install --dev bn.js-typings
First, you need to make sure that our package is included in your tsconfig.json
file.
"include": [
"./lib/**/*.ts",
"./node_modules/bn.js/index.d.ts"
]
Copy to index.d.ts to under node_moduls (./node_modules/bn.js/)
Then use it simply like this:
import { BN } from "bn.js"