UNPKG

cashify

Version:

Lightweight currency conversion library, successor of money.js

25 lines (24 loc) 606 B
import type { BigSource, Big } from 'big.js'; export declare type Rates = Record<string, number>; export interface Options { /** * Currency from which you want to convert. */ from?: string; /** * Currency to which you want to convert. */ to?: string; /** * Base currency. */ base: string; /** * Object containing currency rates (for example from an API, such as Open Exchange Rates). */ rates: Rates; /** * Optional, Big.js constructor - useful to avoid floating point errors. */ BigJs?: new (value: BigSource) => Big; }