/** * Currency value parsing utility. * Optimized parser for currency conversion - extracts dollars and cents. * @module parse-currency */ /** * Parses a value for currency conversion. * Returns dollars and cents as separate bigints, plus negative flag. * * **Precision:** `minorDigits` decimal digits are tracked and anything finer * is truncated — at the default of 2, `'1.004'` is 1 dollar and 0 cents. * Truncating rather than rejecting is deliberate: float input would otherwise * be unusable, since `0.1 + 0.2` is `0.30000000000000004` and neither * rejecting nor spelling that tail helps anybody. * * Pass 3 for a currency whose minor unit is a thousandth (millimes, fils — * see `CURRENCY_EXPONENTS` in currency-vocab.js), so that `'1.500'` dinars * parses as 500 millimes rather than 50. Use `minorUnitDigits(currency)` to * derive it instead of hard-coding, and note it returns 2 — not 0 — for a * zero-exponent currency like JPY: those are rejected by * `assertCurrencyExponent`, which can only see a fraction the parser kept. * @param {number|string|bigint} value - The value to parse * @param {number} [minorDigits] - Decimal digits to track (2 or 3, default 2) * @returns {{isNegative: boolean, dollars: bigint, cents: bigint}} The parsed dollars and cents with a negative flag. * @throws {TypeError} If value is not number, string, or bigint * @throws {RangeError} If value is not finite */ export declare function parseCurrencyValue(value: number | string | bigint, minorDigits?: number): { isNegative: boolean; dollars: bigint; cents: bigint; };