arqam 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/SRI.txt CHANGED
@@ -1,5 +1,5 @@
1
- sha384-EIzWC94ZAbLzcF+CeZCqwpsLnIwXp0Mu5IQduzkXhl4Rej+QI2uzvNdAW8UMWoBK arqamAR.mjs
1
+ sha384-Kr9McehfxLWFyfOZh0J02la+gxEb0OLwaGkI4XLoaysSqtqhZvNYvtZrFm6erFon arqamAR.mjs
2
2
  sha384-ocjkJMUCeSQQaTmNy55NhEMwyJ9ktFWm/IUXCef4zzNKJbVuEXKR7DB1KwaLZxMY arqamEN.mjs
3
- sha384-l/DvoIhl9cFY1flX4MuXfneZHj8mTP+wFWqa6Z9YeITc7KUuR9dp9eTyFzdbRngx arqamWordsToNumbers.mjs
4
- sha384-qHnvei9vHKkTU2lBOpOwMuDGJyWYW9GNH/3qGS8uGfHh1OAnDSLi7wFbQXOurvIt arqamExplain.mjs
5
- sha384-AX89Ahf+VwLyBc5nKAGgHVpObkMtIHQfubde/TU4i/O3Q/gsDK9uHWzLH8NcSTB8 arqamUnits.mjs
3
+ sha384-e+zT7styCVo+tty4Yqc23H1N4Sop+zCXumQa9oXSeNX+GBP9g+1K34jmKDtgsASh arqamWordsToNumbers.mjs
4
+ sha384-luWRJ6Sa3HfnKba7WTvFaB7Cl1iaL8jm2tdO661D6FM3A1sGG+yjTYPMjMduaBSd arqamExplain.mjs
5
+ sha384-oWyOiFo5zCpf7GffTRa5+XA8V8FHWNIvn9qCgdo4GJZZXv1nsFf7lXTx+yqq9bKK arqamUnits.mjs
@@ -1,8 +1,9 @@
1
- /*! arqamAR — TypeScript declarations for dist/arqamAR.mjs. MIT licence.
2
- * Copied to dist/ by tools/build_dist.py; tests/dist.test.js checks that every option, currency attribute
3
- * and export of the engine is declared here.
4
- * @author: Mohsen Alyafei */
5
-
1
+ /*********************************************************************
2
+ * @file : arqamAR.d.mts
3
+ * @purpose : TypeScript declarations for arqamAR.mjs: every option, currency attribute and export.
4
+ * @author : Mohsen Alyafei
5
+ * @Licence : MIT
6
+ **********************************************************************/
6
7
  /** A number: text ("1234.56", Arabic-Eastern numbers too, "-" before and "%" after allowed), a JS number or a BigInt.
7
8
  * Pass amounts as text: a JS number keeps only about 16 significant digits. */
8
9
  export type ArqamNumber = string | number | bigint;
@@ -317,6 +318,13 @@ export interface ArqamFractionOptions {
317
318
  /** With a code: minor (default): the minor unit when the amount is exact (2 1/2 QAR -> ريالان قطريان اثنان، وخمسون درهمًا) ·
318
319
  * named: the fraction word (ريالان قطريان اثنان ونصف، نصف ريال قطري) */
319
320
  fractionUnit?: "" | "minor" | "named";
321
+ /** A fraction of a noun: the phrase (المضاف إليه) the fraction is a share of, joined exactly as given; the fraction is
322
+ * the first term in the case of ierab: ثلثُ المبلغِ، ثلثَيِ المبلغِ، سبعةُ أجزاءٍ من ستةَ عشرَ منَ المبلغِ. Only a
323
+ * fraction more than zero and less than one; not with a currency or fractionForm "math" */
324
+ fractionOf?: string;
325
+ /** The second letter of the fraction words: "classical" (default) a damma throughout: ثُلُث، رُبُع، خُمُس … عُشُر;
326
+ * "modern" a sukun after ثُلُث: رُبْع، خُمْس … عُشْر. Only full tashkeel shows it */
327
+ fractionVowels?: "" | "classical" | "modern";
320
328
  /** Shared with the number options */
321
329
  tashkeel?: ArqamOptions["tashkeel"];
322
330
  tanweenAlif?: ArqamSwitch;
@@ -562,8 +570,8 @@ export interface ArqamUtils {
562
570
  parseDate(text: ArqamDate, options?: {input?: "g" | "h" | "gregorian" | "hijri"; order?: "dmy" | "mdy"}): ArqamDay & {hijri: ArqamDay | null; date: Date};
563
571
  /** A time of day, or a duration */
564
572
  parseTime(text: ArqamTime, options?: {duration?: boolean}): {hour: number; minute: number; second: number};
565
- /** A typed fraction: "3 1/2", "¾", "2.5" */
566
- parseFraction(text: ArqamFraction): {whole: string; numerator: number; denominator: number};
573
+ /** A typed fraction: "3 1/2", "¾", "2.5"; a fraction below zero ("-3/4") also has negative: true */
574
+ parseFraction(text: ArqamFraction): {whole: string; numerator: number; denominator: number; negative?: true};
567
575
  /** The Hijri (Umm al-Qura) day of a date */
568
576
  hijri(date: Date | string): ArqamDay;
569
577
  /** The Gregorian day of a Hijri date (a RangeError if that day does not exist) */
@@ -606,7 +614,7 @@ export interface ArqamLibraryNumberFormat {
606
614
  /** The library, shaped as Intl: the locale chooses the language (Arabic by default); the other methods are Arabic. */
607
615
  export interface ArqamLibrary extends Omit<Arqam, "NumberFormat" | "toWords"> {
608
616
  /** arqam(n, locales, options) is arqam.toWords(n, locales, options); a currency code in place of the locales is the
609
- * short form of an amount (engine 1.86): arqam("1250.50", "EGP") is arqam("1250.50", {currency: "EGP"}) */
617
+ * short form of an amount: arqam("1250.50", "EGP") is arqam("1250.50", {currency: "EGP"}) */
610
618
  (n: ArqamNumber, locales?: string | string[], options?: ArqamNumberFormatOptions | import("./arqamEN.mjs").ArqamENNumberFormatOptions): string;
611
619
  (n: ArqamNumber, options?: ArqamNumberFormatOptions): string;
612
620
  /** Every language, chosen by the locale */