generaltranslation 7.7.3 → 7.9.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/id.d.ts +1 -1
  3. package/dist/index.cjs.min.cjs +3 -3
  4. package/dist/index.cjs.min.cjs.map +1 -1
  5. package/dist/index.d.ts +28 -2
  6. package/dist/index.esm.min.mjs +3 -3
  7. package/dist/index.esm.min.mjs.map +1 -1
  8. package/dist/internal.cjs.min.cjs +1 -1
  9. package/dist/internal.cjs.min.cjs.map +1 -1
  10. package/dist/internal.d.ts +3 -2
  11. package/dist/internal.esm.min.mjs +1 -1
  12. package/dist/internal.esm.min.mjs.map +1 -1
  13. package/dist/types-dir/{enqueueEntries.d.ts → api/enqueueEntries.d.ts} +1 -1
  14. package/dist/types-dir/{enqueueFiles.d.ts → api/enqueueFiles.d.ts} +1 -1
  15. package/dist/types-dir/{entry.d.ts → api/entry.d.ts} +1 -1
  16. package/dist/types-dir/{translate.d.ts → api/translate.d.ts} +1 -1
  17. package/dist/types-dir/{uploadFiles.d.ts → api/uploadFiles.d.ts} +1 -1
  18. package/dist/types-dir/{variables.d.ts → jsx/variables.d.ts} +1 -1
  19. package/dist/types-dir/transformations.d.ts +6 -0
  20. package/dist/types.cjs.min.cjs.map +1 -1
  21. package/dist/types.d.ts +9 -7
  22. package/dist/types.esm.min.mjs.map +1 -1
  23. package/package.json +1 -1
  24. /package/dist/types-dir/{checkFileTranslations.d.ts → api/checkFileTranslations.d.ts} +0 -0
  25. /package/dist/types-dir/{downloadFile.d.ts → api/downloadFile.d.ts} +0 -0
  26. /package/dist/types-dir/{downloadFileBatch.d.ts → api/downloadFileBatch.d.ts} +0 -0
  27. /package/dist/types-dir/{fetchTranslations.d.ts → api/fetchTranslations.d.ts} +0 -0
  28. /package/dist/types-dir/{file.d.ts → api/file.d.ts} +0 -0
  29. /package/dist/types-dir/{project.d.ts → api/project.d.ts} +0 -0
  30. /package/dist/types-dir/{translateMany.d.ts → api/translateMany.d.ts} +0 -0
  31. /package/dist/types-dir/{translationStatus.d.ts → api/translationStatus.d.ts} +0 -0
  32. /package/dist/types-dir/{content.d.ts → jsx/content.d.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ type LocaleProperties = {
24
24
  emoji: string;
25
25
  };
26
26
 
27
- type VariableType = 'v' | 'n' | 'd' | 'c';
27
+ type VariableType = 'v' | 'n' | 'd' | 'c' | 's';
28
28
  /**
29
29
  * Variables are used to store the variable name and type.
30
30
  */
@@ -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 };