/** * Cross-currency fallback: naming a currency the quoting language has no * native words for. * * Lookup chain for a (language, ISO code) pair (see docs/currency-vocab.md): * 1. the language's own matrix entry — preferred, keeps every existing * output byte-identical; * 2. `Intl.DisplayNames` for the major unit in the quoting language plus * `FALLBACK_MINOR_UNIT` for the subunit (home-language words verbatim); * 3. `RangeError` — an unknown code, or a needed-but-missing subunit word. * * This is a deliberate fork divergence from upstream's "RangeError rather * than guessing" rule: steps 2–3 live here so the guess is explicit and * documented. Every language uses it (open option set) — including * gender-sensitive and multi-plural ones, where a fallback noun renders * with a default masculine gender and its base form standing in for * unknown plural slots. A foreign noun's true gender/plural in the quoting * language remains a native-speaker decision — the fallback is honest * wiring (well-formed output naming the right currency), not a claim of * native wording. Native matrix entries always win where they exist. * * Zero-dependency safe: `Intl.DisplayNames` is a language builtin (Node 22+, * browsers, Deno, Bun, workers) — no data ships in any bundle. The trade-off * is ICU-version wording: fallback outputs pin whatever the runtime's ICU * spells, so fixture cases covering fallback pairs assert wiring against the * local ICU, not universal wording. * @module currency-fallback */ /** * Subunit words for fallback-named currencies, in home-language order * (singular-first where the home language distinguishes). * * Contribution point: if you can name a missing subunit, add one line here * (single-index consumers read `[0]`). Until then an amount needing that * subunit throws RangeError rather than spelling a fictitious word — same * loudness as the native `minor: null` + exponent-0 contract. * * `null` marks a currency with no everyday subunit (zero-exponent) — same * contract as native `minor: null`. Multi-form arrays keep the home * language's own order (e.g. 3-form Slavic, 4-form Arabic); consumers with * fewer slots read `[0]`/`[1]`, consumers with more fall back to `[0]` for * unknown slots (see per-file `length` guards). * @type {Record} */ export declare const FALLBACK_MINOR_UNIT: Record; /** * Words for an amount's currency: native matrix entry when the quoting * language has one, DisplayNames/home-minor fallback otherwise. * @param {Record} vocab - The quoting language's native matrix export * @param {string} displayLocale - BCP 47 tag of the quoting language * @param {string} code - ISO 4217 currency code * @param {bigint} cents - Minor-unit part, for the missing-subunit guard * @returns {{ major: string[], minor: string[] | null, native: boolean, majorGender: ('masculine' | 'feminine'), minorGender: ('masculine' | 'feminine') }} Word * forms plus whether they came from the native matrix (`native: false` lets a * language apply quoting-language orthography to foreign nouns). Gender * defaults to masculine for fallback nouns — a native-speaker decision the * fallback doesn't pretend to make, but rendering needs a concrete value. * @throws {RangeError} Unknown code, or subunit words missing while cents > 0 */ export declare function resolveCurrencyWords(vocab: Record, displayLocale: string, code: string, cents: bigint): { major: string[]; minor: string[] | null; native: boolean; majorGender: ('masculine' | 'feminine'); minorGender: ('masculine' | 'feminine'); };