generaltranslation 8.2.12 → 8.2.14

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 (222) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/{ApiError-IYfaOR30.mjs → ApiError-0DxxIHLp.mjs} +1 -1
  3. package/dist/{ApiError-CZ45tkW6.cjs.map → ApiError-0DxxIHLp.mjs.map} +1 -1
  4. package/dist/{ApiError-CZ45tkW6.cjs → ApiError-D-IBuHj6.cjs} +1 -1
  5. package/dist/{ApiError-IYfaOR30.mjs.map → ApiError-D-IBuHj6.cjs.map} +1 -1
  6. package/dist/LocaleConfig.d.ts +1 -0
  7. package/dist/LocaleConfig.js +1 -0
  8. package/dist/backwards-compatability/dataConversion.d.ts +23 -0
  9. package/dist/backwards-compatability/dataConversion.js +207 -0
  10. package/dist/backwards-compatability/oldHashJsxChildren.d.ts +23 -0
  11. package/dist/backwards-compatability/oldHashJsxChildren.js +79 -0
  12. package/dist/backwards-compatability/oldTypes.d.ts +21 -0
  13. package/dist/backwards-compatability/oldTypes.js +1 -0
  14. package/dist/backwards-compatability/typeChecking.d.ts +21 -0
  15. package/dist/backwards-compatability/typeChecking.js +61 -0
  16. package/dist/{base64-2fu94Klt.cjs → base64-C6BHySOc.cjs} +17 -1
  17. package/dist/base64-C6BHySOc.cjs.map +1 -0
  18. package/dist/{base64-DH0STixb.mjs → base64-CWITCfhU.mjs} +6 -2
  19. package/dist/base64-CWITCfhU.mjs.map +1 -0
  20. package/dist/core.cjs +9 -8
  21. package/dist/core.d.cts +1 -2
  22. package/dist/core.d.mts +1 -2
  23. package/dist/core.d.ts +1 -0
  24. package/dist/core.js +1 -0
  25. package/dist/core.mjs +2 -2
  26. package/dist/derive/condenseVars.d.ts +7 -0
  27. package/dist/derive/condenseVars.js +30 -0
  28. package/dist/derive/declareVar.d.ts +26 -0
  29. package/dist/derive/declareVar.js +38 -0
  30. package/dist/derive/decodeVars.d.ts +9 -0
  31. package/dist/derive/decodeVars.js +52 -0
  32. package/dist/derive/derive.d.ts +53 -0
  33. package/dist/derive/derive.js +55 -0
  34. package/dist/derive/extractVars.d.ts +9 -0
  35. package/dist/derive/extractVars.js +34 -0
  36. package/dist/derive/index.d.ts +7 -0
  37. package/dist/derive/index.js +7 -0
  38. package/dist/derive/indexVars.d.ts +6 -0
  39. package/dist/derive/indexVars.js +52 -0
  40. package/dist/derive/utils/constants.d.ts +2 -0
  41. package/dist/derive/utils/constants.js +2 -0
  42. package/dist/derive/utils/regex.d.ts +2 -0
  43. package/dist/derive/utils/regex.js +4 -0
  44. package/dist/derive/utils/sanitizeVar.d.ts +12 -0
  45. package/dist/derive/utils/sanitizeVar.js +38 -0
  46. package/dist/derive/utils/traverseHelpers.d.ts +4 -0
  47. package/dist/derive/utils/traverseHelpers.js +22 -0
  48. package/dist/derive/utils/traverseIcu.d.ts +20 -0
  49. package/dist/derive/utils/traverseIcu.js +49 -0
  50. package/dist/derive/utils/types.d.ts +23 -0
  51. package/dist/derive/utils/types.js +1 -0
  52. package/dist/errors/ApiError.d.ts +7 -0
  53. package/dist/errors/ApiError.js +33 -0
  54. package/dist/errors.cjs +1 -1
  55. package/dist/errors.d.ts +1 -0
  56. package/dist/errors.js +1 -0
  57. package/dist/errors.mjs +1 -1
  58. package/dist/id/hashSource.d.ts +25 -0
  59. package/dist/id/hashSource.js +98 -0
  60. package/dist/id/hashTemplate.d.ts +4 -0
  61. package/dist/id/hashTemplate.js +6 -0
  62. package/dist/id/types.d.ts +7 -0
  63. package/dist/id/types.js +1 -0
  64. package/dist/{id-CyiXsQrY.cjs → id-C2orn1MA.cjs} +2 -2
  65. package/dist/{id-CyiXsQrY.cjs.map → id-C2orn1MA.cjs.map} +1 -1
  66. package/dist/{id-DbD7K-HL.mjs → id-DEaFhGqX.mjs} +2 -2
  67. package/dist/{id-DbD7K-HL.mjs.map → id-DEaFhGqX.mjs.map} +1 -1
  68. package/dist/id.cjs +1 -1
  69. package/dist/id.d.cts +1 -1
  70. package/dist/id.d.mts +1 -1
  71. package/dist/id.d.ts +3 -0
  72. package/dist/id.js +3 -0
  73. package/dist/id.mjs +1 -1
  74. package/dist/index.cjs +368 -385
  75. package/dist/index.cjs.map +1 -1
  76. package/dist/index.d.cts +4 -242
  77. package/dist/index.d.mts +4 -242
  78. package/dist/index.d.ts +786 -0
  79. package/dist/index.js +1345 -0
  80. package/dist/index.mjs +215 -352
  81. package/dist/index.mjs.map +1 -1
  82. package/dist/internal.cjs +7 -7
  83. package/dist/internal.cjs.map +1 -1
  84. package/dist/internal.d.cts +7 -6
  85. package/dist/internal.d.mts +7 -6
  86. package/dist/internal.d.ts +19 -0
  87. package/dist/internal.js +17 -0
  88. package/dist/internal.mjs +5 -5
  89. package/dist/internal.mjs.map +1 -1
  90. package/dist/{isVariable-B08mggBy.cjs → isVariable-Ba1gLXdB.cjs} +1 -1
  91. package/dist/{isVariable-B08mggBy.cjs.map → isVariable-Ba1gLXdB.cjs.map} +1 -1
  92. package/dist/{isVariable-CYsKFHvR.mjs → isVariable-fAKEB7gF.mjs} +1 -1
  93. package/dist/{isVariable-CYsKFHvR.mjs.map → isVariable-fAKEB7gF.mjs.map} +1 -1
  94. package/dist/locales/getPluralForm.d.ts +9 -0
  95. package/dist/locales/getPluralForm.js +63 -0
  96. package/dist/logging/errors.d.ts +10 -0
  97. package/dist/logging/errors.js +29 -0
  98. package/dist/logging/logger.d.ts +118 -0
  99. package/dist/logging/logger.js +256 -0
  100. package/dist/projects/getProjectData.d.ts +1 -0
  101. package/dist/projects/getProjectData.js +87 -0
  102. package/dist/settings/plurals.d.ts +3 -0
  103. package/dist/settings/plurals.js +14 -0
  104. package/dist/settings/settings.d.ts +2 -0
  105. package/dist/settings/settings.js +2 -0
  106. package/dist/settings/settingsUrls.d.ts +3 -0
  107. package/dist/settings/settingsUrls.js +3 -0
  108. package/dist/translate/api.d.ts +1 -0
  109. package/dist/translate/api.js +1 -0
  110. package/dist/translate/awaitJobs.d.ts +19 -0
  111. package/dist/translate/awaitJobs.js +112 -0
  112. package/dist/translate/checkJobStatus.d.ts +8 -0
  113. package/dist/translate/checkJobStatus.js +55 -0
  114. package/dist/translate/createBranch.d.ts +10 -0
  115. package/dist/translate/createBranch.js +53 -0
  116. package/dist/translate/createTag.d.ts +19 -0
  117. package/dist/translate/createTag.js +67 -0
  118. package/dist/translate/downloadFileBatch.d.ts +1 -0
  119. package/dist/translate/downloadFileBatch.js +77 -0
  120. package/dist/translate/enqueueFiles.d.ts +8 -0
  121. package/dist/translate/enqueueFiles.js +96 -0
  122. package/dist/translate/getOrphanedFiles.d.ts +8 -0
  123. package/dist/translate/getOrphanedFiles.js +97 -0
  124. package/dist/translate/processFileMoves.d.ts +25 -0
  125. package/dist/translate/processFileMoves.js +90 -0
  126. package/dist/translate/publishFiles.d.ts +17 -0
  127. package/dist/translate/publishFiles.js +56 -0
  128. package/dist/translate/queryBranchData.d.ts +3 -0
  129. package/dist/translate/queryBranchData.js +53 -0
  130. package/dist/translate/queryFileData.d.ts +42 -0
  131. package/dist/translate/queryFileData.js +71 -0
  132. package/dist/translate/querySourceFile.d.ts +1 -0
  133. package/dist/translate/querySourceFile.js +67 -0
  134. package/dist/translate/setupProject.d.ts +11 -0
  135. package/dist/translate/setupProject.js +63 -0
  136. package/dist/translate/submitUserEditDiffs.d.ts +12 -0
  137. package/dist/translate/submitUserEditDiffs.js +68 -0
  138. package/dist/translate/translateMany.d.ts +1 -0
  139. package/dist/translate/translateMany.js +103 -0
  140. package/dist/translate/uploadSourceFiles.d.ts +1 -0
  141. package/dist/translate/uploadSourceFiles.js +87 -0
  142. package/dist/translate/uploadTranslations.d.ts +1 -0
  143. package/dist/translate/uploadTranslations.js +101 -0
  144. package/dist/translate/utils/apiRequest.d.ts +1 -0
  145. package/dist/translate/utils/apiRequest.js +130 -0
  146. package/dist/translate/utils/batch.d.ts +52 -0
  147. package/dist/translate/utils/batch.js +126 -0
  148. package/dist/translate/utils/fetchWithTimeout.d.ts +1 -0
  149. package/dist/translate/utils/fetchWithTimeout.js +93 -0
  150. package/dist/translate/utils/generateRequestHeaders.d.ts +2 -0
  151. package/dist/translate/utils/generateRequestHeaders.js +26 -0
  152. package/dist/translate/utils/handleFetchError.d.ts +1 -0
  153. package/dist/translate/utils/handleFetchError.js +12 -0
  154. package/dist/translate/utils/validateFileFormatTransform.d.ts +16 -0
  155. package/dist/translate/utils/validateFileFormatTransform.js +29 -0
  156. package/dist/translate/utils/validateResponse.d.ts +1 -0
  157. package/dist/translate/utils/validateResponse.js +72 -0
  158. package/dist/{types-V5rqd1WR.d.cts → types-73XFwmhH.d.mts} +39 -115
  159. package/dist/{types-BsGsgJWF.d.mts → types-YrrGRHBP.d.cts} +39 -115
  160. package/dist/types-dir/api/branch.d.ts +10 -0
  161. package/dist/types-dir/api/branch.js +1 -0
  162. package/dist/types-dir/api/checkFileTranslations.d.ts +37 -0
  163. package/dist/types-dir/api/checkFileTranslations.js +1 -0
  164. package/dist/types-dir/api/downloadFile.d.ts +3 -0
  165. package/dist/types-dir/api/downloadFile.js +1 -0
  166. package/dist/types-dir/api/downloadFileBatch.d.ts +35 -0
  167. package/dist/types-dir/api/downloadFileBatch.js +1 -0
  168. package/dist/types-dir/api/enqueueEntries.d.ts +21 -0
  169. package/dist/types-dir/api/enqueueEntries.js +1 -0
  170. package/dist/types-dir/api/enqueueFiles.d.ts +70 -0
  171. package/dist/types-dir/api/enqueueFiles.js +1 -0
  172. package/dist/types-dir/api/entry.d.ts +39 -0
  173. package/dist/types-dir/api/entry.js +1 -0
  174. package/dist/types-dir/api/fetchTranslations.d.ts +12 -0
  175. package/dist/types-dir/api/fetchTranslations.js +1 -0
  176. package/dist/types-dir/api/file.d.ts +57 -0
  177. package/dist/types-dir/api/file.js +1 -0
  178. package/dist/types-dir/api/json.d.ts +5 -0
  179. package/dist/types-dir/api/json.js +1 -0
  180. package/dist/types-dir/api/project.d.ts +7 -0
  181. package/dist/types-dir/api/project.js +1 -0
  182. package/dist/types-dir/api/translate.d.ts +34 -0
  183. package/dist/types-dir/api/translate.js +1 -0
  184. package/dist/types-dir/api/translateMany.d.ts +5 -0
  185. package/dist/types-dir/api/translateMany.js +1 -0
  186. package/dist/types-dir/api/translationStatus.d.ts +9 -0
  187. package/dist/types-dir/api/translationStatus.js +1 -0
  188. package/dist/types-dir/api/uploadFiles.d.ts +44 -0
  189. package/dist/types-dir/api/uploadFiles.js +1 -0
  190. package/dist/types-dir/transformations.d.ts +8 -0
  191. package/dist/types-dir/transformations.js +1 -0
  192. package/dist/types.cjs +7 -16
  193. package/dist/types.d.cts +2 -2
  194. package/dist/types.d.mts +2 -2
  195. package/dist/types.d.ts +127 -0
  196. package/dist/types.js +1 -0
  197. package/dist/types.mjs +1 -15
  198. package/dist/utils/base64.d.ts +2 -0
  199. package/dist/utils/base64.js +28 -0
  200. package/dist/utils/isSupportedFileFormatTransform.d.ts +8 -0
  201. package/dist/utils/isSupportedFileFormatTransform.js +26 -0
  202. package/dist/utils/isVariable.d.ts +2 -0
  203. package/dist/utils/isVariable.js +22 -0
  204. package/dist/utils/minify.d.ts +2 -0
  205. package/dist/utils/minify.js +10 -0
  206. package/dist/utils/stableStringify.d.ts +1 -0
  207. package/dist/utils/stableStringify.js +40 -0
  208. package/package.json +5 -4
  209. package/dist/IntlCache-CAW8tKhd.cjs +0 -212
  210. package/dist/IntlCache-CAW8tKhd.cjs.map +0 -1
  211. package/dist/IntlCache-WZk0rKvj.mjs +0 -195
  212. package/dist/IntlCache-WZk0rKvj.mjs.map +0 -1
  213. package/dist/base64-2fu94Klt.cjs.map +0 -1
  214. package/dist/base64-DH0STixb.mjs.map +0 -1
  215. package/dist/core-7RJsqw6c.mjs +0 -1498
  216. package/dist/core-7RJsqw6c.mjs.map +0 -1
  217. package/dist/core-CGhlXrrK.d.mts +0 -209
  218. package/dist/core-CST4J4WU.cjs +0 -1677
  219. package/dist/core-CST4J4WU.cjs.map +0 -1
  220. package/dist/core-D-E8qhLn.d.cts +0 -209
  221. package/dist/types.cjs.map +0 -1
  222. package/dist/types.mjs.map +0 -1
@@ -0,0 +1,786 @@
1
+ import { LocaleConfig } from '@generaltranslation/format';
2
+ import type { CustomMapping, CustomRegionMapping, CutoffFormatOptions, FormatVariables, LocaleProperties, StringFormat } from '@generaltranslation/format/types';
3
+ import { TranslateManyResult, TranslationError, TranslationResult, EnqueueFilesResult, CheckFileTranslationsOptions, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, TranslateManyEntry } from './types';
4
+ import { SetupProjectResult, SetupProjectOptions } from './translate/setupProject';
5
+ import { EnqueueOptions } from './translate/enqueueFiles';
6
+ import { CreateTagOptions, CreateTagResult } from './translate/createTag';
7
+ import { FileQuery, FileQueryResult } from './types-dir/api/checkFileTranslations';
8
+ import { SubmitUserEditDiffsPayload } from './translate/submitUserEditDiffs';
9
+ import { FileUpload, UploadFilesOptions, UploadFilesResponse } from './types-dir/api/uploadFiles';
10
+ import { ProjectData } from './types-dir/api/project';
11
+ import { DownloadFileBatchRequest } from './types-dir/api/downloadFileBatch';
12
+ import { CheckJobStatusResult } from './translate/checkJobStatus';
13
+ import { AwaitJobsOptions, AwaitJobsResult } from './translate/awaitJobs';
14
+ import type { FileDataQuery, FileDataResult } from './translate/queryFileData';
15
+ import type { BranchQuery } from './translate/queryBranchData';
16
+ import type { BranchDataResult } from './types-dir/api/branch';
17
+ import type { CreateBranchQuery, CreateBranchResult } from './translate/createBranch';
18
+ import type { FileReference, FileReferenceIds } from './types-dir/api/file';
19
+ import { type MoveMapping, type ProcessMovesResponse, type ProcessMovesOptions } from './translate/processFileMoves';
20
+ import { type GetOrphanedFilesResult } from './translate/getOrphanedFiles';
21
+ import { type PublishFileEntry, type PublishFilesResult } from './translate/publishFiles';
22
+ import { TranslateOptions } from './types-dir/api/entry';
23
+ export { LocaleConfig, type LocaleConfigConstructorParams, } from '@generaltranslation/format';
24
+ export { determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale, } from '@generaltranslation/format';
25
+ /**
26
+ * Type representing the constructor parameters for the GT class.
27
+ * @typedef {Object} GTConstructorParams
28
+ * @property {string} [apiKey] - The API key for accessing the translation service
29
+ * @property {string} [devApiKey] - The development API key for accessing the translation service
30
+ * @property {string} [sourceLocale] - The default source locale for translations
31
+ * @property {string} [targetLocale] - The default target locale for translations
32
+ * @property {string[]} [locales] - Array of supported locales
33
+ * @property {string} [projectId] - The project ID for the translation service
34
+ * @property {string} [baseUrl] - The base URL for the translation service
35
+ * @property {CustomMapping} [customMapping] - Custom mapping of locale codes to their names
36
+ */
37
+ type GTConstructorParams = {
38
+ apiKey?: string;
39
+ devApiKey?: string;
40
+ sourceLocale?: string;
41
+ targetLocale?: string;
42
+ locales?: string[];
43
+ projectId?: string;
44
+ baseUrl?: string;
45
+ customMapping?: CustomMapping;
46
+ };
47
+ /**
48
+ * GT is the core driver for the General Translation library.
49
+ * This class provides functionality for locale management, formatting, and translation operations.
50
+ *
51
+ * @class GT
52
+ * @description A comprehensive toolkit for handling internationalization and localization.
53
+ *
54
+ * @example
55
+ * const gt = new GT({
56
+ * sourceLocale: 'en-US',
57
+ * targetLocale: 'es-ES',
58
+ * locales: ['en-US', 'es-ES', 'fr-FR']
59
+ * });
60
+ */
61
+ export declare class GT {
62
+ /** Base URL for the translation service API */
63
+ baseUrl?: string;
64
+ /** Project ID for the translation service */
65
+ projectId?: string;
66
+ /** API key for accessing the translation service */
67
+ apiKey?: string;
68
+ /** Development API key for accessing the translation service */
69
+ devApiKey?: string;
70
+ /** Source locale for translations */
71
+ sourceLocale?: string;
72
+ /** Target locale for translations */
73
+ targetLocale?: string;
74
+ /** Array of supported locales */
75
+ locales?: string[];
76
+ /** Custom mapping for locale codes to their names */
77
+ customMapping?: CustomMapping;
78
+ /** Lazily derived reverse custom mapping for alias locales */
79
+ reverseCustomMapping?: Record<string, string>;
80
+ /** Lazily derived custom mapping for regions */
81
+ customRegionMapping?: CustomRegionMapping;
82
+ /** Runtime-safe locale and formatting helpers (backing field) */
83
+ private _localeConfig;
84
+ /** Runtime-safe locale and formatting helpers */
85
+ get localeConfig(): LocaleConfig;
86
+ /**
87
+ * Constructs an instance of the GT class.
88
+ *
89
+ * @param {GTConstructorParams} [params] - The parameters for initializing the GT instance
90
+ * @throws {Error} If an invalid locale is provided
91
+ * @throws {Error} If any of the provided locales are invalid
92
+ *
93
+ * @example
94
+ * const gt = new GT({
95
+ * apiKey: 'your-api-key',
96
+ * sourceLocale: 'en-US',
97
+ * targetLocale: 'es-ES',
98
+ * locales: ['en-US', 'es-ES', 'fr-FR']
99
+ * });
100
+ */
101
+ constructor(params?: GTConstructorParams);
102
+ setConfig({ apiKey, devApiKey, sourceLocale, targetLocale, locales, projectId, customMapping, baseUrl, }: GTConstructorParams): void;
103
+ private _getTranslationConfig;
104
+ private _validateAuth;
105
+ /**
106
+ * Queries branch information from the API.
107
+ *
108
+ * @param {BranchQuery} query - Object mapping the current branch and incoming branches
109
+ * @returns {Promise<BranchDataResult>} The branch information.
110
+ */
111
+ queryBranchData(query: BranchQuery): Promise<BranchDataResult>;
112
+ /**
113
+ * Creates a new branch in the API. If the branch already exists, it will be returned.
114
+ *
115
+ * @param {CreateBranchQuery} query - Object mapping the branch name and default branch flag
116
+ * @returns {Promise<CreateBranchResult>} The created branch information.
117
+ */
118
+ createBranch(query: CreateBranchQuery): Promise<CreateBranchResult>;
119
+ /**
120
+ * Processes file moves by cloning source files and translations with new fileIds.
121
+ * This is called when files have been moved/renamed and we want to preserve translations.
122
+ *
123
+ * @param {MoveMapping[]} moves - Array of move mappings (old fileId to new fileId)
124
+ * @param {ProcessMovesOptions} options - Options including branchId and timeout
125
+ * @returns {Promise<ProcessMovesResponse>} The move processing results.
126
+ *
127
+ * @example
128
+ * const result = await gt.processFileMoves([
129
+ * { oldFileId: 'abc123', newFileId: 'def456', newFileName: 'locales/en.json' }
130
+ * ], { branchId: 'main' });
131
+ */
132
+ processFileMoves(moves: MoveMapping[], options?: ProcessMovesOptions): Promise<ProcessMovesResponse>;
133
+ /**
134
+ * Gets orphaned files for a branch - files that exist on the branch
135
+ * but whose fileIds are not in the provided list.
136
+ * Used for move detection.
137
+ *
138
+ * @param {string} branchId - The branch to check for orphaned files.
139
+ * @param {string[]} fileIds - List of current file IDs (files that are NOT orphaned)
140
+ * @param {Object} options - Options including timeout.
141
+ * @returns {Promise<GetOrphanedFilesResult>} The orphaned files.
142
+ *
143
+ * @example
144
+ * const result = await gt.getOrphanedFiles('branch-id', ['file-1', 'file-2']);
145
+ */
146
+ getOrphanedFiles(branchId: string, fileIds: string[], options?: {
147
+ timeout?: number;
148
+ }): Promise<GetOrphanedFilesResult>;
149
+ /**
150
+ * Enqueues project setup job using the specified file references
151
+ *
152
+ * This method creates setup jobs that will process source file references
153
+ * and generate a project setup. The files parameter contains references (IDs) to source
154
+ * files that have already been uploaded via uploadSourceFiles. The setup jobs are queued
155
+ * for processing and will generate a project setup based on the source files.
156
+ *
157
+ * @param {FileReference[]} files - Array of file references containing IDs of previously uploaded source files
158
+ * @param {SetupProjectOptions} [options] - Optional settings for target locales and timeout.
159
+ * @returns {Promise<SetupProjectResult>} Object containing the jobId and status
160
+ */
161
+ setupProject(files: FileReference[], options?: SetupProjectOptions): Promise<SetupProjectResult>;
162
+ /**
163
+ * Checks the current status of one or more project jobs by their unique identifiers.
164
+ *
165
+ * This method polls the API to determine whether one or more jobs are still running,
166
+ * have completed successfully, or have failed. Jobs are created after calling either enqueueFiles or setupProject.
167
+ *
168
+ * @param {string[]} jobIds - The unique identifiers of the jobs to check.
169
+ * @param {number} [timeoutMs] - Optional timeout in milliseconds for the API request.
170
+ * @returns {Promise<CheckJobStatusResult>} Object containing the job status.
171
+ *
172
+ * @example
173
+ * const result = await gt.checkJobStatus([
174
+ * 'job-123',
175
+ * 'job-456',
176
+ * ], {
177
+ * timeout: 10000,
178
+ * });
179
+ */
180
+ checkJobStatus(jobIds: string[], timeoutMs?: number): Promise<CheckJobStatusResult>;
181
+ /**
182
+ * Polls job statuses until all jobs from enqueueFiles are finished or the timeout is reached.
183
+ *
184
+ * @param {EnqueueFilesResult} enqueueResult - The result returned from enqueueFiles.
185
+ * @param {AwaitJobsOptions} [options] - Polling configuration (interval, timeout).
186
+ * @returns {Promise<AwaitJobsResult>} The final status of all jobs and whether they all completed.
187
+ */
188
+ awaitJobs(enqueueResult: EnqueueFilesResult, options?: AwaitJobsOptions): Promise<AwaitJobsResult>;
189
+ /**
190
+ * Enqueues translation jobs for previously uploaded source files.
191
+ *
192
+ * This method creates translation jobs that will process existing source files
193
+ * and generate translations in the specified target languages. The files parameter
194
+ * contains references (IDs) to source files that have already been uploaded via
195
+ * uploadSourceFiles. The translation jobs are queued for processing and will
196
+ * generate translated content based on the source files and target locales provided.
197
+ *
198
+ * @param {FileReferenceIds[]} files - Array of file references containing IDs of previously uploaded source files
199
+ * @param {EnqueueOptions} options - Configuration options including source locale, target locales, and job settings.
200
+ * @returns {Promise<EnqueueFilesResult>} Result containing job IDs, queue status, and processing information.
201
+ */
202
+ enqueueFiles(files: FileReferenceIds[], options: EnqueueOptions): Promise<EnqueueFilesResult>;
203
+ /**
204
+ * Creates or upserts a file tag, associating a set of source files
205
+ * with a user-defined tag ID and optional message.
206
+ *
207
+ * @param {CreateTagOptions} options - Tag creation options including tagId, sourceFileIds, and optional message
208
+ * @returns {Promise<CreateTagResult>} The created or updated tag.
209
+ */
210
+ createTag(options: CreateTagOptions): Promise<CreateTagResult>;
211
+ /**
212
+ * Publishes or unpublishes files on the CDN.
213
+ *
214
+ * @param {PublishFileEntry[]} files - Array of file entries with publish flags
215
+ * @returns {Promise<PublishFilesResult>} Result containing per-file success/failure
216
+ */
217
+ publishFiles(files: PublishFileEntry[]): Promise<PublishFilesResult>;
218
+ /**
219
+ * Submits user edit diffs for existing translations so future generations preserve user intent.
220
+ *
221
+ * @param {SubmitUserEditDiffsPayload} payload - Project-scoped diff payload.
222
+ * @returns {Promise<void>} Resolves when submission succeeds.
223
+ */
224
+ submitUserEditDiffs(payload: SubmitUserEditDiffsPayload): Promise<void>;
225
+ /**
226
+ * Queries data about one or more source or translation files.
227
+ *
228
+ * @param {FileDataQuery} data - Object mapping source and translation file information.
229
+ * @param {CheckFileTranslationsOptions} options - Options for the API call.
230
+ * @returns {Promise<FileDataResult>} The source and translation file data information.
231
+ *
232
+ * @example
233
+ * const result = await gt.queryFileData({
234
+ * sourceFiles: [
235
+ * { fileId: '1234567890', versionId: '1234567890', branchId: '1234567890' },
236
+ * ],
237
+ * translatedFiles: [
238
+ * { fileId: '1234567890', versionId: '1234567890', branchId: '1234567890', locale: 'es-ES' },
239
+ * ],
240
+ * }, {
241
+ * timeout: 10000,
242
+ * });
243
+ *
244
+ */
245
+ queryFileData(data: FileDataQuery, options?: CheckFileTranslationsOptions): Promise<FileDataResult>;
246
+ /**
247
+ * Gets source and translation information for a given file ID and version ID.
248
+ *
249
+ * @param {FileQuery} data - File query containing file ID and version ID.
250
+ * @param {CheckFileTranslationsOptions} options - Options for getting source and translation information.
251
+ * @returns {Promise<FileQueryResult>} The source file and translation information.
252
+ *
253
+ * @example
254
+ * const result = await gt.querySourceFile(
255
+ * { fileId: '1234567890', versionId: '1234567890' },
256
+ * { timeout: 10000 }
257
+ * );
258
+ *
259
+ */
260
+ querySourceFile(data: FileQuery, options?: CheckFileTranslationsOptions): Promise<FileQueryResult>;
261
+ /**
262
+ * Get project data for a given project ID.
263
+ *
264
+ * @param {string} projectId - The ID of the project to get the data for.
265
+ * @returns {Promise<ProjectData>} The project data.
266
+ *
267
+ * @example
268
+ * const result = await gt.getProjectData(
269
+ * '1234567890'
270
+ * );
271
+ *
272
+ */
273
+ getProjectData(projectId: string, options?: {
274
+ timeout?: number;
275
+ }): Promise<ProjectData>;
276
+ /**
277
+ * Downloads a single file.
278
+ *
279
+ * @param file - The file query object.
280
+ * @param {string} file.fileId - The ID of the file to download.
281
+ * @param {string} [file.branchId] - The ID of the branch to download the file from. If not provided, the default branch will be used.
282
+ * @param {string} [file.locale] - The locale to download the file for. If not provided, the source file will be downloaded.
283
+ * @param {string} [file.versionId] - The version ID to download the file from. If not provided, the latest version will be used.
284
+ * @param {DownloadFileOptions} options - Options for downloading the file.
285
+ * @returns {Promise<string>} The downloaded file content.
286
+ *
287
+ * @example
288
+ * const result = await gt.downloadFile({
289
+ * fileId: '1234567890',
290
+ * branchId: '1234567890',
291
+ * locale: 'es-ES',
292
+ * versionId: '1234567890',
293
+ * }, {
294
+ * timeout: 10000,
295
+ * });
296
+ */
297
+ downloadFile(file: {
298
+ fileId: string;
299
+ branchId?: string;
300
+ locale?: string;
301
+ versionId?: string;
302
+ useLatestAvailableVersion?: boolean;
303
+ }, options?: DownloadFileOptions): Promise<string>;
304
+ /**
305
+ * Downloads multiple files in a batch.
306
+ *
307
+ * @param {DownloadFileBatchRequest} requests - Array of file query objects to download.
308
+ * @param {DownloadFileBatchOptions} options - Options for the batch download.
309
+ * @returns {Promise<DownloadFileBatchResult>} The batch download results.
310
+ *
311
+ * @example
312
+ * const result = await gt.downloadFileBatch([{
313
+ * fileId: '1234567890',
314
+ * locale: 'es-ES',
315
+ * versionId: '1234567890',
316
+ * }], {
317
+ * timeout: 10000,
318
+ * });
319
+ */
320
+ downloadFileBatch(requests: DownloadFileBatchRequest, options?: DownloadFileBatchOptions): Promise<DownloadFileBatchResult>;
321
+ /**
322
+ * Translates a single source string to the target locale.
323
+ * Routes through {@link translateMany} under the hood.
324
+ *
325
+ * @param {string} source - The source string to translate.
326
+ * @param {object} options - Translation options including targetLocale and optional entry metadata.
327
+ * @returns {Promise<TranslationResult | TranslationError>} The translated content.
328
+ *
329
+ * @example
330
+ * const result = await gt.translate('Hello, world!', { targetLocale: 'es' });
331
+ *
332
+ * @example
333
+ * const result = await gt.translate('Hello, world!', {
334
+ * targetLocale: 'es',
335
+ * dataFormat: 'ICU',
336
+ * context: 'A formal greeting',
337
+ * });
338
+ */
339
+ translate(source: TranslateManyEntry, options: string | TranslateOptions, timeout?: number): Promise<TranslationResult | TranslationError>;
340
+ /**
341
+ * Translates multiple source strings to the target locale.
342
+ * Each entry can be a plain string or an object with source and metadata fields.
343
+ *
344
+ * @param {TranslateManyEntry[] | Record<string, TranslateManyEntry>} sources - The source entries to translate. Can be an array or a record keyed by hash.
345
+ * @param {object} options - Translation options including targetLocale.
346
+ * @returns {Promise<TranslateManyResult | Record<string, TranslationResult>>} The translated contents. An array if sources was an array, a record if sources was a record.
347
+ *
348
+ * @example
349
+ * const result = await gt.translateMany(
350
+ * ['Hello, world!', 'Goodbye, world!'],
351
+ * { targetLocale: 'es' }
352
+ * );
353
+ *
354
+ * @example
355
+ * const result = await gt.translateMany(
356
+ * [{ source: 'Hello, world!', dataFormat: 'ICU' }],
357
+ * { targetLocale: 'es' }
358
+ * );
359
+ *
360
+ * @example
361
+ * const result = await gt.translateMany(
362
+ * { 'my-hash': 'Hello, world!' },
363
+ * { targetLocale: 'es' }
364
+ * );
365
+ */
366
+ translateMany(sources: TranslateManyEntry[], options: string | TranslateOptions, timeout?: number): Promise<TranslateManyResult>;
367
+ translateMany(sources: Record<string, TranslateManyEntry>, options: string | TranslateOptions, timeout?: number): Promise<Record<string, TranslationResult>>;
368
+ /**
369
+ * Uploads source files to the translation service without any translation content.
370
+ *
371
+ * This method creates or replaces source file entries in your project. Each uploaded
372
+ * file becomes a source that can later be translated into target languages. The files
373
+ * are processed and stored as base entries that serve as the foundation for generating
374
+ * translations through the translation workflow.
375
+ *
376
+ * @param {Array<{source: FileUpload}>} files - Array of objects containing source file data to upload
377
+ * @param {UploadFilesOptions} options - Configuration options including source locale and other upload settings.
378
+ * @returns {Promise<UploadFilesResponse>} Upload result containing file IDs, version information, and upload status.
379
+ */
380
+ uploadSourceFiles(files: {
381
+ source: FileUpload;
382
+ }[], options: UploadFilesOptions): Promise<UploadFilesResponse>;
383
+ /**
384
+ * Uploads translation files that correspond to previously uploaded source files.
385
+ *
386
+ * This method allows you to provide translated content for existing source files in your project.
387
+ * Each translation must reference an existing source file and include the translated content
388
+ * along with the target locale information. This is used when you have pre-existing translations
389
+ * that you want to upload directly rather than generating them through the translation service.
390
+ *
391
+ * @param {Array<{source: FileUpload, translations: FileUpload[]}>} files - Array of file objects where:
392
+ * - `source`: Reference to the existing source file (contains IDs but no content).
393
+ * - `translations`: Array of translated files, each containing content, locale, and reference IDs
394
+ * @param {UploadFilesOptions} options - Configuration options including source locale and upload settings.
395
+ * @returns {Promise<UploadFilesResponse>} Upload result containing translation IDs, status, and processing information.
396
+ */
397
+ uploadTranslations(files: {
398
+ source: FileUpload;
399
+ translations: FileUpload[];
400
+ }[], options: UploadFilesOptions): Promise<UploadFilesResponse>;
401
+ /**
402
+ * Formats a string with cutoff behavior, applying a terminator when the string exceeds the maximum character limit.
403
+ *
404
+ * This method uses the GT instance's rendering locales by default for locale-specific terminator selection,
405
+ * but can be overridden with custom locales in the options.
406
+ *
407
+ * @param {string} value - The string value to format with cutoff behavior.
408
+ * @param {Object} [options] - Configuration options for cutoff formatting.
409
+ * @param {string | string[]} [options.locales] - The locales to use for terminator selection. Defaults to instance's rendering locales.
410
+ * @param {number} [options.maxChars] - The maximum number of characters to display.
411
+ * - Undefined values are treated as no cutoff.
412
+ * - Negative values follow .slice() behavior and terminator will be added before the value.
413
+ * - 0 will result in an empty string.
414
+ * - If cutoff results in an empty string, no terminator is added.
415
+ * @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.
416
+ * @param {string} [options.terminator] - Optional override the terminator to use.
417
+ * @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.
418
+ * - If no terminator is provided, then separator is ignored.
419
+ * @returns {string} The formatted string with terminator applied if cutoff occurs.
420
+ *
421
+ * @example
422
+ * const gt = new GT({ targetLocale: 'en-US' });
423
+ * gt.formatCutoff('Hello, world!', { maxChars: 8 });
424
+ * // Returns: 'Hello, w...'
425
+ *
426
+ * @example
427
+ * gt.formatCutoff('Hello, world!', { maxChars: -3 });
428
+ * // Returns: '...ld!'
429
+ */
430
+ formatCutoff(value: string, options?: {
431
+ locales?: string | string[];
432
+ } & CutoffFormatOptions): string;
433
+ /**
434
+ * Formats a message according to the specified locales and options.
435
+ *
436
+ * @param {string} message - The message to format.
437
+ * @param {string | string[]} [locales='en'] - The locales to use for formatting.
438
+ * @param {FormatVariables} [variables={}] - The variables to use for formatting.
439
+ * @param {StringFormat} [dataFormat='ICU'] - The format of the message.
440
+ * @returns {string} The formatted message.
441
+ *
442
+ * @example
443
+ * gt.formatMessage('Hello {name}', { name: 'John' });
444
+ * // Returns: "Hello John"
445
+ *
446
+ * gt.formatMessage('Hello {name}', { name: 'John' }, { locales: ['fr'] });
447
+ * // Returns: "Bonjour John"
448
+ */
449
+ formatMessage(message: string, options?: {
450
+ locales?: string | string[];
451
+ variables?: FormatVariables;
452
+ dataFormat?: StringFormat;
453
+ }): string;
454
+ /**
455
+ * Formats a number according to the specified locales and options.
456
+ *
457
+ * @param {number} number - The number to format.
458
+ * @param {Object} [options] - Additional options for number formatting.
459
+ * @param {string | string[]} [options.locales] - The locales to use for formatting.
460
+ * @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options.
461
+ * @returns {string} The formatted number.
462
+ *
463
+ * @example
464
+ * gt.formatNum(1234.56, { style: 'currency', currency: 'USD' });
465
+ * // Returns: "$1,234.56"
466
+ */
467
+ formatNum(number: number, options?: {
468
+ locales?: string | string[];
469
+ } & Intl.NumberFormatOptions): string;
470
+ /**
471
+ * Formats a date according to the specified locales and options.
472
+ *
473
+ * @param {Date} date - The date to format.
474
+ * @param {Object} [options] - Additional options for date formatting.
475
+ * @param {string | string[]} [options.locales] - The locales to use for formatting.
476
+ * @param {Intl.DateTimeFormatOptions} [options] - Additional Intl.DateTimeFormat options.
477
+ * @returns {string} The formatted date.
478
+ *
479
+ * @example
480
+ * gt.formatDateTime(new Date(), { dateStyle: 'full', timeStyle: 'long' });
481
+ * // Returns: "Thursday, March 14, 2024 at 2:30:45 PM GMT-7"
482
+ */
483
+ formatDateTime(date: Date, options?: {
484
+ locales?: string | string[];
485
+ } & Intl.DateTimeFormatOptions): string;
486
+ /**
487
+ * Formats a currency value according to the specified locales and options.
488
+ *
489
+ * @param {number} value - The currency value to format.
490
+ * @param {string} currency - The currency code (e.g., 'USD', 'EUR')
491
+ * @param {Object} [options] - Additional options for currency formatting.
492
+ * @param {string | string[]} [options.locales] - The locales to use for formatting.
493
+ * @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options.
494
+ * @returns {string} The formatted currency value.
495
+ *
496
+ * @example
497
+ * gt.formatCurrency(1234.56, 'USD', { style: 'currency' });
498
+ * // Returns: "$1,234.56"
499
+ */
500
+ formatCurrency(value: number, currency: string, options?: {
501
+ locales?: string | string[];
502
+ } & Intl.NumberFormatOptions): string;
503
+ /**
504
+ * Formats a list of items according to the specified locales and options.
505
+ *
506
+ * @param {Array<string | number>} array - The list of items to format.
507
+ * @param {Object} [options] - Additional options for list formatting.
508
+ * @param {string | string[]} [options.locales] - The locales to use for formatting.
509
+ * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options.
510
+ * @returns {string} The formatted list.
511
+ *
512
+ * @example
513
+ * gt.formatList(['apple', 'banana', 'orange'], { type: 'conjunction' });
514
+ * // Returns: "apple, banana, and orange"
515
+ */
516
+ formatList(array: Array<string | number>, options?: {
517
+ locales?: string | string[];
518
+ } & Intl.ListFormatOptions): string;
519
+ /**
520
+ * Formats a list of items according to the specified locales and options.
521
+ * @param {Array<T>} array - The list of items to format.
522
+ * @param {Object} [options] - Additional options for list formatting.
523
+ * @param {string | string[]} [options.locales] - The locales to use for formatting.
524
+ * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options.
525
+ * @returns {Array<T | string>} The formatted list parts.
526
+ *
527
+ * @example
528
+ * gt.formatListToParts(['apple', 42, { foo: 'bar' }], { type: 'conjunction', style: 'short', locales: ['en'] });
529
+ * // Returns: ['apple', ', ', 42, ' and ', '{ foo: "bar" }']
530
+ */
531
+ formatListToParts<T>(array: Array<T>, options?: {
532
+ locales?: string | string[];
533
+ } & Intl.ListFormatOptions): Array<T | string>;
534
+ /**
535
+ * Formats a relative time value according to the specified locales and options.
536
+ *
537
+ * @param {number} value - The relative time value to format.
538
+ * @param {Intl.RelativeTimeFormatUnit} unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year')
539
+ * @param {Object} options - Additional options for relative time formatting.
540
+ * @param {string | string[]} [options.locales] - The locales to use for formatting.
541
+ * @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options.
542
+ * @returns {string} The formatted relative time string.
543
+ *
544
+ * @example
545
+ * gt.formatRelativeTime(-1, 'day', { locales: ['en-US'], numeric: 'auto' });
546
+ * // Returns: "yesterday"
547
+ */
548
+ formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options?: {
549
+ locales?: string | string[];
550
+ } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
551
+ /**
552
+ * Formats a relative time string from a Date, automatically selecting the best unit.
553
+ *
554
+ * @param {Date} date - The date to format relative to now.
555
+ * @param {Object} [options] - Additional options for relative time formatting.
556
+ * @param {string | string[]} [options.locales] - The locales to use for formatting.
557
+ * @returns {string} The formatted relative time string (e.g., "2 hours ago", "in 3 days")
558
+ *
559
+ * @example
560
+ * gt.formatRelativeTimeFromDate(new Date(Date.now() - 3600000));
561
+ * // Returns: "1 hour ago"
562
+ */
563
+ formatRelativeTimeFromDate(date: Date, options?: {
564
+ locales?: string | string[];
565
+ baseDate?: Date;
566
+ } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
567
+ /**
568
+ * Retrieves the display name of a locale code using Intl.DisplayNames, returning an empty string if no name is found.
569
+ *
570
+ * @param {string} [locale=this.targetLocale] - A BCP-47 locale code.
571
+ * @returns {string} The display name corresponding to the code.
572
+ * @throws {Error} If no target locale is provided.
573
+ *
574
+ * @example
575
+ * gt.getLocaleName('es-ES');
576
+ * // Returns: "Spanish (Spain)"
577
+ */
578
+ getLocaleName(locale?: string | undefined): string;
579
+ /**
580
+ * Retrieves an emoji based on a given locale code.
581
+ * Uses the locale's region (if present) to select an emoji or falls back on default emojis.
582
+ *
583
+ * @param {string} [locale=this.targetLocale] - A BCP-47 locale code (e.g., 'en-US', 'fr-CA')
584
+ * @returns {string} The emoji representing the locale or its region.
585
+ * @throws {Error} If no target locale is provided.
586
+ *
587
+ * @example
588
+ * gt.getLocaleEmoji('es-ES');
589
+ * // Returns: "🇪🇸"
590
+ */
591
+ getLocaleEmoji(locale?: string | undefined): string;
592
+ /**
593
+ * Generates linguistic details for a given locale code.
594
+ *
595
+ * This function returns information about the locale,
596
+ * script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).
597
+ * The function provides these names in both your default language and native forms, and an associated emoji.
598
+ *
599
+ * @param {string} [locale=this.targetLocale] - The locale code to get properties for (e.g., "de-AT").
600
+ * @returns {LocaleProperties} - An object containing detailed information about the locale.
601
+ *
602
+ * @property {string} code - The full locale code, e.g., "de-AT".
603
+ * @property {string} name - Language name in the default display language, e.g., "Austrian German".
604
+ * @property {string} nativeName - Language name in the locale's native language, e.g., "Österreichisches Deutsch".
605
+ * @property {string} languageCode - The base language code, e.g., "de".
606
+ * @property {string} languageName - The language name in the default display language, e.g., "German".
607
+ * @property {string} nativeLanguageName - The language name in the native language, e.g., "Deutsch".
608
+ * @property {string} nameWithRegionCode - Language name with region in the default language, e.g., "German (AT)".
609
+ * @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., "Deutsch (AT)".
610
+ * @property {string} regionCode - The region code from maximization, e.g., "AT".
611
+ * @property {string} regionName - The region name in the default display language, e.g., "Austria".
612
+ * @property {string} nativeRegionName - The region name in the native language, e.g., "Österreich".
613
+ * @property {string} scriptCode - The script code from maximization, e.g., "Latn".
614
+ * @property {string} scriptName - The script name in the default display language, e.g., "Latin".
615
+ * @property {string} nativeScriptName - The script name in the native language, e.g., "Lateinisch".
616
+ * @property {string} maximizedCode - The maximized locale code, e.g., "de-Latn-AT".
617
+ * @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., "Austrian German (Latin)".
618
+ * @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., "Österreichisches Deutsch (Lateinisch)".
619
+ * @property {string} minimizedCode - Minimized locale code, e.g., "de-AT" (or "de" for "de-DE").
620
+ * @property {string} minimizedName - Minimized language name in the default language, e.g., "Austrian German".
621
+ * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "Österreichisches Deutsch".
622
+ * @property {string} emoji - The emoji associated with the locale's region, if applicable.
623
+ */
624
+ getLocaleProperties(locale?: string | undefined): LocaleProperties;
625
+ /**
626
+ * Retrieves multiple properties for a given region code, including:
627
+ * - `code`: the original region code
628
+ * - `name`: the localized display name
629
+ * - `emoji`: the associated flag or symbol
630
+ *
631
+ * Behavior:
632
+ * - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `"US"`, `"FR"`, `"419"`).
633
+ * - Uses the instance's `targetLocale` to localize the region name for the user.
634
+ * - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.
635
+ * - Otherwise, uses `Intl.DisplayNames` to get the localized region name, falling back to `libraryDefaultLocale`.
636
+ * - Falls back to the region code as `name` if display name resolution fails.
637
+ * - Falls back to a default emoji if no emoji mapping is found in built-in data or `customMapping`.
638
+ *
639
+ * @param {string} [region=this.getLocaleProperties().regionCode] - The region code to look up (e.g., `"US"`, `"GB"`, `"DE"`).
640
+ * @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.
641
+ * @returns {{ code: string, name: string, emoji: string }} An object containing:
642
+ * - `code`: the input region code
643
+ * - `name`: the localized or custom region name
644
+ * - `emoji`: the matching emoji flag or symbol
645
+ *
646
+ * @throws {Error} If no target locale is available to determine region properties.
647
+ *
648
+ * @example
649
+ * const gt = new GT({ targetLocale: 'en-US' });
650
+ * gt.getRegionProperties('US');
651
+ * // => { code: 'US', name: 'United States', emoji: '🇺🇸' }
652
+ *
653
+ * @example
654
+ * const gt = new GT({ targetLocale: 'fr-FR' });
655
+ * gt.getRegionProperties('US');
656
+ * // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }
657
+ *
658
+ * @example
659
+ * gt.getRegionProperties('US', { US: { name: 'USA', emoji: '🗽' } });
660
+ * // => { code: 'US', name: 'USA', emoji: '🗽' }
661
+ */
662
+ getRegionProperties(region?: string, customMapping?: CustomRegionMapping): {
663
+ code: string;
664
+ name: string;
665
+ emoji: string;
666
+ };
667
+ /**
668
+ * Determines whether a translation is required based on the source and target locales.
669
+ *
670
+ * @param {string} [sourceLocale=this.sourceLocale] - The locale code for the original content.
671
+ * @param {string} [targetLocale=this.targetLocale] - The locale code to translate into.
672
+ * @param {string[]} [approvedLocales=this.locales] - Optional array of approved target locales.
673
+ * @returns {boolean} True if translation is required, false otherwise
674
+ * @throws {Error} If no source locale is provided.
675
+ * @throws {Error} If no target locale is provided.
676
+ *
677
+ * @example
678
+ * gt.requiresTranslation('en-US', 'es-ES');
679
+ * // Returns: true
680
+ */
681
+ requiresTranslation(sourceLocale?: string | undefined, targetLocale?: string | undefined, approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): boolean;
682
+ /**
683
+ * Determines the best matching locale from the provided approved locales list.
684
+ *
685
+ * @param {string | string[]} locales - A single locale or array of locales in preference order.
686
+ * @param {string[]} [approvedLocales=this.locales] - Array of approved locales in preference order.
687
+ * @returns {string | undefined} The best matching locale, or undefined if no match is found.
688
+ *
689
+ * @example
690
+ * gt.determineLocale(['fr-CA', 'fr-FR'], ['en-US', 'fr-FR', 'es-ES']);
691
+ * // Returns: "fr-FR"
692
+ */
693
+ determineLocale(locales: string | string[], approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): string | undefined;
694
+ /**
695
+ * Gets the text direction for a given locale code.
696
+ *
697
+ * @param {string} [locale=this.targetLocale] - A BCP-47 locale code.
698
+ * @returns {'ltr' | 'rtl'} 'rtl' if the locale is right-to-left; otherwise 'ltr'.
699
+ * @throws {Error} If no target locale is provided.
700
+ *
701
+ * @example
702
+ * gt.getLocaleDirection('ar-SA');
703
+ * // Returns: "rtl"
704
+ */
705
+ getLocaleDirection(locale?: string | undefined): 'ltr' | 'rtl';
706
+ /**
707
+ * Checks if a given BCP 47 locale code is valid.
708
+ *
709
+ * @param {string} [locale=this.targetLocale] - The BCP 47 locale code to validate.
710
+ * @param {CustomMapping} [customMapping=this.customMapping] - The custom mapping to use for validation.
711
+ * @returns {boolean} True if the locale code is valid, false otherwise
712
+ * @throws {Error} If no target locale is provided.
713
+ *
714
+ * @example
715
+ * gt.isValidLocale('en-US');
716
+ * // Returns: true
717
+ */
718
+ isValidLocale(locale?: string | undefined, customMapping?: CustomMapping | undefined): boolean;
719
+ /**
720
+ * Resolves the canonical locale for a given locale.
721
+ * @param locale - The locale to resolve the canonical locale for
722
+ * @param customMapping - The custom mapping to use for resolving the canonical locale
723
+ * @returns The canonical locale, or the input locale when no canonical mapping exists.
724
+ */
725
+ resolveCanonicalLocale(locale?: string | undefined, customMapping?: CustomMapping | undefined): string;
726
+ /**
727
+ * Resolves the alias locale for a given locale.
728
+ * @param locale - The locale to resolve the alias locale for
729
+ * @param customMapping - The custom mapping to use for resolving the alias locale
730
+ * @returns The configured alias for a canonical locale, or the input locale when already an alias or no alias mapping exists.
731
+ */
732
+ resolveAliasLocale(locale: string, customMapping?: CustomMapping | undefined): string;
733
+ /**
734
+ * Standardizes a BCP 47 locale code to ensure correct formatting.
735
+ *
736
+ * @param {string} [locale=this.targetLocale] - The BCP 47 locale code to standardize.
737
+ * @returns {string} The standardized locale code, or the input string if it cannot be standardized.
738
+ * @throws {Error} If no target locale is provided.
739
+ *
740
+ * @example
741
+ * gt.standardizeLocale('en_us');
742
+ * // Returns: "en-US"
743
+ */
744
+ standardizeLocale(locale?: string | undefined): string;
745
+ /**
746
+ * Checks if multiple BCP 47 locale codes represent the same dialect.
747
+ *
748
+ * @param {...(string | string[])} locales - The BCP 47 locale codes to compare.
749
+ * @returns {boolean} True if all codes represent the same dialect, false otherwise
750
+ *
751
+ * @example
752
+ * gt.isSameDialect('en-US', 'en-GB');
753
+ * // Returns: false
754
+ *
755
+ * gt.isSameDialect('en', 'en-US');
756
+ * // Returns: true
757
+ */
758
+ isSameDialect(...locales: (string | string[])[]): boolean;
759
+ /**
760
+ * Checks if multiple BCP 47 locale codes represent the same language.
761
+ *
762
+ * @param {...(string | string[])} locales - The BCP 47 locale codes to compare.
763
+ * @returns {boolean} True if all codes represent the same language, false otherwise
764
+ *
765
+ * @example
766
+ * gt.isSameLanguage('en-US', 'en-GB');
767
+ * // Returns: true
768
+ */
769
+ isSameLanguage(...locales: (string | string[])[]): boolean;
770
+ /**
771
+ * Checks if a locale is a superset of another locale.
772
+ *
773
+ * @param {string} superLocale - The locale to check if it is a superset
774
+ * @param {string} subLocale - The locale to check if it is a subset
775
+ * @returns {boolean} True if superLocale is a superset of subLocale, false otherwise
776
+ *
777
+ * @example
778
+ * gt.isSupersetLocale('en', 'en-US');
779
+ * // Returns: true
780
+ *
781
+ * gt.isSupersetLocale('en-US', 'en');
782
+ * // Returns: false
783
+ */
784
+ isSupersetLocale(superLocale: string, subLocale: string): boolean;
785
+ }
786
+ export declare const API_VERSION = "2026-03-06.v1";