generaltranslation 2.0.57 → 2.0.58
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/index.d.ts +16 -4
- package/dist/index.js +16 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { LanguageObject } from './codes/codes';
|
2
2
|
import { Request } from './translation/_translateBundle';
|
3
3
|
import { Update } from './translation/_updateProjectDictionary';
|
4
|
-
import { _num, _datetime, _currency } from './format/_format';
|
5
4
|
/**
|
6
5
|
* Type representing the constructor parameters for the GT class.
|
7
6
|
*/
|
@@ -152,7 +151,11 @@ export declare function isSameLanguage(...codes: string[]): boolean;
|
|
152
151
|
* @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.
|
153
152
|
* @returns {string} The formatted number.
|
154
153
|
*/
|
155
|
-
export declare
|
154
|
+
export declare function num({ value, languages, options }: {
|
155
|
+
value: number;
|
156
|
+
languages?: string | string[];
|
157
|
+
options?: Intl.NumberFormatOptions;
|
158
|
+
}): string;
|
156
159
|
/**
|
157
160
|
* Formats a date according to the specified languages and options.
|
158
161
|
* @param {Object} params - The parameters for the date formatting.
|
@@ -161,7 +164,11 @@ export declare const num: typeof _num;
|
|
161
164
|
* @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.
|
162
165
|
* @returns {string} The formatted date.
|
163
166
|
*/
|
164
|
-
export declare
|
167
|
+
export declare function datetime({ value, languages, options }: {
|
168
|
+
value: Date;
|
169
|
+
languages?: string | string[];
|
170
|
+
options?: Intl.DateTimeFormatOptions;
|
171
|
+
}): string;
|
165
172
|
/**
|
166
173
|
* Formats a currency value according to the specified languages, currency, and options.
|
167
174
|
* @param {Object} params - The parameters for the currency formatting.
|
@@ -171,4 +178,9 @@ export declare const datetime: typeof _datetime;
|
|
171
178
|
* @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.
|
172
179
|
* @returns {string} The formatted currency value.
|
173
180
|
*/
|
174
|
-
export declare
|
181
|
+
export declare function currency({ value, languages, currency, options }: {
|
182
|
+
value: number;
|
183
|
+
languages?: string | string[];
|
184
|
+
currency?: string;
|
185
|
+
options?: Intl.NumberFormatOptions;
|
186
|
+
}): string;
|
package/dist/index.js
CHANGED
@@ -52,11 +52,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
52
52
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
53
53
|
};
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
55
|
-
exports.
|
55
|
+
exports.standardizeLanguageCode = exports.isValidLanguageCode = exports.getLanguageDirection = void 0;
|
56
56
|
exports.getLanguageObject = getLanguageObject;
|
57
57
|
exports.getLanguageCode = getLanguageCode;
|
58
58
|
exports.getLanguageName = getLanguageName;
|
59
59
|
exports.isSameLanguage = isSameLanguage;
|
60
|
+
exports.num = num;
|
61
|
+
exports.datetime = datetime;
|
62
|
+
exports.currency = currency;
|
60
63
|
// ----- IMPORTS ----- //
|
61
64
|
var codes_1 = require("./codes/codes");
|
62
65
|
var getLanguageDirection_1 = __importDefault(require("./codes/getLanguageDirection"));
|
@@ -221,7 +224,10 @@ function isSameLanguage() {
|
|
221
224
|
* @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for number formatting.
|
222
225
|
* @returns {string} The formatted number.
|
223
226
|
*/
|
224
|
-
|
227
|
+
function num(_a) {
|
228
|
+
var value = _a.value, languages = _a.languages, options = _a.options;
|
229
|
+
return (0, _format_1._num)({ value: value, languages: languages, options: options });
|
230
|
+
}
|
225
231
|
/**
|
226
232
|
* Formats a date according to the specified languages and options.
|
227
233
|
* @param {Object} params - The parameters for the date formatting.
|
@@ -230,7 +236,10 @@ exports.num = _format_1._num;
|
|
230
236
|
* @param {Intl.DateTimeFormatOptions} [params.options={}] - Additional options for date formatting.
|
231
237
|
* @returns {string} The formatted date.
|
232
238
|
*/
|
233
|
-
|
239
|
+
function datetime(_a) {
|
240
|
+
var value = _a.value, languages = _a.languages, options = _a.options;
|
241
|
+
return (0, _format_1._datetime)({ value: value, languages: languages, options: options });
|
242
|
+
}
|
234
243
|
/**
|
235
244
|
* Formats a currency value according to the specified languages, currency, and options.
|
236
245
|
* @param {Object} params - The parameters for the currency formatting.
|
@@ -240,4 +249,7 @@ exports.datetime = _format_1._datetime;
|
|
240
249
|
* @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.
|
241
250
|
* @returns {string} The formatted currency value.
|
242
251
|
*/
|
243
|
-
|
252
|
+
function currency(_a) {
|
253
|
+
var value = _a.value, languages = _a.languages, currency = _a.currency, options = _a.options;
|
254
|
+
return (0, _format_1._currency)({ value: value, languages: languages, currency: currency, options: options });
|
255
|
+
}
|