arabicfmt
Version:
Arabic-first formatting for numbers, currency, dates and bidirectional text across all 22 Arab League countries — with correct handling of the 2025–2026 Unicode currency-symbol transition (Saudi Riyal U+20C1, UAE Dirham U+20C3, Omani Rial U+20C4).
44 lines (41 loc) • 3.38 kB
text/typescript
export { ARAB_LEAGUE_COUNTRIES, ArabLeagueCountry, CLDR_VERSION, CURRENCY_SYMBOLS, CURRENCY_WORDS, CurrencyInfo, CurrencyNoun, CurrencySymbolData, CurrencyWords, FormatCurrencyOptions, LEGACY_RIAL_LIGATURE, PRECISION_OVERRIDES, ResolveSymbolOptions, SpellCurrencyOptions, SymbolMode, SymbolPosition, UnicodeSymbol, countryCurrency, currencyDigits, currencyForLocale, currencyForRegion, formatCurrency, getCurrencyInfo, getSymbolData, resolveCurrencySymbol, spellCurrency } from './currency/index.cjs';
export { ARABIC_INDIC_DIGITS, ArabicOrdinalOptions, ArabicWordsOptions, DurationUnit, EXTENDED_ARABIC_INDIC_DIGITS, FormatDurationOptions, FormatFileSizeOptions, FormatNumberOptions, FormatRelativeTimeOptions, arabicFraction, arabicOrdinal, arabicToWords, formatCompact, formatDuration, formatFileSize, formatNumber, formatPercent, formatRelativeTime, parseCurrency, parseNumber, toArabicDigits, toLatinDigits } from './number/index.cjs';
export { C as CountedNoun, c as countedNoun } from './count-C4U_RQ2h.cjs';
export { dateToJDN, formatHijri, fromHijri, gregorianToJDN, jdnToDate, jdnToGregorian, toHijri } from './date/index.cjs';
export { ALM, FSI, IsolateDirection, IsolateForeignOptions, LRI, LRM, PDI, RLI, RLM, charDirection, detectDirection, isRTL, isolate, isolateForeign, stripBidi, wrapLTR, wrapRTL } from './bidi/index.cjs';
export { ArabicPluralForm, ArabicPluralForms, FormatListOptions, NormalizeOptions, SlugifyOptions, arabicPlural, arabicPluralForm, compareArabic, createArabicCollator, formatList, normalizeAlef, normalizeAlefMaksura, normalizeArabic, normalizeForSearch, normalizeTaaMarbuta, removeTatweel, slugify, sortArabic, stripTashkeel, transliterate } from './text/index.cjs';
export { FormatIBANOptions, IBAN_LENGTHS, SaudiIdType, formatIBAN, isValidIBAN, isValidSaudiId, normalizeIBAN, saudiIdType } from './validate/index.cjs';
export { D as Direction, N as NumeralSystem } from './types-CK7PVYeU.cjs';
export { A as ARABIC_WEEKDAYS_AR, a as ARABIC_WEEKDAYS_EN, F as FormatHijriOptions, G as GREGORIAN_MONTHS_AR, b as GREGORIAN_MONTHS_EN, H as HIJRI_ERA_AR, c as HIJRI_ERA_EN, d as HIJRI_MONTHS_AR, e as HIJRI_MONTHS_EN, f as HijriDate, g as formatHijriDate } from './format-BkdDnX9Q.cjs';
/** Default locale used across the library when none is supplied. */
declare const DEFAULT_LOCALE = "ar";
/**
* Extract the region (ISO 3166-1 alpha-2, upper-cased) from a BCP-47 tag.
*
* Parsed by hand rather than via `Intl.Locale` so it works on runtimes with a
* limited `Intl` (older React Native / Hermes). Returns `undefined` when the tag
* carries no region subtag.
*
* @example regionFromLocale("ar-SA") // "SA"
* @example regionFromLocale("ar-Arab-EG") // "EG"
* @example regionFromLocale("ar") // undefined
*/
declare function regionFromLocale(locale: string): string | undefined;
/**
* Detect the best Arabic locale for the current runtime environment.
*
* Priority:
* 1. `navigator.language` (browser / React Native)
* 2. `navigator.languages[0]` (browser fallback)
* 3. `process.env.LANG` / `LANGUAGE` / `LC_ALL` / `LC_MESSAGES` (Node.js)
* 4. `"ar"` (universal fallback)
*
* @example
* // In a Saudi browser:
* detectLocale() // "ar-SA"
*
* // In a Node process with LANG=ar_EG.UTF-8:
* detectLocale() // "ar-EG"
*/
declare function detectLocale(): string;
export { DEFAULT_LOCALE, detectLocale, regionFromLocale };