3

I'm trying to use mathjs in a typescript project. I'd like to use the "number-only" part (avoiding BigNumbers and Fractions). I've done yarn add mathjs and yarn add @types/mathjs.

In my code, I tried to import it like this:

import * as math from 'mathjs/number'

but I get a typescript error: Could not find a declaration file for module 'mathjs/number'

I can do import * as math from 'mathjs' but then I get BigNumbers popping up all over when I use it. Anyone know how to use it like this?

GaryO
  • 5,873
  • 1
  • 36
  • 61
  • 1
    It doesn't look like the type definition support this. You could make one using `declare module "mathjs/number" { }` but I don't know what that should export. – Aaron Beall Jun 26 '19 at 21:08

0 Answers0