reslib 1.0.0
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/README.md +298 -0
- package/build/auth/index.d.ts +2034 -0
- package/build/auth/index.js +5 -0
- package/build/auth/types.d.ts +465 -0
- package/build/auth/types.js +1 -0
- package/build/countries/countries.d.ts +1454 -0
- package/build/countries/countries.js +1 -0
- package/build/countries/index.d.ts +159 -0
- package/build/countries/index.js +5 -0
- package/build/countries/types.d.ts +65 -0
- package/build/countries/types.js +1 -0
- package/build/currency/currencies.d.ts +8 -0
- package/build/currency/currencies.js +1 -0
- package/build/currency/index.d.ts +51 -0
- package/build/currency/index.js +5 -0
- package/build/currency/session.d.ts +23 -0
- package/build/currency/session.js +5 -0
- package/build/currency/types.d.ts +1039 -0
- package/build/currency/types.js +1 -0
- package/build/currency/utils.d.ts +25 -0
- package/build/currency/utils.js +1 -0
- package/build/i18n/index.d.ts +640 -0
- package/build/i18n/index.js +5 -0
- package/build/inputFormatter/index.d.ts +396 -0
- package/build/inputFormatter/index.js +5 -0
- package/build/inputFormatter/types.d.ts +544 -0
- package/build/inputFormatter/types.js +1 -0
- package/build/logger/index.d.ts +235 -0
- package/build/logger/index.js +5 -0
- package/build/observable/index.d.ts +329 -0
- package/build/observable/index.js +1 -0
- package/build/platform/index.d.ts +32 -0
- package/build/platform/index.js +1 -0
- package/build/resources/ResourcePaginationHelper.d.ts +537 -0
- package/build/resources/ResourcePaginationHelper.js +2 -0
- package/build/resources/decorators/create.decorator.d.ts +20 -0
- package/build/resources/decorators/create.decorator.js +1 -0
- package/build/resources/decorators/index.d.ts +41 -0
- package/build/resources/decorators/index.js +1 -0
- package/build/resources/fields/index.d.ts +33 -0
- package/build/resources/fields/index.js +1 -0
- package/build/resources/filters.d.ts +62 -0
- package/build/resources/filters.js +1 -0
- package/build/resources/index.d.ts +854 -0
- package/build/resources/index.js +6 -0
- package/build/resources/types/filters.d.ts +508 -0
- package/build/resources/types/filters.js +1 -0
- package/build/resources/types/index.d.ts +4138 -0
- package/build/resources/types/index.js +1 -0
- package/build/session/index.d.ts +1474 -0
- package/build/session/index.js +1 -0
- package/build/translations/auth.en.d.ts +3 -0
- package/build/translations/auth.en.js +1 -0
- package/build/translations/countries.en.d.ts +6 -0
- package/build/translations/countries.en.js +1 -0
- package/build/translations/currencies.en.d.ts +5 -0
- package/build/translations/currencies.en.js +1 -0
- package/build/translations/date.en.d.ts +19 -0
- package/build/translations/date.en.js +1 -0
- package/build/translations/index.d.ts +1583 -0
- package/build/translations/index.js +5 -0
- package/build/translations/resources.en.d.ts +6 -0
- package/build/translations/resources.en.js +1 -0
- package/build/translations/validator.en.d.ts +104 -0
- package/build/translations/validator.en.js +5 -0
- package/build/types/date.d.ts +44 -0
- package/build/types/date.js +1 -0
- package/build/types/dictionary.d.ts +29 -0
- package/build/types/dictionary.js +1 -0
- package/build/types/i18n.d.ts +121 -0
- package/build/types/i18n.js +1 -0
- package/build/types/index.d.ts +145 -0
- package/build/types/index.js +1 -0
- package/build/utils/areEquals.d.ts +19 -0
- package/build/utils/areEquals.js +1 -0
- package/build/utils/date/dateHelper.d.ts +371 -0
- package/build/utils/date/dateHelper.js +5 -0
- package/build/utils/date/index.d.ts +212 -0
- package/build/utils/date/index.js +5 -0
- package/build/utils/date/isDateObj.d.ts +14 -0
- package/build/utils/date/isDateObj.js +1 -0
- package/build/utils/debounce.d.ts +52 -0
- package/build/utils/debounce.js +1 -0
- package/build/utils/defaultArray.d.ts +18 -0
- package/build/utils/defaultArray.js +1 -0
- package/build/utils/defaultBool.d.ts +14 -0
- package/build/utils/defaultBool.js +1 -0
- package/build/utils/defaultStr.d.ts +17 -0
- package/build/utils/defaultStr.js +1 -0
- package/build/utils/defaultVal.d.ts +18 -0
- package/build/utils/defaultVal.js +1 -0
- package/build/utils/dom/index.d.ts +65 -0
- package/build/utils/dom/index.js +1 -0
- package/build/utils/dom/isDOMElement.d.ts +11 -0
- package/build/utils/dom/isDOMElement.js +1 -0
- package/build/utils/file/index.d.ts +26 -0
- package/build/utils/file/index.js +1 -0
- package/build/utils/global.d.ts +53 -0
- package/build/utils/global.js +1 -0
- package/build/utils/image.d.ts +56 -0
- package/build/utils/image.js +1 -0
- package/build/utils/index.d.ts +39 -0
- package/build/utils/index.js +6 -0
- package/build/utils/interpolate.d.ts +105 -0
- package/build/utils/interpolate.js +1 -0
- package/build/utils/isEmail.d.ts +57 -0
- package/build/utils/isEmail.js +1 -0
- package/build/utils/isEmpty.d.ts +18 -0
- package/build/utils/isEmpty.js +1 -0
- package/build/utils/isNonNullString.d.ts +17 -0
- package/build/utils/isNonNullString.js +1 -0
- package/build/utils/isNullable.d.ts +7 -0
- package/build/utils/isNullable.js +1 -0
- package/build/utils/isNumber.d.ts +36 -0
- package/build/utils/isNumber.js +1 -0
- package/build/utils/isPrimitive.d.ts +16 -0
- package/build/utils/isPrimitive.js +1 -0
- package/build/utils/isPromise.d.ts +14 -0
- package/build/utils/isPromise.js +1 -0
- package/build/utils/isRegex.d.ts +15 -0
- package/build/utils/isRegex.js +1 -0
- package/build/utils/isTime.d.ts +18 -0
- package/build/utils/isTime.js +1 -0
- package/build/utils/json.d.ts +224 -0
- package/build/utils/json.js +1 -0
- package/build/utils/numbers.d.ts +148 -0
- package/build/utils/numbers.js +5 -0
- package/build/utils/object.d.ts +567 -0
- package/build/utils/object.js +1 -0
- package/build/utils/sort.d.ts +67 -0
- package/build/utils/sort.js +1 -0
- package/build/utils/string.d.ts +165 -0
- package/build/utils/string.js +1 -0
- package/build/utils/stringify.d.ts +23 -0
- package/build/utils/stringify.js +1 -0
- package/build/utils/uniqid.d.ts +18 -0
- package/build/utils/uniqid.js +1 -0
- package/build/utils/uri/index.d.ts +333 -0
- package/build/utils/uri/index.js +2 -0
- package/build/validator/index.d.ts +4 -0
- package/build/validator/index.js +6 -0
- package/build/validator/rules/array.d.ts +848 -0
- package/build/validator/rules/array.js +5 -0
- package/build/validator/rules/boolean.d.ts +87 -0
- package/build/validator/rules/boolean.js +5 -0
- package/build/validator/rules/date.d.ts +551 -0
- package/build/validator/rules/date.js +5 -0
- package/build/validator/rules/default.d.ts +367 -0
- package/build/validator/rules/default.js +5 -0
- package/build/validator/rules/enum.d.ts +155 -0
- package/build/validator/rules/enum.js +5 -0
- package/build/validator/rules/file.d.ts +356 -0
- package/build/validator/rules/file.js +5 -0
- package/build/validator/rules/format.d.ts +2825 -0
- package/build/validator/rules/format.js +6 -0
- package/build/validator/rules/index.d.ts +16 -0
- package/build/validator/rules/index.js +6 -0
- package/build/validator/rules/multiRules.d.ts +475 -0
- package/build/validator/rules/multiRules.js +5 -0
- package/build/validator/rules/numeric.d.ts +1135 -0
- package/build/validator/rules/numeric.js +5 -0
- package/build/validator/rules/string.d.ts +504 -0
- package/build/validator/rules/string.js +5 -0
- package/build/validator/rules/target.d.ts +137 -0
- package/build/validator/rules/target.js +5 -0
- package/build/validator/rules/utils.d.ts +1 -0
- package/build/validator/rules/utils.js +1 -0
- package/build/validator/rulesMarkers.d.ts +11 -0
- package/build/validator/rulesMarkers.js +1 -0
- package/build/validator/types.d.ts +2906 -0
- package/build/validator/types.js +1 -0
- package/build/validator/validator.d.ts +3692 -0
- package/build/validator/validator.js +5 -0
- package/lib/cjs/auth.js +1 -0
- package/lib/cjs/countries.js +1 -0
- package/lib/cjs/currency.js +1 -0
- package/lib/cjs/i18n.js +1 -0
- package/lib/cjs/inputFormatter.js +1 -0
- package/lib/cjs/logger.js +1 -0
- package/lib/cjs/observable.js +1 -0
- package/lib/cjs/platform.js +1 -0
- package/lib/cjs/resources.js +1 -0
- package/lib/cjs/session.js +1 -0
- package/lib/cjs/types.js +1 -0
- package/lib/cjs/utils.js +1 -0
- package/lib/cjs/validator.js +1 -0
- package/lib/esm/auth.mjs +1 -0
- package/lib/esm/countries.mjs +1 -0
- package/lib/esm/currency.mjs +1 -0
- package/lib/esm/i18n.mjs +1 -0
- package/lib/esm/inputFormatter.mjs +1 -0
- package/lib/esm/logger.mjs +1 -0
- package/lib/esm/observable.mjs +1 -0
- package/lib/esm/platform.mjs +1 -0
- package/lib/esm/resources.mjs +1 -0
- package/lib/esm/session.mjs +1 -0
- package/lib/esm/types.mjs +1 -0
- package/lib/esm/utils.mjs +1 -0
- package/lib/esm/validator.mjs +1 -0
- package/package.json +244 -0
|
@@ -0,0 +1,1039 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @interface Currency
|
|
3
|
+
*
|
|
4
|
+
* Represents a currency with its associated properties for formatting and display.
|
|
5
|
+
*
|
|
6
|
+
* This type provides essential details about a currency, including its symbol,
|
|
7
|
+
* name, formatting options, and how it should be displayed. It is useful for
|
|
8
|
+
* applications that require currency management, such as financial applications,
|
|
9
|
+
* e-commerce platforms, and accounting software.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Example of a currency object for US Dollar
|
|
13
|
+
* const usd: Currency = {
|
|
14
|
+
* symbol: "$",
|
|
15
|
+
* name: "United States Dollar",
|
|
16
|
+
* symbolNative: "$",
|
|
17
|
+
* decimalDigits: 2,
|
|
18
|
+
* rounding: 2,
|
|
19
|
+
* code: "USD",
|
|
20
|
+
* namePlural: "US dollars",
|
|
21
|
+
* format: "%v %s", // Displays value followed by the symbol
|
|
22
|
+
* decimalSeparator: ".",
|
|
23
|
+
* thousandSeparator: ","
|
|
24
|
+
* };
|
|
25
|
+
*/
|
|
26
|
+
export type Currency = {
|
|
27
|
+
/**
|
|
28
|
+
* The symbol of the currency (e.g., "$", "FCFA").
|
|
29
|
+
*
|
|
30
|
+
* Represents the visual symbol used to denote the currency.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* `$` or `FCFA`
|
|
34
|
+
*/
|
|
35
|
+
symbol?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The full name of the currency (e.g., "Euro", "United States Dollar").
|
|
38
|
+
*
|
|
39
|
+
* Provides the complete name for the currency as it is recognized globally.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* `Euro`
|
|
43
|
+
*/
|
|
44
|
+
name?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The native symbol of the currency (e.g., "€" for Euro).
|
|
47
|
+
*
|
|
48
|
+
* This symbol may differ from the standard currency symbol and is used in
|
|
49
|
+
* the currency's country of origin.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* `€`
|
|
53
|
+
*/
|
|
54
|
+
symbolNative?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The number of decimal places for the currency (e.g., 2 for most currencies, 0 for some).
|
|
57
|
+
*
|
|
58
|
+
* Indicates how many decimal places are used when displaying the currency amount.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* `2`
|
|
62
|
+
*/
|
|
63
|
+
decimalDigits?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The rounding value for the currency (e.g., 2 for rounding to 2 decimal places).
|
|
66
|
+
*
|
|
67
|
+
* Specifies how the currency amounts should be rounded.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* `2`
|
|
71
|
+
*/
|
|
72
|
+
rounding?: number;
|
|
73
|
+
/**
|
|
74
|
+
* The ISO 4217 code for the currency (e.g., "USD" for United States Dollar).
|
|
75
|
+
*
|
|
76
|
+
* This code is used internationally to represent currencies in a standardized format.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* `USD`
|
|
80
|
+
*/
|
|
81
|
+
code?: string;
|
|
82
|
+
/**
|
|
83
|
+
* The plural name of the currency (e.g., "US dollars").
|
|
84
|
+
*
|
|
85
|
+
* Used for indicating the currency when referring to multiple units.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* `US dollars`
|
|
89
|
+
*/
|
|
90
|
+
namePlural?: string;
|
|
91
|
+
/**
|
|
92
|
+
* The display format for the currency (e.g., `%v %s` for "123.45 USD").
|
|
93
|
+
*
|
|
94
|
+
* This optional property defines how the currency value is formatted when displayed.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* `%v %s` // Value followed by symbol
|
|
98
|
+
*/
|
|
99
|
+
format?: string;
|
|
100
|
+
/**
|
|
101
|
+
* The decimal separator for the currency (e.g., "." for most currencies).
|
|
102
|
+
*
|
|
103
|
+
* Specifies the character used to separate the integer part from the fractional part
|
|
104
|
+
* of a currency amount.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* `.`
|
|
108
|
+
*/
|
|
109
|
+
decimalSeparator?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The thousands separator for the currency (e.g., " " for some European currencies).
|
|
112
|
+
*
|
|
113
|
+
* Indicates the character used to group thousands in large numbers for improved readability.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ` `
|
|
117
|
+
*/
|
|
118
|
+
thousandSeparator?: string;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* @interface CurrencyFormatter
|
|
123
|
+
* Dynamically formats a number into a string based on currency properties (like symbol and decimal places)
|
|
124
|
+
* retrieved from a predefined currency object.
|
|
125
|
+
*
|
|
126
|
+
* This function does **not** require passing the currency details manually; instead, it retrieves them
|
|
127
|
+
* automatically based on the dynamically generated formatter (e.g., `formatUSD`).
|
|
128
|
+
*
|
|
129
|
+
* @param decimalDigits - (Optional) The number of decimal digits to include. If not provided, the function will default to the currency's predefined decimal digits.
|
|
130
|
+
* @param thousandSeparator - (Optional) The character used as a thousand separator. If not provided, defaults to ','.
|
|
131
|
+
* @param decimalSeparator - (Optional) The character used as a decimal separator. If not provided, defaults to '.'.
|
|
132
|
+
* @param format - (Optional) A format string where `%s` is replaced with the currency symbol and `%v` with the formatted value. If not provided, defaults to the currency's format.
|
|
133
|
+
*
|
|
134
|
+
* @returns The formatted string representation of the number based on the currency settings.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* // Formatting in US dollars, pulling currency data from the internal USD object:
|
|
138
|
+
* const formattedUSD = (123456.789).formatUSD();
|
|
139
|
+
* // Result: "$123,456.79"
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* // Formatting in Canadian dollars with a custom separator and decimal places:
|
|
143
|
+
* const formattedCAD = (123456.789).formatCAD(3, '.', ',');
|
|
144
|
+
* // Result: "CA$123.456,789"
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* // Custom format using Euro currency (retrieved from EUR object):
|
|
148
|
+
* const formattedEUR = (123456.789).formatEUR(2, ' ', ',', '%v %s');
|
|
149
|
+
* // Result: "123 456,79 €"
|
|
150
|
+
* @description
|
|
151
|
+
* How the Dynamic Formatter Works
|
|
152
|
+
* In this story, imagine you're setting up a formatter for currencies, but you don't need to pass the currency details every time. The function, let's say formatUSD, magically knows how US dollars should be formatted because it retrieves the currency details (like symbol, decimal digits, and format) from an internal object that has already defined them.
|
|
153
|
+
* You, the developer, simply call the formatter like this:
|
|
154
|
+
* ```ts
|
|
155
|
+
* const formattedUSD = (123456.789).formatUSD();
|
|
156
|
+
console.log(formattedUSD); // "$123,456.79"
|
|
157
|
+
// Assuming `formatUSD` and `formatEUR` are dynamically created functions based on a currency object
|
|
158
|
+
|
|
159
|
+
// Basic usage with USD defaults
|
|
160
|
+
const result1 = formatUSD(123456.789);
|
|
161
|
+
console.log(result1); // Output: "$123,456.79"
|
|
162
|
+
|
|
163
|
+
// Custom decimal digits and separators for USD
|
|
164
|
+
const result2 = formatUSD(123456.789, 3, '.', ',');
|
|
165
|
+
console.log(result2); // Output: "$123.456,789"
|
|
166
|
+
|
|
167
|
+
// Using a custom format string for EUR
|
|
168
|
+
const result3 = formatEUR(123456.789, 2, ',', '.', '%v %s');
|
|
169
|
+
console.log(result3); // Output: "123,456.79 €"
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export type CurrencyFormatter = (decimalDigits?: number, thousandSeparator?: string, decimalSeparator?: string, format?: string) => string;
|
|
173
|
+
/**
|
|
174
|
+
*
|
|
175
|
+
* @interface
|
|
176
|
+
* A string template type representing the dynamic formatter function names.
|
|
177
|
+
*
|
|
178
|
+
* This type constructs the keys for the formatter functions by combining the `format` prefix
|
|
179
|
+
* with the currency codes from the `currencies` object (e.g., `formatUSD`, `formatCAD`).
|
|
180
|
+
*
|
|
181
|
+
* The currency codes are derived dynamically from the keys of the `currencies` object, ensuring
|
|
182
|
+
* that the formatters correspond to the available currencies.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* // If `currencies` contains { USD, CAD, EUR }, the keys will be:
|
|
186
|
+
* // 'formatUSD', 'formatCAD', 'formatEUR'
|
|
187
|
+
*/
|
|
188
|
+
export type CurrencyFormatName = `format${CurrencyCode}`;
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
* Represents a string template type for dynamically generating keys for abbreviated currency formatters.
|
|
192
|
+
*
|
|
193
|
+
* The `CurrencyAbbreviateFormatName` type constructs keys by combining the `abreviate2Format` prefix
|
|
194
|
+
* with the keys of the `Currencies` interface. This allows for the creation of dynamic formatter keys
|
|
195
|
+
* specific to each currency.
|
|
196
|
+
*
|
|
197
|
+
* @template CurrencyCode - The keys of the `Currencies` interface, representing ISO currency codes.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* // Assuming the `Currencies` interface contains the following keys:
|
|
202
|
+
* // { USD, CAD, EUR }
|
|
203
|
+
*
|
|
204
|
+
* type AbbreviatedFormatKeys = CurrencyAbbreviateFormatName;
|
|
205
|
+
*
|
|
206
|
+
* // The resulting type will include:
|
|
207
|
+
* // 'abreviate2FormatUSD', 'abreviate2FormatCAD', 'abreviate2FormatEUR'
|
|
208
|
+
*
|
|
209
|
+
* const formatKey: CurrencyAbbreviateFormatName = "abreviate2FormatUSD";
|
|
210
|
+
* console.log(formatKey); // Output: "abreviate2FormatUSD"
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @remarks
|
|
214
|
+
* - This type is useful for defining dynamic keys for currency-specific formatting functions.
|
|
215
|
+
* - It ensures that the keys are consistent with the currencies defined in the `Currencies` interface.
|
|
216
|
+
*
|
|
217
|
+
* @see {@link Currencies} for the structure of the currencies interface.
|
|
218
|
+
* @see {@link CurrencyFormatName} for a similar type used for general currency formatters.
|
|
219
|
+
*/
|
|
220
|
+
export type CurrencyAbbreviateFormatName = `abreviate2Format${CurrencyCode}`;
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
* Represents a collection of dynamically generated currency formatter functions.
|
|
224
|
+
*
|
|
225
|
+
* Each key is a string formed by combining the `format` prefix with a currency code
|
|
226
|
+
* (e.g., `formatUSD`, `formatCAD`), and the value is a function that formats numbers
|
|
227
|
+
* according to the respective currency's settings (e.g., symbol, decimal digits).
|
|
228
|
+
*
|
|
229
|
+
* The formatters automatically retrieve currency properties (like symbols, decimal places, etc.)
|
|
230
|
+
* from the `currencies` object.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* // Assuming the `currencies` object contains USD and CAD:
|
|
234
|
+
* const formatters: CurrencyFormatters = {
|
|
235
|
+
* formatUSD: (value) => `$${value.toFixed(2)}`,
|
|
236
|
+
* formatCAD: (value) => `CA$${value.toFixed(2)}`,
|
|
237
|
+
*
|
|
238
|
+
* };
|
|
239
|
+
*
|
|
240
|
+
* // Usage of the dynamically generated formatters:
|
|
241
|
+
* const formattedUSD = formatters.formatUSD(123456.789);
|
|
242
|
+
* console.log(formattedUSD); // Output: "$123,456.79"
|
|
243
|
+
*
|
|
244
|
+
* const formattedCAD = formatters.formatCAD(123456.789);
|
|
245
|
+
* console.log(formattedCAD); // Output: "CA$123,456.79"
|
|
246
|
+
*/
|
|
247
|
+
export type CurrencyFormatters = Record<CurrencyFormatName | CurrencyAbbreviateFormatName, CurrencyFormatter>;
|
|
248
|
+
/**
|
|
249
|
+
* @interface Currencies
|
|
250
|
+
* Represents a collection of currencies, with each currency identified by its ISO code.
|
|
251
|
+
* Each currency is associated with the `Currency` interface, which defines its attributes such as symbol, name, and formatting options.
|
|
252
|
+
* This interface allows for easy management of various currencies by providing a
|
|
253
|
+
* centralized structure. Each currency is identified by its ISO 4217 code, and
|
|
254
|
+
* contains detailed information such as symbol, name, and formatting options.
|
|
255
|
+
* This is particularly useful in applications dealing with multiple currencies,
|
|
256
|
+
* such as e-commerce platforms, financial applications, and accounting software.
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* // Example of an Currencies object containing multiple currencies
|
|
260
|
+
* const currencies: Currencies = {
|
|
261
|
+
* USD: {
|
|
262
|
+
* symbol: "$",
|
|
263
|
+
* name: "United States Dollar",
|
|
264
|
+
* symbolNative: "$",
|
|
265
|
+
* decimalDigits: 2,
|
|
266
|
+
* rounding: 2,
|
|
267
|
+
* code: "USD",
|
|
268
|
+
* namePlural: "US dollars",
|
|
269
|
+
* format: "%v %s",
|
|
270
|
+
* decimalSeparator: ".",
|
|
271
|
+
* thousandSeparator: ","
|
|
272
|
+
* },
|
|
273
|
+
* CAD: {
|
|
274
|
+
* symbol: "CA$",
|
|
275
|
+
* name: "Canadian Dollar",
|
|
276
|
+
* symbolNative: "$",
|
|
277
|
+
* decimalDigits: 2,
|
|
278
|
+
* rounding: 2,
|
|
279
|
+
* code: "CAD",
|
|
280
|
+
* namePlural: "Canadian dollars",
|
|
281
|
+
* format: "%s %v",
|
|
282
|
+
* decimalSeparator: ".",
|
|
283
|
+
* thousandSeparator: ","
|
|
284
|
+
* },
|
|
285
|
+
* EUR: {
|
|
286
|
+
* symbol: "€",
|
|
287
|
+
* name: "Euro",
|
|
288
|
+
* symbolNative: "€",
|
|
289
|
+
* decimalDigits: 2,
|
|
290
|
+
* rounding: 0,
|
|
291
|
+
* code: "EUR",
|
|
292
|
+
* namePlural: "euros",
|
|
293
|
+
* format: "%s %v",
|
|
294
|
+
* decimalSeparator: ",",
|
|
295
|
+
* thousandSeparator: "."
|
|
296
|
+
* },
|
|
297
|
+
* // ... additional currencies
|
|
298
|
+
* };
|
|
299
|
+
*/
|
|
300
|
+
export interface Currencies {
|
|
301
|
+
/**
|
|
302
|
+
* The United States Dollar (USD).
|
|
303
|
+
*
|
|
304
|
+
* @type {Currency}
|
|
305
|
+
*/
|
|
306
|
+
USD: Currency;
|
|
307
|
+
/**
|
|
308
|
+
* The Canadian Dollar (CAD).
|
|
309
|
+
*
|
|
310
|
+
* @type {Currency}
|
|
311
|
+
*/
|
|
312
|
+
CAD: Currency;
|
|
313
|
+
/**
|
|
314
|
+
* The Euro (EUR).
|
|
315
|
+
*
|
|
316
|
+
* @type {Currency}
|
|
317
|
+
*/
|
|
318
|
+
EUR: Currency;
|
|
319
|
+
/**
|
|
320
|
+
* The United Arab Emirates Dirham (AED).
|
|
321
|
+
*
|
|
322
|
+
* @type {Currency}
|
|
323
|
+
*/
|
|
324
|
+
AED: Currency;
|
|
325
|
+
/**
|
|
326
|
+
* The Afghan Afghani (AFN).
|
|
327
|
+
*
|
|
328
|
+
* @type {Currency}
|
|
329
|
+
*/
|
|
330
|
+
AFN: Currency;
|
|
331
|
+
/**
|
|
332
|
+
* The Albanian Lek (ALL).
|
|
333
|
+
*
|
|
334
|
+
* @type {Currency}
|
|
335
|
+
*/
|
|
336
|
+
ALL: Currency;
|
|
337
|
+
/**
|
|
338
|
+
* The Armenian Dram (AMD).
|
|
339
|
+
*
|
|
340
|
+
* @type {Currency}
|
|
341
|
+
*/
|
|
342
|
+
AMD: Currency;
|
|
343
|
+
/**
|
|
344
|
+
* The Argentine Peso (ARS).
|
|
345
|
+
*
|
|
346
|
+
* @type {Currency}
|
|
347
|
+
*/
|
|
348
|
+
ARS: Currency;
|
|
349
|
+
/**
|
|
350
|
+
* The Australian Dollar (AUD).
|
|
351
|
+
*
|
|
352
|
+
* @type {Currency}
|
|
353
|
+
*/
|
|
354
|
+
AUD: Currency;
|
|
355
|
+
/**
|
|
356
|
+
* The Azerbaijani Manat (AZN).
|
|
357
|
+
*
|
|
358
|
+
* @type {Currency}
|
|
359
|
+
*/
|
|
360
|
+
AZN: Currency;
|
|
361
|
+
/**
|
|
362
|
+
* The Bosnia and Herzegovina Convertible Mark (BAM).
|
|
363
|
+
*
|
|
364
|
+
* @type {Currency}
|
|
365
|
+
*/
|
|
366
|
+
BAM: Currency;
|
|
367
|
+
/**
|
|
368
|
+
* The Bangladeshi Taka (BDT).
|
|
369
|
+
*
|
|
370
|
+
* @type {Currency}
|
|
371
|
+
*/
|
|
372
|
+
BDT: Currency;
|
|
373
|
+
/**
|
|
374
|
+
* The Bulgarian Lev (BGN).
|
|
375
|
+
*
|
|
376
|
+
* @type {Currency}
|
|
377
|
+
*/
|
|
378
|
+
BGN: Currency;
|
|
379
|
+
/**
|
|
380
|
+
* The Bahraini Dinar (BHD).
|
|
381
|
+
*
|
|
382
|
+
* @type {Currency}
|
|
383
|
+
*/
|
|
384
|
+
BHD: Currency;
|
|
385
|
+
/**
|
|
386
|
+
* The Burundian Franc (BIF).
|
|
387
|
+
*
|
|
388
|
+
* @type {Currency}
|
|
389
|
+
*/
|
|
390
|
+
BIF: Currency;
|
|
391
|
+
/**
|
|
392
|
+
* The Brunei Dollar (BND).
|
|
393
|
+
*
|
|
394
|
+
* @type {Currency}
|
|
395
|
+
*/
|
|
396
|
+
BND: Currency;
|
|
397
|
+
/**
|
|
398
|
+
* The Bolivian Boliviano (BOB).
|
|
399
|
+
*
|
|
400
|
+
* @type {Currency}
|
|
401
|
+
*/
|
|
402
|
+
BOB: Currency;
|
|
403
|
+
/**
|
|
404
|
+
* The Brazilian Real (BRL).
|
|
405
|
+
*
|
|
406
|
+
* @type {Currency}
|
|
407
|
+
*/
|
|
408
|
+
BRL: Currency;
|
|
409
|
+
/**
|
|
410
|
+
* The Botswana Pula (BWP).
|
|
411
|
+
*
|
|
412
|
+
* @type {Currency}
|
|
413
|
+
*/
|
|
414
|
+
BWP: Currency;
|
|
415
|
+
/**
|
|
416
|
+
* The Belarusian Ruble (BYR).
|
|
417
|
+
*
|
|
418
|
+
* @type {Currency}
|
|
419
|
+
*/
|
|
420
|
+
BYR: Currency;
|
|
421
|
+
/**
|
|
422
|
+
* The Belize Dollar (BZD).
|
|
423
|
+
*
|
|
424
|
+
* @type {Currency}
|
|
425
|
+
*/
|
|
426
|
+
BZD: Currency;
|
|
427
|
+
/**
|
|
428
|
+
* The Congolese Franc (CDF).
|
|
429
|
+
*
|
|
430
|
+
* @type {Currency}
|
|
431
|
+
*/
|
|
432
|
+
CDF: Currency;
|
|
433
|
+
/**
|
|
434
|
+
* The Swiss Franc (CHF).
|
|
435
|
+
*
|
|
436
|
+
* @type {Currency}
|
|
437
|
+
*/
|
|
438
|
+
CHF: Currency;
|
|
439
|
+
/**
|
|
440
|
+
* The Chilean Peso (CLP).
|
|
441
|
+
*
|
|
442
|
+
* @type {Currency}
|
|
443
|
+
*/
|
|
444
|
+
CLP: Currency;
|
|
445
|
+
/**
|
|
446
|
+
* The Chinese Yuan Renminbi (CNY).
|
|
447
|
+
*
|
|
448
|
+
* @type {Currency}
|
|
449
|
+
*/
|
|
450
|
+
CNY: Currency;
|
|
451
|
+
/**
|
|
452
|
+
* The Colombian Peso (COP).
|
|
453
|
+
*
|
|
454
|
+
* @type {Currency}
|
|
455
|
+
*/
|
|
456
|
+
COP: Currency;
|
|
457
|
+
/**
|
|
458
|
+
* The Costa Rican Colón (CRC).
|
|
459
|
+
*
|
|
460
|
+
* @type {Currency}
|
|
461
|
+
*/
|
|
462
|
+
CRC: Currency;
|
|
463
|
+
/**
|
|
464
|
+
* The Cape Verdean Escudo (CVE).
|
|
465
|
+
*
|
|
466
|
+
* @type {Currency}
|
|
467
|
+
*/
|
|
468
|
+
CVE: Currency;
|
|
469
|
+
/**
|
|
470
|
+
* The Czech Koruna (CZK).
|
|
471
|
+
*
|
|
472
|
+
* @type {Currency}
|
|
473
|
+
*/
|
|
474
|
+
CZK: Currency;
|
|
475
|
+
/**
|
|
476
|
+
* The Djiboutian Franc (DJF).
|
|
477
|
+
*
|
|
478
|
+
* @type {Currency}
|
|
479
|
+
*/
|
|
480
|
+
DJF: Currency;
|
|
481
|
+
/**
|
|
482
|
+
* The Danish Krone (DKK).
|
|
483
|
+
*
|
|
484
|
+
* @type {Currency}
|
|
485
|
+
*/
|
|
486
|
+
DKK: Currency;
|
|
487
|
+
/**
|
|
488
|
+
* The Dominican Peso (DOP).
|
|
489
|
+
*
|
|
490
|
+
* @type {Currency}
|
|
491
|
+
*/
|
|
492
|
+
DOP: Currency;
|
|
493
|
+
/**
|
|
494
|
+
* The Algerian Dinar (DZD).
|
|
495
|
+
*
|
|
496
|
+
* @type {Currency}
|
|
497
|
+
*/
|
|
498
|
+
DZD: Currency;
|
|
499
|
+
/**
|
|
500
|
+
* The Estonian Kroon (EEK).
|
|
501
|
+
*
|
|
502
|
+
* @type {Currency}
|
|
503
|
+
*/
|
|
504
|
+
EEK: Currency;
|
|
505
|
+
/**
|
|
506
|
+
* The Egyptian Pound (EGP).
|
|
507
|
+
*
|
|
508
|
+
* @type {Currency}
|
|
509
|
+
*/
|
|
510
|
+
EGP: Currency;
|
|
511
|
+
/**
|
|
512
|
+
* The Eritrean Nakfa (ERN).
|
|
513
|
+
*
|
|
514
|
+
* @type {Currency}
|
|
515
|
+
*/
|
|
516
|
+
ERN: Currency;
|
|
517
|
+
/**
|
|
518
|
+
* The Ethiopian Birr (ETB).
|
|
519
|
+
*
|
|
520
|
+
* @type {Currency}
|
|
521
|
+
*/
|
|
522
|
+
ETB: Currency;
|
|
523
|
+
/**
|
|
524
|
+
* The British Pound Sterling (GBP).
|
|
525
|
+
*
|
|
526
|
+
* @type {Currency}
|
|
527
|
+
*/
|
|
528
|
+
GBP: Currency;
|
|
529
|
+
/**
|
|
530
|
+
* The Georgian Lari (GEL).
|
|
531
|
+
*
|
|
532
|
+
* @type {Currency}
|
|
533
|
+
*/
|
|
534
|
+
GEL: Currency;
|
|
535
|
+
/**
|
|
536
|
+
* The Ghanaian Cedi (GHS).
|
|
537
|
+
*
|
|
538
|
+
* @type {Currency}
|
|
539
|
+
*/
|
|
540
|
+
GHS: Currency;
|
|
541
|
+
/**
|
|
542
|
+
* The Guinean Franc (GNF).
|
|
543
|
+
*
|
|
544
|
+
* @type {Currency}
|
|
545
|
+
*/
|
|
546
|
+
GNF: Currency;
|
|
547
|
+
/**
|
|
548
|
+
* The Guatemalan Quetzal (GTQ).
|
|
549
|
+
*
|
|
550
|
+
* @type {Currency}
|
|
551
|
+
*/
|
|
552
|
+
GTQ: Currency;
|
|
553
|
+
/**
|
|
554
|
+
* The Hong Kong Dollar (HKD).
|
|
555
|
+
*
|
|
556
|
+
* @type {Currency}
|
|
557
|
+
*/
|
|
558
|
+
HKD: Currency;
|
|
559
|
+
/**
|
|
560
|
+
* The Honduran Lempira (HNL).
|
|
561
|
+
*
|
|
562
|
+
* @type {Currency}
|
|
563
|
+
*/
|
|
564
|
+
HNL: Currency;
|
|
565
|
+
/**
|
|
566
|
+
* The Croatian Kuna (HRK).
|
|
567
|
+
*
|
|
568
|
+
* @type {Currency}
|
|
569
|
+
*/
|
|
570
|
+
HRK: Currency;
|
|
571
|
+
/**
|
|
572
|
+
* The Hungarian Forint (HUF).
|
|
573
|
+
*
|
|
574
|
+
* @type {Currency}
|
|
575
|
+
*/
|
|
576
|
+
HUF: Currency;
|
|
577
|
+
/**
|
|
578
|
+
* The Indonesian Rupiah (IDR).
|
|
579
|
+
*
|
|
580
|
+
* @type {Currency}
|
|
581
|
+
*/
|
|
582
|
+
IDR: Currency;
|
|
583
|
+
/**
|
|
584
|
+
* The Israeli New Shekel (ILS).
|
|
585
|
+
*
|
|
586
|
+
* @type {Currency}
|
|
587
|
+
*/
|
|
588
|
+
ILS: Currency;
|
|
589
|
+
/**
|
|
590
|
+
* The Indian Rupee (INR).
|
|
591
|
+
*
|
|
592
|
+
* @type {Currency}
|
|
593
|
+
*/
|
|
594
|
+
INR: Currency;
|
|
595
|
+
/**
|
|
596
|
+
* The Iraqi Dinar (IQD).
|
|
597
|
+
*
|
|
598
|
+
* @type {Currency}
|
|
599
|
+
*/
|
|
600
|
+
IQD: Currency;
|
|
601
|
+
/**
|
|
602
|
+
* The Iranian Rial (IRR).
|
|
603
|
+
*
|
|
604
|
+
* @type {Currency}
|
|
605
|
+
*/
|
|
606
|
+
IRR: Currency;
|
|
607
|
+
/**
|
|
608
|
+
* The Icelandic Króna (ISK).
|
|
609
|
+
*
|
|
610
|
+
* @type {Currency}
|
|
611
|
+
*/
|
|
612
|
+
ISK: Currency;
|
|
613
|
+
/**
|
|
614
|
+
* The Jamaican Dollar (JMD).
|
|
615
|
+
*
|
|
616
|
+
* @type {Currency}
|
|
617
|
+
*/
|
|
618
|
+
JMD: Currency;
|
|
619
|
+
/**
|
|
620
|
+
* The Jordanian Dinar (JOD).
|
|
621
|
+
*
|
|
622
|
+
* @type {Currency}
|
|
623
|
+
*/
|
|
624
|
+
JOD: Currency;
|
|
625
|
+
/**
|
|
626
|
+
* The Japanese Yen (JPY).
|
|
627
|
+
*
|
|
628
|
+
* @type {Currency}
|
|
629
|
+
*/
|
|
630
|
+
JPY: Currency;
|
|
631
|
+
/**
|
|
632
|
+
* The Kenyan Shilling (KES).
|
|
633
|
+
*
|
|
634
|
+
* @type {Currency}
|
|
635
|
+
*/
|
|
636
|
+
KES: Currency;
|
|
637
|
+
/**
|
|
638
|
+
* The Cambodian Riel (KHR).
|
|
639
|
+
*
|
|
640
|
+
* @type {Currency}
|
|
641
|
+
*/
|
|
642
|
+
KHR: Currency;
|
|
643
|
+
/**
|
|
644
|
+
* The Comorian Franc (KMF).
|
|
645
|
+
*
|
|
646
|
+
* @type {Currency}
|
|
647
|
+
*/
|
|
648
|
+
KMF: Currency;
|
|
649
|
+
/**
|
|
650
|
+
* The South Korean Won (KRW).
|
|
651
|
+
*
|
|
652
|
+
* @type {Currency}
|
|
653
|
+
*/
|
|
654
|
+
KRW: Currency;
|
|
655
|
+
/**
|
|
656
|
+
* The Kuwaiti Dinar (KWD).
|
|
657
|
+
*
|
|
658
|
+
* @type {Currency}
|
|
659
|
+
*/
|
|
660
|
+
KWD: Currency;
|
|
661
|
+
/**
|
|
662
|
+
* The Kazakhstani Tenge (KZT).
|
|
663
|
+
*
|
|
664
|
+
* @type {Currency}
|
|
665
|
+
*/
|
|
666
|
+
KZT: Currency;
|
|
667
|
+
/**
|
|
668
|
+
* The Lebanese Pound (LBP).
|
|
669
|
+
*
|
|
670
|
+
* @type {Currency}
|
|
671
|
+
*/
|
|
672
|
+
LBP: Currency;
|
|
673
|
+
/**
|
|
674
|
+
* The Sri Lankan Rupee (LKR).
|
|
675
|
+
*
|
|
676
|
+
* @type {Currency}
|
|
677
|
+
*/
|
|
678
|
+
LKR: Currency;
|
|
679
|
+
/**
|
|
680
|
+
* The Lithuanian Litas (LTL).
|
|
681
|
+
*
|
|
682
|
+
* @type {Currency}
|
|
683
|
+
*/
|
|
684
|
+
LTL: Currency;
|
|
685
|
+
/**
|
|
686
|
+
* The Latvian Lats (LVL).
|
|
687
|
+
*
|
|
688
|
+
* @type {Currency}
|
|
689
|
+
*/
|
|
690
|
+
LVL: Currency;
|
|
691
|
+
/**
|
|
692
|
+
* The Libyan Dinar (LYD).
|
|
693
|
+
*
|
|
694
|
+
* @type {Currency}
|
|
695
|
+
*/
|
|
696
|
+
LYD: Currency;
|
|
697
|
+
/**
|
|
698
|
+
* The Moroccan Dirham (MAD).
|
|
699
|
+
*
|
|
700
|
+
* @type {Currency}
|
|
701
|
+
*/
|
|
702
|
+
MAD: Currency;
|
|
703
|
+
/**
|
|
704
|
+
* The Moldovan Leu (MDL).
|
|
705
|
+
*
|
|
706
|
+
* @type {Currency}
|
|
707
|
+
*/
|
|
708
|
+
MDL: Currency;
|
|
709
|
+
/**
|
|
710
|
+
* The Malagasy Ariary (MGA).
|
|
711
|
+
*
|
|
712
|
+
* @type {Currency}
|
|
713
|
+
*/
|
|
714
|
+
MGA: Currency;
|
|
715
|
+
/**
|
|
716
|
+
* The Macedonian Denar (MKD).
|
|
717
|
+
*
|
|
718
|
+
* @type {Currency}
|
|
719
|
+
*/
|
|
720
|
+
MKD: Currency;
|
|
721
|
+
/**
|
|
722
|
+
* The Myanmar Kyat (MMK).
|
|
723
|
+
*
|
|
724
|
+
* @type {Currency}
|
|
725
|
+
*/
|
|
726
|
+
MMK: Currency;
|
|
727
|
+
/**
|
|
728
|
+
* The Macanese Pataca (MOP).
|
|
729
|
+
*
|
|
730
|
+
* @type {Currency}
|
|
731
|
+
*/
|
|
732
|
+
MOP: Currency;
|
|
733
|
+
/**
|
|
734
|
+
* The Mauritian Rupee (MUR).
|
|
735
|
+
*
|
|
736
|
+
* @type {Currency}
|
|
737
|
+
*/
|
|
738
|
+
MUR: Currency;
|
|
739
|
+
/**
|
|
740
|
+
* The Mexican Peso (MXN).
|
|
741
|
+
*
|
|
742
|
+
* @type {Currency}
|
|
743
|
+
*/
|
|
744
|
+
MXN: Currency;
|
|
745
|
+
/**
|
|
746
|
+
* The Malaysian Ringgit (MYR).
|
|
747
|
+
*
|
|
748
|
+
* @type {Currency}
|
|
749
|
+
*/
|
|
750
|
+
MYR: Currency;
|
|
751
|
+
/**
|
|
752
|
+
* The Mozambican Metical (MZN).
|
|
753
|
+
*
|
|
754
|
+
* @type {Currency}
|
|
755
|
+
*/
|
|
756
|
+
MZN: Currency;
|
|
757
|
+
/**
|
|
758
|
+
* The Namibian Dollar (NAD).
|
|
759
|
+
*
|
|
760
|
+
* @type {Currency}
|
|
761
|
+
*/
|
|
762
|
+
NAD: Currency;
|
|
763
|
+
/**
|
|
764
|
+
* The Nigerian Naira (NGN).
|
|
765
|
+
*
|
|
766
|
+
* @type {Currency}
|
|
767
|
+
*/
|
|
768
|
+
NGN: Currency;
|
|
769
|
+
/**
|
|
770
|
+
* The Nicaraguan Córdoba (NIO).
|
|
771
|
+
*
|
|
772
|
+
* @type {Currency}
|
|
773
|
+
*/
|
|
774
|
+
NIO: Currency;
|
|
775
|
+
/**
|
|
776
|
+
* The Norwegian Krone (NOK).
|
|
777
|
+
*
|
|
778
|
+
* @type {Currency}
|
|
779
|
+
*/
|
|
780
|
+
NOK: Currency;
|
|
781
|
+
/**
|
|
782
|
+
* The Nepalese Rupee (NPR).
|
|
783
|
+
*
|
|
784
|
+
* @type {Currency}
|
|
785
|
+
*/
|
|
786
|
+
NPR: Currency;
|
|
787
|
+
/**
|
|
788
|
+
* The New Zealand Dollar (NZD).
|
|
789
|
+
*
|
|
790
|
+
* @type {Currency}
|
|
791
|
+
*/
|
|
792
|
+
NZD: Currency;
|
|
793
|
+
/**
|
|
794
|
+
* The Omani Rial (OMR).
|
|
795
|
+
*
|
|
796
|
+
* @type {Currency}
|
|
797
|
+
*/
|
|
798
|
+
OMR: Currency;
|
|
799
|
+
/**
|
|
800
|
+
* The Panamanian Balboa (PAB).
|
|
801
|
+
*
|
|
802
|
+
* @type {Currency}
|
|
803
|
+
*/
|
|
804
|
+
PAB: Currency;
|
|
805
|
+
/**
|
|
806
|
+
* The Peruvian Sol (PEN).
|
|
807
|
+
*
|
|
808
|
+
* @type {Currency}
|
|
809
|
+
*/
|
|
810
|
+
PEN: Currency;
|
|
811
|
+
/**
|
|
812
|
+
* The Philippine Peso (PHP).
|
|
813
|
+
*
|
|
814
|
+
* @type {Currency}
|
|
815
|
+
*/
|
|
816
|
+
PHP: Currency;
|
|
817
|
+
/**
|
|
818
|
+
* The Pakistani Rupee (PKR).
|
|
819
|
+
*
|
|
820
|
+
* @type {Currency}
|
|
821
|
+
*/
|
|
822
|
+
PKR: Currency;
|
|
823
|
+
/**
|
|
824
|
+
* The Polish Zloty (PLN).
|
|
825
|
+
*
|
|
826
|
+
* @type {Currency}
|
|
827
|
+
*/
|
|
828
|
+
PLN: Currency;
|
|
829
|
+
/**
|
|
830
|
+
* The Paraguayan Guarani (PYG).
|
|
831
|
+
*
|
|
832
|
+
* @type {Currency}
|
|
833
|
+
*/
|
|
834
|
+
PYG: Currency;
|
|
835
|
+
/**
|
|
836
|
+
* The Qatari Rial (QAR).
|
|
837
|
+
*
|
|
838
|
+
* @type {Currency}
|
|
839
|
+
*/
|
|
840
|
+
QAR: Currency;
|
|
841
|
+
/**
|
|
842
|
+
* The Romanian Leu (RON).
|
|
843
|
+
*
|
|
844
|
+
* @type {Currency}
|
|
845
|
+
*/
|
|
846
|
+
RON: Currency;
|
|
847
|
+
/**
|
|
848
|
+
* The Serbian Dinar (RSD).
|
|
849
|
+
*
|
|
850
|
+
* @type {Currency}
|
|
851
|
+
*/
|
|
852
|
+
RSD: Currency;
|
|
853
|
+
/**
|
|
854
|
+
* The Russian Ruble (RUB).
|
|
855
|
+
*
|
|
856
|
+
* @type {Currency}
|
|
857
|
+
*/
|
|
858
|
+
RUB: Currency;
|
|
859
|
+
/**
|
|
860
|
+
* The Rwandan Franc (RWF).
|
|
861
|
+
*
|
|
862
|
+
* @type {Currency}
|
|
863
|
+
*/
|
|
864
|
+
RWF: Currency;
|
|
865
|
+
/**
|
|
866
|
+
* The Saudi Riyal (SAR).
|
|
867
|
+
*
|
|
868
|
+
* @type {Currency}
|
|
869
|
+
*/
|
|
870
|
+
SAR: Currency;
|
|
871
|
+
/**
|
|
872
|
+
* The Sudanese Pound (SDG).
|
|
873
|
+
*
|
|
874
|
+
* @type {Currency}
|
|
875
|
+
*/
|
|
876
|
+
SDG: Currency;
|
|
877
|
+
/**
|
|
878
|
+
* The Swedish Krona (SEK).
|
|
879
|
+
*
|
|
880
|
+
* @type {Currency}
|
|
881
|
+
*/
|
|
882
|
+
SEK: Currency;
|
|
883
|
+
/**
|
|
884
|
+
* The Singapore Dollar (SGD).
|
|
885
|
+
*
|
|
886
|
+
* @type {Currency}
|
|
887
|
+
*/
|
|
888
|
+
SGD: Currency;
|
|
889
|
+
/**
|
|
890
|
+
* The Somali Shilling (SOS).
|
|
891
|
+
*
|
|
892
|
+
* @type {Currency}
|
|
893
|
+
*/
|
|
894
|
+
SOS: Currency;
|
|
895
|
+
/**
|
|
896
|
+
* The Syrian Pound (SYP).
|
|
897
|
+
*
|
|
898
|
+
* @type {Currency}
|
|
899
|
+
*/
|
|
900
|
+
SYP: Currency;
|
|
901
|
+
/**
|
|
902
|
+
* The Thai Baht (THB).
|
|
903
|
+
*
|
|
904
|
+
* @type {Currency}
|
|
905
|
+
*/
|
|
906
|
+
THB: Currency;
|
|
907
|
+
/**
|
|
908
|
+
* The Tunisian Dinar (TND).
|
|
909
|
+
*
|
|
910
|
+
* @type {Currency}
|
|
911
|
+
*/
|
|
912
|
+
TND: Currency;
|
|
913
|
+
/**
|
|
914
|
+
* The Tongan Paʻanga (TOP).
|
|
915
|
+
*
|
|
916
|
+
* @type {Currency}
|
|
917
|
+
*/
|
|
918
|
+
TOP: Currency;
|
|
919
|
+
/**
|
|
920
|
+
* The Turkish Lira (TRY).
|
|
921
|
+
*
|
|
922
|
+
* @type {Currency}
|
|
923
|
+
*/
|
|
924
|
+
TRY: Currency;
|
|
925
|
+
/**
|
|
926
|
+
* The Trinidad and Tobago Dollar (TTD).
|
|
927
|
+
*
|
|
928
|
+
* @type {Currency}
|
|
929
|
+
*/
|
|
930
|
+
TTD: Currency;
|
|
931
|
+
/**
|
|
932
|
+
* The New Taiwan Dollar (TWD).
|
|
933
|
+
*
|
|
934
|
+
* @type {Currency}
|
|
935
|
+
*/
|
|
936
|
+
TWD: Currency;
|
|
937
|
+
/**
|
|
938
|
+
* The Tanzanian Shilling (TZS).
|
|
939
|
+
*
|
|
940
|
+
* @type {Currency}
|
|
941
|
+
*/
|
|
942
|
+
TZS: Currency;
|
|
943
|
+
/**
|
|
944
|
+
* The Ukrainian Hryvnia (UAH).
|
|
945
|
+
*
|
|
946
|
+
* @type {Currency}
|
|
947
|
+
*/
|
|
948
|
+
UAH: Currency;
|
|
949
|
+
/**
|
|
950
|
+
* The Ugandan Shilling (UGX).
|
|
951
|
+
*
|
|
952
|
+
* @type {Currency}
|
|
953
|
+
*/
|
|
954
|
+
UGX: Currency;
|
|
955
|
+
/**
|
|
956
|
+
* The Uruguayan Peso (UYU).
|
|
957
|
+
*
|
|
958
|
+
* @type {Currency}
|
|
959
|
+
*/
|
|
960
|
+
UYU: Currency;
|
|
961
|
+
/**
|
|
962
|
+
* The Uzbek Som (UZS).
|
|
963
|
+
*
|
|
964
|
+
* @type {Currency}
|
|
965
|
+
*/
|
|
966
|
+
UZS: Currency;
|
|
967
|
+
/**
|
|
968
|
+
* The Venezuelan Bolívar (VEF).
|
|
969
|
+
*
|
|
970
|
+
* @type {Currency}
|
|
971
|
+
*/
|
|
972
|
+
VEF: Currency;
|
|
973
|
+
/**
|
|
974
|
+
* The Vietnamese Dong (VND).
|
|
975
|
+
*
|
|
976
|
+
* @type {Currency}
|
|
977
|
+
*/
|
|
978
|
+
VND: Currency;
|
|
979
|
+
/**
|
|
980
|
+
* The Central African CFA Franc (XAF).
|
|
981
|
+
*
|
|
982
|
+
* @type {Currency}
|
|
983
|
+
*/
|
|
984
|
+
XAF: Currency;
|
|
985
|
+
/**
|
|
986
|
+
* The West African CFA Franc (XOF).
|
|
987
|
+
*
|
|
988
|
+
* @type {Currency}
|
|
989
|
+
*/
|
|
990
|
+
XOF: Currency;
|
|
991
|
+
/**
|
|
992
|
+
* The Yemeni Rial (YER).
|
|
993
|
+
*
|
|
994
|
+
* @type {Currency}
|
|
995
|
+
*/
|
|
996
|
+
YER: Currency;
|
|
997
|
+
/**
|
|
998
|
+
* The South African Rand (ZAR).
|
|
999
|
+
*
|
|
1000
|
+
* @type {Currency}
|
|
1001
|
+
*/
|
|
1002
|
+
ZAR: Currency;
|
|
1003
|
+
/**
|
|
1004
|
+
* The Zambian Kwacha (ZMK).
|
|
1005
|
+
*
|
|
1006
|
+
* @type {Currency}
|
|
1007
|
+
*/
|
|
1008
|
+
ZMK: Currency;
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
*
|
|
1012
|
+
* Represents the ISO 4217 currency codes available in the currencies collection.
|
|
1013
|
+
*
|
|
1014
|
+
* This type is derived from the keys of the `Currencies` interface, ensuring that
|
|
1015
|
+
* only valid currency codes are accepted. It provides type safety when working
|
|
1016
|
+
* with currency codes throughout the application.
|
|
1017
|
+
*
|
|
1018
|
+
* @example
|
|
1019
|
+
* ```typescript
|
|
1020
|
+
* const currencyCode: CurrencyCode = "USD"; // Valid
|
|
1021
|
+
* const invalidCode: CurrencyCode = "INVALID"; // TypeScript error
|
|
1022
|
+
* ```
|
|
1023
|
+
*/
|
|
1024
|
+
export type CurrencyCode = keyof Currencies;
|
|
1025
|
+
/**
|
|
1026
|
+
*
|
|
1027
|
+
* Represents the currency symbols for all available currencies.
|
|
1028
|
+
*
|
|
1029
|
+
* This type extracts the symbol property from each currency in the `Currencies`
|
|
1030
|
+
* interface, providing a union type of all possible currency symbols. It's useful
|
|
1031
|
+
* for type-safe operations involving currency symbols.
|
|
1032
|
+
*
|
|
1033
|
+
* @example
|
|
1034
|
+
* ```typescript
|
|
1035
|
+
* const symbol: CurrencySymbol = "$"; // Valid (USD symbol)
|
|
1036
|
+
* const euroSymbol: CurrencySymbol = "€"; // Valid (EUR symbol)
|
|
1037
|
+
* ```
|
|
1038
|
+
*/
|
|
1039
|
+
export type CurrencySymbol = Currencies[CurrencyCode]['symbol'];
|