While working on my Angular2 app that deals with money amounts, I decided to use dinero.js to handle money values. However, I am encountering difficulties in accessing certain features in Typescript.
Following the instructions, I installed the DefinitelyTyped mappings for dinero.js using this command:
npm install @types/dinero.js --save
You can find the type mappings for this library here.
To import the library into my code, I used the following syntax:
import * as Dinero from 'dinero.js';
This allows me to utilize the factory function Dinero
. The issue arises when trying to access functions like maximum
and minimum
, which are mentioned in the declaration but proving difficult to reach.
When attempting to call Dinero.maximum(...)
, I receive the error message:
"export 'maximum' (imported as 'Dinero') was not found in 'dinero.js'
Similarly, directly importing these functions and calling them like so:
import {maximum, minimum} from 'dinero.js';
Results in the error:
"export 'minimum' was not found in 'dinero.js'
I am seeking guidance on how to successfully access these functions within my code.