I am trying to create an Angular2 app that works with money amounts. I am trying to use dinero.js to represent money values, but I am having a hard time using certain features in Typescript.
As the instructions suggested, I installed the DefinitelyTyped mappings for dinero.js using this command
npm install @types/dinero.js --save
The type mappings for this library are declared here.
I import the library into my code like this:
import * as Dinero from 'dinero.js';
This allows me to use the factory function Dinero. The problem is, that declaration lists some functions (namely maximum and minimum) that I want to use, but can't seem to get to.
If I try Dinero.maximum(...), I get:
"export 'maximum' (imported as 'Dinero') was not found in 'dinero.js'
If I try to import those functions directly:
import {maximum, minimum} from 'dinero.js';
and call by maximum(...), I get:
"export 'minimum' was not found in 'dinero.js'
How do I actually get to these functions?