generaltranslation 7.7.2 → 7.8.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/CHANGELOG.md +12 -0
- package/dist/index.cjs.min.cjs +3 -3
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.esm.min.mjs +3 -3
- package/dist/index.esm.min.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -915,6 +915,21 @@ declare class GT {
|
|
|
915
915
|
formatList(array: Array<string | number>, options?: {
|
|
916
916
|
locales?: string | string[];
|
|
917
917
|
} & Intl.ListFormatOptions): string;
|
|
918
|
+
/**
|
|
919
|
+
* Formats a list of items according to the specified locales and options.
|
|
920
|
+
* @param {Array<T>} array - The list of items to format
|
|
921
|
+
* @param {Object} [options] - Additional options for list formatting
|
|
922
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
923
|
+
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options
|
|
924
|
+
* @returns {Array<T | string>} The formatted list parts
|
|
925
|
+
*
|
|
926
|
+
* @example
|
|
927
|
+
* gt.formatListToParts(['apple', 42, { foo: 'bar' }], { type: 'conjunction', style: 'short', locales: ['en'] });
|
|
928
|
+
* // Returns: ['apple', ', ', 42, ' and ', '{ foo: "bar" }']
|
|
929
|
+
*/
|
|
930
|
+
formatListToParts<T>(array: Array<T>, options?: {
|
|
931
|
+
locales?: string | string[];
|
|
932
|
+
} & Intl.ListFormatOptions): Array<T | string>;
|
|
918
933
|
/**
|
|
919
934
|
* Formats a relative time value according to the specified locales and options.
|
|
920
935
|
*
|
|
@@ -1215,6 +1230,17 @@ declare function formatCurrency(value: number, currency: string, options: {
|
|
|
1215
1230
|
declare function formatList(array: Array<string | number>, options: {
|
|
1216
1231
|
locales: string | string[];
|
|
1217
1232
|
} & Intl.ListFormatOptions): string;
|
|
1233
|
+
/**
|
|
1234
|
+
* Formats a list of items according to the specified locales and options.
|
|
1235
|
+
* @param {Array<T>} array - The list of items to format
|
|
1236
|
+
* @param {Object} [options] - Additional options for list formatting
|
|
1237
|
+
* @param {string | string[]} [options.locales] - The locales to use for formatting
|
|
1238
|
+
* @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options
|
|
1239
|
+
* @returns {Array<T | string>} The formatted list parts
|
|
1240
|
+
*/
|
|
1241
|
+
declare function formatListToParts<T>(array: Array<T>, options?: {
|
|
1242
|
+
locales?: string | string[];
|
|
1243
|
+
} & Intl.ListFormatOptions): Array<T | string>;
|
|
1218
1244
|
/**
|
|
1219
1245
|
* Formats a relative time value according to the specified locales and options.
|
|
1220
1246
|
* @param {Object} params - The parameters for the relative time formatting.
|
|
@@ -1352,4 +1378,4 @@ declare function isSameLanguage(...locales: (string | string[])[]): boolean;
|
|
|
1352
1378
|
*/
|
|
1353
1379
|
declare function isSupersetLocale(superLocale: string, subLocale: string): boolean;
|
|
1354
1380
|
|
|
1355
|
-
export { GT, determineLocale, formatCurrency, formatDateTime, formatList, formatMessage, formatNum, formatRelativeTime, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, standardizeLocale };
|
|
1381
|
+
export { GT, determineLocale, formatCurrency, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, standardizeLocale };
|