n2words 5.1.0 → 5.1.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.
Files changed (229) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/am-ET.js +1 -1
  3. package/dist/am-ET.umd.js +1 -1
  4. package/dist/am-Latn-ET.js +1 -1
  5. package/dist/am-Latn-ET.umd.js +1 -1
  6. package/dist/ar-SA.js +1 -1
  7. package/dist/ar-SA.umd.js +1 -1
  8. package/dist/az-AZ.js +1 -1
  9. package/dist/az-AZ.umd.js +1 -1
  10. package/dist/bn-BD.js +1 -1
  11. package/dist/bn-BD.umd.js +1 -1
  12. package/dist/cs-CZ.js +1 -1
  13. package/dist/cs-CZ.umd.js +1 -1
  14. package/dist/da-DK.js +1 -1
  15. package/dist/da-DK.umd.js +1 -1
  16. package/dist/de-DE.js +1 -1
  17. package/dist/de-DE.umd.js +1 -1
  18. package/dist/el-GR.js +1 -1
  19. package/dist/el-GR.umd.js +1 -1
  20. package/dist/en-AU.js +1 -1
  21. package/dist/en-AU.umd.js +1 -1
  22. package/dist/en-BD.js +1 -1
  23. package/dist/en-BD.umd.js +1 -1
  24. package/dist/en-CA.js +1 -1
  25. package/dist/en-CA.umd.js +1 -1
  26. package/dist/en-GB.js +1 -1
  27. package/dist/en-GB.umd.js +1 -1
  28. package/dist/en-GH.js +1 -1
  29. package/dist/en-GH.umd.js +1 -1
  30. package/dist/en-IE.js +1 -1
  31. package/dist/en-IE.umd.js +1 -1
  32. package/dist/en-IN.js +1 -1
  33. package/dist/en-IN.umd.js +1 -1
  34. package/dist/en-KE.js +1 -1
  35. package/dist/en-KE.umd.js +1 -1
  36. package/dist/en-MY.js +1 -1
  37. package/dist/en-MY.umd.js +1 -1
  38. package/dist/en-NG.js +1 -1
  39. package/dist/en-NG.umd.js +1 -1
  40. package/dist/en-NZ.js +1 -1
  41. package/dist/en-NZ.umd.js +1 -1
  42. package/dist/en-PH.js +1 -1
  43. package/dist/en-PH.umd.js +1 -1
  44. package/dist/en-PK.js +1 -1
  45. package/dist/en-PK.umd.js +1 -1
  46. package/dist/en-SG.js +1 -1
  47. package/dist/en-SG.umd.js +1 -1
  48. package/dist/en-US.js +1 -1
  49. package/dist/en-US.umd.js +1 -1
  50. package/dist/en-ZA.js +1 -1
  51. package/dist/en-ZA.umd.js +1 -1
  52. package/dist/es-ES.js +1 -1
  53. package/dist/es-ES.umd.js +1 -1
  54. package/dist/es-MX.js +1 -1
  55. package/dist/es-MX.umd.js +1 -1
  56. package/dist/es-US.js +1 -1
  57. package/dist/es-US.umd.js +1 -1
  58. package/dist/fa-IR.js +1 -1
  59. package/dist/fa-IR.umd.js +1 -1
  60. package/dist/fi-FI.js +1 -1
  61. package/dist/fi-FI.umd.js +1 -1
  62. package/dist/fil-PH.js +1 -1
  63. package/dist/fil-PH.umd.js +1 -1
  64. package/dist/fr-BE.js +1 -1
  65. package/dist/fr-BE.umd.js +1 -1
  66. package/dist/fr-FR.js +1 -1
  67. package/dist/fr-FR.umd.js +1 -1
  68. package/dist/gu-IN.js +1 -1
  69. package/dist/gu-IN.umd.js +1 -1
  70. package/dist/ha-NG.js +1 -1
  71. package/dist/ha-NG.umd.js +1 -1
  72. package/dist/hbo-IL.js +1 -1
  73. package/dist/hbo-IL.umd.js +1 -1
  74. package/dist/he-IL.js +1 -1
  75. package/dist/he-IL.umd.js +1 -1
  76. package/dist/hi-IN.js +1 -1
  77. package/dist/hi-IN.umd.js +1 -1
  78. package/dist/hr-HR.js +2 -2
  79. package/dist/hr-HR.umd.js +2 -2
  80. package/dist/hu-HU.js +1 -1
  81. package/dist/hu-HU.umd.js +1 -1
  82. package/dist/id-ID.js +1 -1
  83. package/dist/id-ID.umd.js +1 -1
  84. package/dist/it-IT.js +1 -1
  85. package/dist/it-IT.umd.js +1 -1
  86. package/dist/ja-JP.js +1 -1
  87. package/dist/ja-JP.umd.js +1 -1
  88. package/dist/ka-GE.js +1 -1
  89. package/dist/ka-GE.umd.js +1 -1
  90. package/dist/kn-IN.js +1 -1
  91. package/dist/kn-IN.umd.js +1 -1
  92. package/dist/ko-KR.js +1 -1
  93. package/dist/ko-KR.umd.js +1 -1
  94. package/dist/lt-LT.js +1 -1
  95. package/dist/lt-LT.umd.js +1 -1
  96. package/dist/lv-LV.js +1 -1
  97. package/dist/lv-LV.umd.js +1 -1
  98. package/dist/mr-IN.js +1 -1
  99. package/dist/mr-IN.umd.js +1 -1
  100. package/dist/ms-MY.js +1 -1
  101. package/dist/ms-MY.umd.js +1 -1
  102. package/dist/nb-NO.js +1 -1
  103. package/dist/nb-NO.umd.js +1 -1
  104. package/dist/nl-NL.js +1 -1
  105. package/dist/nl-NL.umd.js +1 -1
  106. package/dist/pa-IN.js +1 -1
  107. package/dist/pa-IN.umd.js +1 -1
  108. package/dist/pl-PL.js +1 -1
  109. package/dist/pl-PL.umd.js +1 -1
  110. package/dist/pt-BR.js +1 -1
  111. package/dist/pt-BR.umd.js +1 -1
  112. package/dist/pt-PT.js +1 -1
  113. package/dist/pt-PT.umd.js +1 -1
  114. package/dist/ro-RO.js +1 -1
  115. package/dist/ro-RO.umd.js +1 -1
  116. package/dist/ru-RU.js +1 -1
  117. package/dist/ru-RU.umd.js +1 -1
  118. package/dist/sr-Cyrl-RS.js +2 -2
  119. package/dist/sr-Cyrl-RS.umd.js +2 -2
  120. package/dist/sr-Latn-RS.js +2 -2
  121. package/dist/sr-Latn-RS.umd.js +2 -2
  122. package/dist/sv-SE.js +1 -1
  123. package/dist/sv-SE.umd.js +1 -1
  124. package/dist/sw-KE.js +1 -1
  125. package/dist/sw-KE.umd.js +1 -1
  126. package/dist/ta-IN.js +1 -1
  127. package/dist/ta-IN.umd.js +1 -1
  128. package/dist/te-IN.js +1 -1
  129. package/dist/te-IN.umd.js +1 -1
  130. package/dist/th-TH.js +1 -1
  131. package/dist/th-TH.umd.js +1 -1
  132. package/dist/tr-TR.js +1 -1
  133. package/dist/tr-TR.umd.js +1 -1
  134. package/dist/uk-UA.js +1 -1
  135. package/dist/uk-UA.umd.js +1 -1
  136. package/dist/ur-PK.js +1 -1
  137. package/dist/ur-PK.umd.js +1 -1
  138. package/dist/vi-VN.js +1 -1
  139. package/dist/vi-VN.umd.js +1 -1
  140. package/dist/yo-NG.js +1 -1
  141. package/dist/yo-NG.umd.js +1 -1
  142. package/dist/zh-Hans-CN.js +1 -1
  143. package/dist/zh-Hans-CN.umd.js +1 -1
  144. package/dist/zh-Hant-TW.js +1 -1
  145. package/dist/zh-Hant-TW.umd.js +1 -1
  146. package/package.json +17 -17
  147. package/src/am-ET.d.ts +19 -6
  148. package/src/am-Latn-ET.d.ts +19 -6
  149. package/src/ar-SA.d.ts +46 -32
  150. package/src/az-AZ.d.ts +17 -6
  151. package/src/bn-BD.d.ts +18 -6
  152. package/src/cs-CZ.d.ts +19 -6
  153. package/src/da-DK.d.ts +19 -6
  154. package/src/de-DE.d.ts +30 -16
  155. package/src/el-GR.d.ts +18 -6
  156. package/src/en-AU.d.ts +27 -16
  157. package/src/en-BD.d.ts +28 -16
  158. package/src/en-CA.d.ts +46 -25
  159. package/src/en-GB.d.ts +28 -16
  160. package/src/en-GH.d.ts +35 -16
  161. package/src/en-IE.d.ts +38 -16
  162. package/src/en-IN.d.ts +28 -16
  163. package/src/en-KE.d.ts +35 -16
  164. package/src/en-MY.d.ts +38 -16
  165. package/src/en-NG.d.ts +38 -16
  166. package/src/en-NZ.d.ts +35 -16
  167. package/src/en-PH.d.ts +35 -16
  168. package/src/en-PK.d.ts +28 -16
  169. package/src/en-SG.d.ts +35 -16
  170. package/src/en-US.d.ts +44 -25
  171. package/src/en-ZA.d.ts +37 -16
  172. package/src/es-ES.d.ts +61 -42
  173. package/src/es-MX.d.ts +61 -42
  174. package/src/es-US.d.ts +61 -42
  175. package/src/fa-IR.d.ts +17 -6
  176. package/src/fi-FI.d.ts +19 -6
  177. package/src/fil-PH.d.ts +18 -6
  178. package/src/fr-BE.d.ts +35 -23
  179. package/src/fr-FR.d.ts +36 -23
  180. package/src/gu-IN.d.ts +19 -6
  181. package/src/ha-NG.d.ts +21 -6
  182. package/src/hbo-IL.d.ts +30 -17
  183. package/src/he-IL.d.ts +24 -11
  184. package/src/hi-IN.d.ts +19 -6
  185. package/src/hr-HR.d.ts +28 -15
  186. package/src/hr-HR.js +8 -6
  187. package/src/hu-HU.d.ts +18 -6
  188. package/src/id-ID.d.ts +18 -6
  189. package/src/it-IT.d.ts +30 -16
  190. package/src/ja-JP.d.ts +18 -6
  191. package/src/ka-GE.d.ts +20 -6
  192. package/src/kn-IN.d.ts +19 -6
  193. package/src/ko-KR.d.ts +18 -6
  194. package/src/lt-LT.d.ts +27 -15
  195. package/src/lv-LV.d.ts +28 -15
  196. package/src/mr-IN.d.ts +19 -6
  197. package/src/ms-MY.d.ts +18 -6
  198. package/src/nb-NO.d.ts +18 -6
  199. package/src/nl-NL.d.ts +42 -27
  200. package/src/pa-IN.d.ts +18 -6
  201. package/src/pl-PL.d.ts +28 -15
  202. package/src/pt-BR.d.ts +34 -21
  203. package/src/pt-PT.d.ts +29 -16
  204. package/src/ro-RO.d.ts +27 -15
  205. package/src/ru-RU.d.ts +38 -26
  206. package/src/sr-Cyrl-RS.d.ts +40 -26
  207. package/src/sr-Cyrl-RS.js +6 -5
  208. package/src/sr-Latn-RS.d.ts +40 -26
  209. package/src/sr-Latn-RS.js +6 -5
  210. package/src/sv-SE.d.ts +19 -6
  211. package/src/sw-KE.d.ts +17 -6
  212. package/src/ta-IN.d.ts +21 -6
  213. package/src/te-IN.d.ts +19 -6
  214. package/src/th-TH.d.ts +19 -6
  215. package/src/tr-TR.d.ts +22 -11
  216. package/src/uk-UA.d.ts +27 -15
  217. package/src/ur-PK.d.ts +18 -6
  218. package/src/utils/check-max.d.ts +1 -1
  219. package/src/utils/expand-scientific.d.ts +3 -3
  220. package/src/utils/is-plain-object.d.ts +1 -1
  221. package/src/utils/parse-cardinal.d.ts +7 -1
  222. package/src/utils/parse-currency.d.ts +6 -1
  223. package/src/utils/parse-ordinal.d.ts +6 -1
  224. package/src/utils/resolve-options.d.ts +1 -1
  225. package/src/utils/scale.d.ts +22 -22
  226. package/src/vi-VN.d.ts +17 -6
  227. package/src/yo-NG.d.ts +24 -6
  228. package/src/zh-Hans-CN.d.ts +46 -34
  229. package/src/zh-Hant-TW.d.ts +50 -34
package/src/lt-LT.d.ts CHANGED
@@ -1,21 +1,32 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
4
1
  /**
5
- * @typedef {object} CardinalOptions
6
- * @property {('masculine'|'feminine')} [gender] - Gender for numbers < 1000
2
+ * Lithuanian (Lithuania) language converter
3
+ *
4
+ * CLDR: lt-LT | Lithuanian as used in Lithuania
5
+ *
6
+ * Key features:
7
+ * - Three-form pluralization (singular/plural/genitive)
8
+ * - Gender agreement (masculine/feminine for numbers < 1000)
9
+ * - Two-form hundreds (šimtas/šimtai)
10
+ * - Long scale naming
7
11
  */
8
- /** @type {Required<CardinalOptions>} */
9
- export const cardinalDefaults: Required<CardinalOptions>;
10
- /** @type {{ gender: ReadonlyArray<Required<CardinalOptions>['gender']> }} */
11
- export const cardinalValues: {
12
- gender: ReadonlyArray<Required<CardinalOptions>["gender"]>;
13
- };
12
+ export declare const cardinalMax: bigint;
13
+ export declare const ordinalMax: bigint;
14
+ export declare const currencyMax: bigint;
14
15
  export type CardinalOptions = {
15
16
  /**
16
17
  * - Gender for numbers < 1000
17
18
  */
18
- gender?: "feminine" | "masculine" | undefined;
19
+ gender?: ('masculine' | 'feminine');
20
+ };
21
+ /**
22
+ * @typedef {object} CardinalOptions
23
+ * @property {('masculine'|'feminine')} [gender] - Gender for numbers < 1000
24
+ */
25
+ /** @type {Required<CardinalOptions>} */
26
+ export declare const cardinalDefaults: Required<CardinalOptions>;
27
+ /** @type {{ gender: ReadonlyArray<Required<CardinalOptions>['gender']> }} */
28
+ export declare const cardinalValues: {
29
+ gender: ReadonlyArray<Required<CardinalOptions>['gender']>;
19
30
  };
20
31
  /**
21
32
  * Converts a numeric value to Lithuanian words.
@@ -29,7 +40,7 @@ export type CardinalOptions = {
29
40
  * toCardinal(1, { gender: 'feminine' }) // 'viena'
30
41
  * toCardinal(1000000) // 'vienas milijonas'
31
42
  */
32
- export function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
43
+ declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
33
44
  /**
34
45
  * Converts a numeric value to Lithuanian ordinal words (masculine nominative).
35
46
  * @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
@@ -43,7 +54,7 @@ export function toCardinal(value: number | string | bigint, options?: CardinalOp
43
54
  * toOrdinal(100) // 'šimtasis'
44
55
  * toOrdinal(1000) // 'tūkstantasis'
45
56
  */
46
- export function toOrdinal(value: number | string | bigint): string;
57
+ declare function toOrdinal(value: number | string | bigint): string;
47
58
  /**
48
59
  * Converts a numeric value to Lithuanian currency words (Euro).
49
60
  * @param {number | string | bigint} value - The currency amount to convert
@@ -56,4 +67,5 @@ export function toOrdinal(value: number | string | bigint): string;
56
67
  * toCurrency(1.50) // 'vienas euras penkiasdešimt centų'
57
68
  * toCurrency(-5) // 'minus penki eurai'
58
69
  */
59
- export function toCurrency(value: number | string | bigint): string;
70
+ declare function toCurrency(value: number | string | bigint): string;
71
+ export { toCardinal, toOrdinal, toCurrency };
package/src/lv-LV.d.ts CHANGED
@@ -1,21 +1,33 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
4
1
  /**
5
- * @typedef {object} CardinalOptions
6
- * @property {('masculine'|'feminine')} [gender] - Gender for numbers < 1000
2
+ * Latvian (Latvia) language converter
3
+ *
4
+ * CLDR: lv-LV | Latvian as used in Latvia
5
+ *
6
+ * Key features:
7
+ * - Two-form pluralization (singular for 1 except 11, plural otherwise)
8
+ * - Gender agreement (masculine/feminine for numbers < 1000)
9
+ * - Special hundreds forms (simts/simti/simtu)
10
+ * - Omit "one" before scale words
11
+ * - Long scale naming
7
12
  */
8
- /** @type {Required<CardinalOptions>} */
9
- export const cardinalDefaults: Required<CardinalOptions>;
10
- /** @type {{ gender: ReadonlyArray<Required<CardinalOptions>['gender']> }} */
11
- export const cardinalValues: {
12
- gender: ReadonlyArray<Required<CardinalOptions>["gender"]>;
13
- };
13
+ export declare const cardinalMax: bigint;
14
+ export declare const ordinalMax: bigint;
15
+ export declare const currencyMax: bigint;
14
16
  export type CardinalOptions = {
15
17
  /**
16
18
  * - Gender for numbers < 1000
17
19
  */
18
- gender?: "feminine" | "masculine" | undefined;
20
+ gender?: ('masculine' | 'feminine');
21
+ };
22
+ /**
23
+ * @typedef {object} CardinalOptions
24
+ * @property {('masculine'|'feminine')} [gender] - Gender for numbers < 1000
25
+ */
26
+ /** @type {Required<CardinalOptions>} */
27
+ export declare const cardinalDefaults: Required<CardinalOptions>;
28
+ /** @type {{ gender: ReadonlyArray<Required<CardinalOptions>['gender']> }} */
29
+ export declare const cardinalValues: {
30
+ gender: ReadonlyArray<Required<CardinalOptions>['gender']>;
19
31
  };
20
32
  /**
21
33
  * Converts a numeric value to Latvian words.
@@ -29,7 +41,7 @@ export type CardinalOptions = {
29
41
  * toCardinal(1, { gender: 'feminine' }) // 'viena'
30
42
  * toCardinal(1000) // 'tūkstotis'
31
43
  */
32
- export function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
44
+ declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
33
45
  /**
34
46
  * Converts a numeric value to Latvian ordinal words (masculine nominative).
35
47
  * @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
@@ -43,7 +55,7 @@ export function toCardinal(value: number | string | bigint, options?: CardinalOp
43
55
  * toOrdinal(100) // 'simtais'
44
56
  * toOrdinal(1000) // 'tūkstošais'
45
57
  */
46
- export function toOrdinal(value: number | string | bigint): string;
58
+ declare function toOrdinal(value: number | string | bigint): string;
47
59
  /**
48
60
  * Converts a numeric value to Latvian currency words (Euro).
49
61
  * @param {number | string | bigint} value - The currency amount to convert
@@ -56,4 +68,5 @@ export function toOrdinal(value: number | string | bigint): string;
56
68
  * toCurrency(1.50) // 'viens eiro piecdesmit centu'
57
69
  * toCurrency(-5) // 'mīnus pieci eiro'
58
70
  */
59
- export function toCurrency(value: number | string | bigint): string;
71
+ declare function toCurrency(value: number | string | bigint): string;
72
+ export { toCardinal, toOrdinal, toCurrency };
package/src/mr-IN.d.ts CHANGED
@@ -1,12 +1,24 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
1
+ /**
2
+ * Marathi (India) language converter
3
+ *
4
+ * CLDR: mr-IN | Marathi as used in India
5
+ *
6
+ * Key features:
7
+ * - Indian numbering system (हजार, लाख, कोटी)
8
+ * - Devanagari script
9
+ * - 3-2-2 grouping pattern (last 3 digits, then groups of 2)
10
+ * - Complete word forms for 0-99
11
+ * - Per-digit decimal reading
12
+ */
13
+ export declare const cardinalMax: bigint;
14
+ export declare const ordinalMax: bigint;
15
+ export declare const currencyMax: bigint;
4
16
  /**
5
17
  * Converts a numeric value to Marathi words.
6
18
  * @param {number | string | bigint} value - The numeric value to convert
7
19
  * @returns {string} The number in Marathi words
8
20
  */
9
- export function toCardinal(value: number | string | bigint): string;
21
+ declare function toCardinal(value: number | string | bigint): string;
10
22
  /**
11
23
  * Converts a numeric value to Marathi ordinal words.
12
24
  * @param {number | string | bigint} value - The numeric value to convert (positive integer)
@@ -19,7 +31,7 @@ export function toCardinal(value: number | string | bigint): string;
19
31
  * toOrdinal(3) // 'तिसरा'
20
32
  * toOrdinal(10) // 'दहावा'
21
33
  */
22
- export function toOrdinal(value: number | string | bigint): string;
34
+ declare function toOrdinal(value: number | string | bigint): string;
23
35
  /**
24
36
  * Converts a numeric value to Marathi currency words (Indian Rupee).
25
37
  * @param {number | string | bigint} value - The currency amount to convert
@@ -31,4 +43,5 @@ export function toOrdinal(value: number | string | bigint): string;
31
43
  * toCurrency(1) // 'एक रुपया'
32
44
  * toCurrency(0.01) // 'एक पैसा'
33
45
  */
34
- export function toCurrency(value: number | string | bigint): string;
46
+ declare function toCurrency(value: number | string | bigint): string;
47
+ export { toCardinal, toOrdinal, toCurrency };
package/src/ms-MY.d.ts CHANGED
@@ -1,12 +1,23 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
1
+ /**
2
+ * Malay (Malaysia) language converter
3
+ *
4
+ * CLDR: ms-MY | Malay (Bahasa Melayu) as used in Malaysia
5
+ *
6
+ * Key features:
7
+ * - "Se-" prefix for ALL singular scale units (seratus, seribu, sejuta, sebilion)
8
+ * - Regular patterns (puluh for tens, ratus for hundreds)
9
+ * - Teens with "belas" suffix
10
+ * - Note: "lapan" (8) differs from Indonesian "delapan"
11
+ */
12
+ export declare const cardinalMax: bigint;
13
+ export declare const ordinalMax: bigint;
14
+ export declare const currencyMax: bigint;
4
15
  /**
5
16
  * Converts a numeric value to Malay words.
6
17
  * @param {number | string | bigint} value - The numeric value to convert
7
18
  * @returns {string} The number in Malay words
8
19
  */
9
- export function toCardinal(value: number | string | bigint): string;
20
+ declare function toCardinal(value: number | string | bigint): string;
10
21
  /**
11
22
  * Converts a numeric value to Malay ordinal words.
12
23
  * @param {number | string | bigint} value - The numeric value to convert (positive integer)
@@ -18,7 +29,7 @@ export function toCardinal(value: number | string | bigint): string;
18
29
  * toOrdinal(2) // 'kedua'
19
30
  * toOrdinal(10) // 'kesepuluh'
20
31
  */
21
- export function toOrdinal(value: number | string | bigint): string;
32
+ declare function toOrdinal(value: number | string | bigint): string;
22
33
  /**
23
34
  * Converts a numeric value to Malay currency words (Ringgit).
24
35
  *
@@ -32,4 +43,5 @@ export function toOrdinal(value: number | string | bigint): string;
32
43
  * toCurrency(1.50) // 'satu ringgit lima puluh sen'
33
44
  * toCurrency(-5) // 'minus lima ringgit'
34
45
  */
35
- export function toCurrency(value: number | string | bigint): string;
46
+ declare function toCurrency(value: number | string | bigint): string;
47
+ export { toCardinal, toOrdinal, toCurrency };
package/src/nb-NO.d.ts CHANGED
@@ -1,6 +1,17 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
1
+ /**
2
+ * Norwegian Bokmål (Norway) language converter
3
+ *
4
+ * CLDR: nb-NO | Norwegian Bokmål as used in Norway
5
+ *
6
+ * Key features:
7
+ * - Hyphenated tens+ones: "tjue-en" (21)
8
+ * - "og" conjunction after hundreds
9
+ * - Comma separator after thousands before hundreds
10
+ * - Short scale: million, milliard, billion, etc.
11
+ */
12
+ export declare const cardinalMax: bigint;
13
+ export declare const ordinalMax: bigint;
14
+ export declare const currencyMax: bigint;
4
15
  /**
5
16
  * Converts a numeric value to Norwegian Bokmål words.
6
17
  * @param {number | string | bigint} value - The numeric value to convert
@@ -12,7 +23,7 @@ export const currencyMax: bigint;
12
23
  * toCardinal(101) // 'en hundre og en'
13
24
  * toCardinal(1000000) // 'en million'
14
25
  */
15
- export function toCardinal(value: number | string | bigint): string;
26
+ declare function toCardinal(value: number | string | bigint): string;
16
27
  /**
17
28
  * Converts a numeric value to Norwegian Bokmål ordinal words.
18
29
  * @param {number | string | bigint} value - The numeric value to convert (positive integer)
@@ -24,7 +35,7 @@ export function toCardinal(value: number | string | bigint): string;
24
35
  * toOrdinal(2) // 'andre'
25
36
  * toOrdinal(21) // 'tjue-ende'
26
37
  */
27
- export function toOrdinal(value: number | string | bigint): string;
38
+ declare function toOrdinal(value: number | string | bigint): string;
28
39
  /**
29
40
  * Converts a numeric value to Norwegian currency words (Norwegian Krone).
30
41
  *
@@ -38,4 +49,5 @@ export function toOrdinal(value: number | string | bigint): string;
38
49
  * toCurrency(42) // 'førti-to kroner'
39
50
  * toCurrency(1.50) // 'en krone og femti øre'
40
51
  */
41
- export function toCurrency(value: number | string | bigint): string;
52
+ declare function toCurrency(value: number | string | bigint): string;
53
+ export { toCardinal, toOrdinal, toCurrency };
package/src/nl-NL.d.ts CHANGED
@@ -1,40 +1,42 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
4
1
  /**
5
- * @typedef {object} CardinalOptions
6
- * @property {boolean} [accentOne] - Use "één" instead of "een"
7
- * @property {boolean} [includeOptionalAnd] - Include "en" before small numbers
8
- * @property {boolean} [noHundredPairing] - Disable hundred pairing (1104→duizend honderdvier)
9
- */
10
- /** @type {Required<CardinalOptions>} */
11
- export const cardinalDefaults: Required<CardinalOptions>;
12
- /**
13
- * @typedef {object} CurrencyOptions
14
- * @property {boolean} [and] - Include "en" between euros and cents
2
+ * Dutch (Netherlands) language converter
3
+ *
4
+ * CLDR: nl-NL | Dutch as used in the Netherlands
5
+ *
6
+ * Dutch-specific rules:
7
+ * - Inverted tens-ones: eenentwintig (one-and-twenty)
8
+ * - "ën" connector when ones ends in 'e' (twee, drie)
9
+ * - Compound words without spaces
10
+ * - Hundred pairing for 1100-9999 (elfhonderd style)
11
+ * - "één" vs "een" (accentOne option)
12
+ * - Optional "en" separator (includeOptionalAnd option)
13
+ * - Long scale with -ard forms
15
14
  */
16
- /** @type {Required<CurrencyOptions>} */
17
- export const currencyDefaults: Required<CurrencyOptions>;
15
+ export declare const cardinalMax: bigint;
16
+ export declare const ordinalMax: bigint;
17
+ export declare const currencyMax: bigint;
18
18
  export type CardinalOptions = {
19
19
  /**
20
20
  * - Use "één" instead of "een"
21
21
  */
22
- accentOne?: boolean | undefined;
22
+ accentOne?: boolean;
23
23
  /**
24
24
  * - Include "en" before small numbers
25
25
  */
26
- includeOptionalAnd?: boolean | undefined;
26
+ includeOptionalAnd?: boolean;
27
27
  /**
28
28
  * - Disable hundred pairing (1104→duizend honderdvier)
29
29
  */
30
- noHundredPairing?: boolean | undefined;
31
- };
32
- export type CurrencyOptions = {
33
- /**
34
- * - Include "en" between euros and cents
35
- */
36
- and?: boolean | undefined;
30
+ noHundredPairing?: boolean;
37
31
  };
32
+ /**
33
+ * @typedef {object} CardinalOptions
34
+ * @property {boolean} [accentOne] - Use "één" instead of "een"
35
+ * @property {boolean} [includeOptionalAnd] - Include "en" before small numbers
36
+ * @property {boolean} [noHundredPairing] - Disable hundred pairing (1104→duizend honderdvier)
37
+ */
38
+ /** @type {Required<CardinalOptions>} */
39
+ export declare const cardinalDefaults: Required<CardinalOptions>;
38
40
  /**
39
41
  * Converts a numeric value to Dutch words.
40
42
  *
@@ -51,7 +53,7 @@ export type CurrencyOptions = {
51
53
  * toCardinal(1, {accentOne: false}) // 'een'
52
54
  * toCardinal(1104) // 'elfhonderd vier'
53
55
  */
54
- export function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
56
+ declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
55
57
  /**
56
58
  * Converts a number to Dutch ordinal words.
57
59
  * @param {number | string | bigint} value - The number to convert
@@ -61,7 +63,19 @@ export function toCardinal(value: number | string | bigint, options?: CardinalOp
61
63
  * toOrdinal(21) // 'eenentwintigste'
62
64
  * toOrdinal(100) // 'honderdste'
63
65
  */
64
- export function toOrdinal(value: number | string | bigint): string;
66
+ declare function toOrdinal(value: number | string | bigint): string;
67
+ export type CurrencyOptions = {
68
+ /**
69
+ * - Include "en" between euros and cents
70
+ */
71
+ and?: boolean;
72
+ };
73
+ /**
74
+ * @typedef {object} CurrencyOptions
75
+ * @property {boolean} [and] - Include "en" between euros and cents
76
+ */
77
+ /** @type {Required<CurrencyOptions>} */
78
+ export declare const currencyDefaults: Required<CurrencyOptions>;
65
79
  /**
66
80
  * Converts a number to Dutch currency words (Euro).
67
81
  * @param {number | string | bigint} value - The amount to convert
@@ -72,4 +86,5 @@ export function toOrdinal(value: number | string | bigint): string;
72
86
  * toCurrency(1) // 'één euro'
73
87
  * toCurrency(0.01) // 'één cent'
74
88
  */
75
- export function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
89
+ declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
90
+ export { toCardinal, toOrdinal, toCurrency };
package/src/pa-IN.d.ts CHANGED
@@ -1,12 +1,23 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
1
+ /**
2
+ * Punjabi (India) language converter
3
+ *
4
+ * CLDR: pa-IN | Punjabi (Gurmukhi) as used in India
5
+ *
6
+ * Key features:
7
+ * - Indian numbering system (ਹਜ਼ਾਰ, ਲੱਖ, ਕਰੋੜ)
8
+ * - Gurmukhi script
9
+ * - 3-2-2 grouping pattern (last 3 digits, then groups of 2)
10
+ * - Complete word forms for 0-99
11
+ */
12
+ export declare const cardinalMax: bigint;
13
+ export declare const ordinalMax: bigint;
14
+ export declare const currencyMax: bigint;
4
15
  /**
5
16
  * Converts a numeric value to Punjabi words.
6
17
  * @param {number | string | bigint} value - The numeric value to convert
7
18
  * @returns {string} The number in Punjabi words
8
19
  */
9
- export function toCardinal(value: number | string | bigint): string;
20
+ declare function toCardinal(value: number | string | bigint): string;
10
21
  /**
11
22
  * Converts a numeric value to Punjabi ordinal words.
12
23
  * @param {number | string | bigint} value - The numeric value to convert (positive integer)
@@ -19,7 +30,7 @@ export function toCardinal(value: number | string | bigint): string;
19
30
  * toOrdinal(3) // 'ਤੀਜਾ'
20
31
  * toOrdinal(10) // 'ਦੱਸਵਾਂ'
21
32
  */
22
- export function toOrdinal(value: number | string | bigint): string;
33
+ declare function toOrdinal(value: number | string | bigint): string;
23
34
  /**
24
35
  * Converts a numeric value to Punjabi currency words (Indian Rupee).
25
36
  * @param {number | string | bigint} value - The currency amount to convert
@@ -31,4 +42,5 @@ export function toOrdinal(value: number | string | bigint): string;
31
42
  * toCurrency(1) // 'ਇੱਕ ਰੁਪਇਆ'
32
43
  * toCurrency(0.01) // 'ਇੱਕ ਪੈਸਾ'
33
44
  */
34
- export function toCurrency(value: number | string | bigint): string;
45
+ declare function toCurrency(value: number | string | bigint): string;
46
+ export { toCardinal, toOrdinal, toCurrency };
package/src/pl-PL.d.ts CHANGED
@@ -1,21 +1,33 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
4
1
  /**
5
- * @typedef {object} CardinalOptions
6
- * @property {('masculine'|'feminine')} [gender] - Gender for numbers < 1000
2
+ * Polish (Poland) language converter
3
+ *
4
+ * CLDR: pl-PL | Polish as used in Poland
5
+ *
6
+ * Polish-specific rules:
7
+ * - Three-form pluralization: 1 = singular, 2-4 = few, 5+ = many
8
+ * - Gender agreement (masculine/feminine for numbers < 1000)
9
+ * - Omit "jeden" before scale words (tysiąc, milion, etc.)
10
+ * - Irregular hundreds: dwieście, trzysta, czterysta, pięćset...
11
+ * - Long scale with -ard forms: miliard, biliard, tryliard
7
12
  */
8
- /** @type {Required<CardinalOptions>} */
9
- export const cardinalDefaults: Required<CardinalOptions>;
10
- /** @type {{ gender: ReadonlyArray<Required<CardinalOptions>['gender']> }} */
11
- export const cardinalValues: {
12
- gender: ReadonlyArray<Required<CardinalOptions>["gender"]>;
13
- };
13
+ export declare const cardinalMax: bigint;
14
+ export declare const ordinalMax: bigint;
15
+ export declare const currencyMax: bigint;
14
16
  export type CardinalOptions = {
15
17
  /**
16
18
  * - Gender for numbers < 1000
17
19
  */
18
- gender?: "feminine" | "masculine" | undefined;
20
+ gender?: ('masculine' | 'feminine');
21
+ };
22
+ /**
23
+ * @typedef {object} CardinalOptions
24
+ * @property {('masculine'|'feminine')} [gender] - Gender for numbers < 1000
25
+ */
26
+ /** @type {Required<CardinalOptions>} */
27
+ export declare const cardinalDefaults: Required<CardinalOptions>;
28
+ /** @type {{ gender: ReadonlyArray<Required<CardinalOptions>['gender']> }} */
29
+ export declare const cardinalValues: {
30
+ gender: ReadonlyArray<Required<CardinalOptions>['gender']>;
19
31
  };
20
32
  /**
21
33
  * Converts a numeric value to Polish words.
@@ -33,7 +45,7 @@ export type CardinalOptions = {
33
45
  * toCardinal(1000) // 'tysiąc'
34
46
  * toCardinal(2000) // 'dwa tysiące'
35
47
  */
36
- export function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
48
+ declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
37
49
  /**
38
50
  * Converts a numeric value to Polish ordinal words (masculine nominative).
39
51
  * @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
@@ -49,7 +61,7 @@ export function toCardinal(value: number | string | bigint, options?: CardinalOp
49
61
  * toOrdinal(100) // 'setny'
50
62
  * toOrdinal(1000) // 'tysięczny'
51
63
  */
52
- export function toOrdinal(value: number | string | bigint): string;
64
+ declare function toOrdinal(value: number | string | bigint): string;
53
65
  /**
54
66
  * Converts a numeric value to Polish currency words (Polish Złoty).
55
67
  * @param {number | string | bigint} value - The currency amount to convert
@@ -62,4 +74,5 @@ export function toOrdinal(value: number | string | bigint): string;
62
74
  * toCurrency(1.50) // 'jeden złoty pięćdziesiąt groszy'
63
75
  * toCurrency(-5) // 'minus pięć złotych'
64
76
  */
65
- export function toCurrency(value: number | string | bigint): string;
77
+ declare function toCurrency(value: number | string | bigint): string;
78
+ export { toCardinal, toOrdinal, toCurrency };
package/src/pt-BR.d.ts CHANGED
@@ -1,35 +1,47 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
4
1
  /**
5
- * @typedef {object} CurrencyOptions
6
- * @property {boolean} [and] - Include "e" between major and minor units
7
- * @property {string} [currency] - Currency code (e.g., 'BRL', 'USD'); empty means auto-detect for pt-BR
2
+ * Portuguese (Brazil) language converter
3
+ *
4
+ * CLDR: pt-BR | Brazilian Portuguese as used in Brazil
5
+ *
6
+ * Portuguese-specific rules:
7
+ * - "e" conjunction between units, tens and hundreds: vinte e um, cento e um
8
+ * - "cem" for exact 100, "cento" for 100+ remainder
9
+ * - Irregular hundreds: duzentos, trezentos, quatrocentos, etc.
10
+ * - Short scale: milhão (10^6), bilhão (10^9), trilhão (10^12)
11
+ * - Omit "um" before "mil"
8
12
  */
9
- /** @type {Required<CurrencyOptions>} */
10
- export const currencyDefaults: Required<CurrencyOptions>;
11
- export type CurrencyOptions = {
12
- /**
13
- * - Include "e" between major and minor units
14
- */
15
- and?: boolean | undefined;
16
- /**
17
- * - Currency code (e.g., 'BRL', 'USD'); empty means auto-detect for pt-BR
18
- */
19
- currency?: string | undefined;
20
- };
13
+ export declare const cardinalMax: bigint;
14
+ export declare const ordinalMax: bigint;
15
+ export declare const currencyMax: bigint;
21
16
  /**
22
17
  * Converts a numeric value to Portuguese words.
23
18
  * @param {number | string | bigint} value - The numeric value to convert
24
19
  * @returns {string} The number in Portuguese words
25
20
  */
26
- export function toCardinal(value: number | string | bigint): string;
21
+ declare function toCardinal(value: number | string | bigint): string;
27
22
  /**
28
23
  * Converts a number to Portuguese ordinal words.
29
24
  * @param {number | string | bigint} value - The number to convert
30
25
  * @returns {string} Portuguese ordinal words
31
26
  */
32
- export function toOrdinal(value: number | string | bigint): string;
27
+ declare function toOrdinal(value: number | string | bigint): string;
28
+ export type CurrencyOptions = {
29
+ /**
30
+ * - Include "e" between major and minor units
31
+ */
32
+ and?: boolean;
33
+ /**
34
+ * - Currency code (e.g., 'BRL', 'USD'); empty means auto-detect for pt-BR
35
+ */
36
+ currency?: string;
37
+ };
38
+ /**
39
+ * @typedef {object} CurrencyOptions
40
+ * @property {boolean} [and] - Include "e" between major and minor units
41
+ * @property {string} [currency] - Currency code (e.g., 'BRL', 'USD'); empty means auto-detect for pt-BR
42
+ */
43
+ /** @type {Required<CurrencyOptions>} */
44
+ export declare const currencyDefaults: Required<CurrencyOptions>;
33
45
  /**
34
46
  * Converts a number to Brazilian Portuguese currency words.
35
47
  * @param {number | string | bigint} value - The amount to convert
@@ -39,4 +51,5 @@ export function toOrdinal(value: number | string | bigint): string;
39
51
  * toCurrency(42.50) // 'quarenta e dois reais e cinquenta centavos'
40
52
  * toCurrency(42.50, {currency: 'USD'}) // 'quarenta e dois dólares e cinquenta centavos'
41
53
  */
42
- export function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
54
+ declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
55
+ export { toCardinal, toOrdinal, toCurrency };
package/src/pt-PT.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- export const cardinalMax: bigint;
2
- export const ordinalMax: bigint;
3
- export const currencyMax: bigint;
4
1
  /**
5
- * @typedef {object} CurrencyOptions
6
- * @property {boolean} [and] - Include "e" between euros and cents
2
+ * Portuguese (Portugal) language converter
3
+ *
4
+ * CLDR: pt-PT | European Portuguese as used in Portugal
5
+ *
6
+ * Portuguese-specific rules:
7
+ * - "e" conjunction everywhere: vinte e um, cento e um, mil e um
8
+ * - "cem" for exact 100, "cento" for 100+ remainder
9
+ * - Irregular hundreds: duzentos, trezentos, quatrocentos, etc.
10
+ * - Long scale: milhão (10^6), mil milhões (10^9), bilião (10^12)
11
+ * - Omit "um" before "mil"
7
12
  */
8
- /** @type {Required<CurrencyOptions>} */
9
- export const currencyDefaults: Required<CurrencyOptions>;
10
- export type CurrencyOptions = {
11
- /**
12
- * - Include "e" between euros and cents
13
- */
14
- and?: boolean | undefined;
15
- };
13
+ export declare const cardinalMax: bigint;
14
+ export declare const ordinalMax: bigint;
15
+ export declare const currencyMax: bigint;
16
16
  /**
17
17
  * Converts a numeric value to Portuguese words.
18
18
  *
@@ -27,7 +27,7 @@ export type CurrencyOptions = {
27
27
  * toCardinal(100) // 'cem'
28
28
  * toCardinal(1000000) // 'um milhão'
29
29
  */
30
- export function toCardinal(value: number | string | bigint): string;
30
+ declare function toCardinal(value: number | string | bigint): string;
31
31
  /**
32
32
  * Converts a number to Portuguese ordinal words.
33
33
  * @param {number | string | bigint} value - The number to convert
@@ -37,7 +37,19 @@ export function toCardinal(value: number | string | bigint): string;
37
37
  * toOrdinal(21) // 'vigésimo primeiro'
38
38
  * toOrdinal(100) // 'centésimo'
39
39
  */
40
- export function toOrdinal(value: number | string | bigint): string;
40
+ declare function toOrdinal(value: number | string | bigint): string;
41
+ export type CurrencyOptions = {
42
+ /**
43
+ * - Include "e" between euros and cents
44
+ */
45
+ and?: boolean;
46
+ };
47
+ /**
48
+ * @typedef {object} CurrencyOptions
49
+ * @property {boolean} [and] - Include "e" between euros and cents
50
+ */
51
+ /** @type {Required<CurrencyOptions>} */
52
+ export declare const currencyDefaults: Required<CurrencyOptions>;
41
53
  /**
42
54
  * Converts a number to Portuguese currency words (Euro).
43
55
  * @param {number | string | bigint} value - The amount to convert
@@ -48,4 +60,5 @@ export function toOrdinal(value: number | string | bigint): string;
48
60
  * toCurrency(1) // 'um euro'
49
61
  * toCurrency(0.01) // 'um cêntimo'
50
62
  */
51
- export function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
63
+ declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
64
+ export { toCardinal, toOrdinal, toCurrency };