generaltranslation 8.2.6 → 8.2.8

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 (162) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/ApiError-4zIP-twr.cjs +24 -0
  3. package/dist/ApiError-4zIP-twr.cjs.map +1 -0
  4. package/dist/ApiError-Bv7vlzyQ.mjs +19 -0
  5. package/dist/ApiError-Bv7vlzyQ.mjs.map +1 -0
  6. package/dist/errors.cjs +3 -0
  7. package/dist/errors.d.cts +11 -0
  8. package/dist/errors.d.mts +11 -0
  9. package/dist/errors.mjs +2 -0
  10. package/dist/id-CPbVYREY.mjs +74 -0
  11. package/dist/id-CPbVYREY.mjs.map +1 -0
  12. package/dist/id-VXBgyXu2.cjs +89 -0
  13. package/dist/id-VXBgyXu2.cjs.map +1 -0
  14. package/dist/id.cjs +5 -0
  15. package/dist/{id/hashSource.d.ts → id.d.cts} +20 -5
  16. package/dist/id.d.mts +40 -0
  17. package/dist/id.mjs +2 -0
  18. package/dist/index.cjs +3491 -0
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/index.d.cts +1219 -0
  21. package/dist/index.d.mts +1219 -0
  22. package/dist/index.mjs +3441 -0
  23. package/dist/index.mjs.map +1 -0
  24. package/dist/internal-B3QbyI_5.mjs +820 -0
  25. package/dist/internal-B3QbyI_5.mjs.map +1 -0
  26. package/dist/internal-DIHQF9gs.cjs +1070 -0
  27. package/dist/internal-DIHQF9gs.cjs.map +1 -0
  28. package/dist/internal.cjs +45 -0
  29. package/dist/{internal.d.ts → internal.d.cts} +82 -113
  30. package/dist/internal.d.mts +263 -0
  31. package/dist/internal.mjs +3 -0
  32. package/dist/sha2-DKowBr6H.cjs +747 -0
  33. package/dist/sha2-DKowBr6H.cjs.map +1 -0
  34. package/dist/stableStringify-DgDlE_pD.mjs +53 -0
  35. package/dist/stableStringify-DgDlE_pD.mjs.map +1 -0
  36. package/dist/types-BJdoI1d1.d.cts +741 -0
  37. package/dist/types-DazaDJbs.d.mts +741 -0
  38. package/dist/types.cjs +17 -0
  39. package/dist/types.cjs.map +1 -0
  40. package/dist/types.d.cts +2 -0
  41. package/dist/types.d.mts +2 -0
  42. package/dist/types.mjs +16 -0
  43. package/dist/types.mjs.map +1 -0
  44. package/package.json +52 -32
  45. package/dist/backwards-compatability/dataConversion.d.ts +0 -23
  46. package/dist/backwards-compatability/oldHashJsxChildren.d.ts +0 -23
  47. package/dist/backwards-compatability/oldTypes.d.ts +0 -21
  48. package/dist/backwards-compatability/typeChecking.d.ts +0 -21
  49. package/dist/cache/IntlCache.d.ts +0 -26
  50. package/dist/cache/types.d.ts +0 -32
  51. package/dist/derive/condenseVars.d.ts +0 -7
  52. package/dist/derive/declareVar.d.ts +0 -26
  53. package/dist/derive/decodeVars.d.ts +0 -9
  54. package/dist/derive/derive.d.ts +0 -38
  55. package/dist/derive/extractVars.d.ts +0 -9
  56. package/dist/derive/index.d.ts +0 -7
  57. package/dist/derive/indexVars.d.ts +0 -6
  58. package/dist/derive/utils/constants.d.ts +0 -2
  59. package/dist/derive/utils/regex.d.ts +0 -2
  60. package/dist/derive/utils/sanitizeVar.d.ts +0 -12
  61. package/dist/derive/utils/traverseHelpers.d.ts +0 -4
  62. package/dist/derive/utils/traverseIcu.d.ts +0 -20
  63. package/dist/derive/utils/types.d.ts +0 -23
  64. package/dist/errors/ApiError.d.ts +0 -7
  65. package/dist/errors/formattingErrors.d.ts +0 -1
  66. package/dist/errors.cjs.min.cjs +0 -2
  67. package/dist/errors.cjs.min.cjs.map +0 -1
  68. package/dist/errors.d.ts +0 -9
  69. package/dist/errors.esm.min.mjs +0 -2
  70. package/dist/errors.esm.min.mjs.map +0 -1
  71. package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +0 -59
  72. package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +0 -4
  73. package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +0 -48
  74. package/dist/formatting/format.d.ts +0 -1
  75. package/dist/id/hashTemplate.d.ts +0 -4
  76. package/dist/id/types.d.ts +0 -7
  77. package/dist/id.cjs.min.cjs +0 -2
  78. package/dist/id.cjs.min.cjs.map +0 -1
  79. package/dist/id.d.ts +0 -86
  80. package/dist/id.esm.min.mjs +0 -2
  81. package/dist/id.esm.min.mjs.map +0 -1
  82. package/dist/index.cjs.min.cjs +0 -2
  83. package/dist/index.cjs.min.cjs.map +0 -1
  84. package/dist/index.d.ts +0 -1627
  85. package/dist/index.esm.min.mjs +0 -2
  86. package/dist/index.esm.min.mjs.map +0 -1
  87. package/dist/internal.cjs.min.cjs +0 -2
  88. package/dist/internal.cjs.min.cjs.map +0 -1
  89. package/dist/internal.esm.min.mjs +0 -2
  90. package/dist/internal.esm.min.mjs.map +0 -1
  91. package/dist/locales/customLocaleMapping.d.ts +0 -11
  92. package/dist/locales/determineLocale.d.ts +0 -1
  93. package/dist/locales/getLocaleDirection.d.ts +0 -1
  94. package/dist/locales/getLocaleEmoji.d.ts +0 -2
  95. package/dist/locales/getLocaleName.d.ts +0 -1
  96. package/dist/locales/getLocaleProperties.d.ts +0 -32
  97. package/dist/locales/getPluralForm.d.ts +0 -9
  98. package/dist/locales/getRegionProperties.d.ts +0 -7
  99. package/dist/locales/isSameDialect.d.ts +0 -1
  100. package/dist/locales/isSameLanguage.d.ts +0 -1
  101. package/dist/locales/isSupersetLocale.d.ts +0 -1
  102. package/dist/locales/isValidLocale.d.ts +0 -1
  103. package/dist/locales/requiresTranslation.d.ts +0 -1
  104. package/dist/locales/resolveAliasLocale.d.ts +0 -8
  105. package/dist/locales/resolveCanonicalLocale.d.ts +0 -8
  106. package/dist/logging/errors.d.ts +0 -10
  107. package/dist/logging/logger.d.ts +0 -117
  108. package/dist/logging/warnings.d.ts +0 -2
  109. package/dist/projects/getProjectData.d.ts +0 -1
  110. package/dist/settings/plurals.d.ts +0 -3
  111. package/dist/settings/settings.d.ts +0 -2
  112. package/dist/settings/settingsUrls.d.ts +0 -3
  113. package/dist/translate/api.d.ts +0 -1
  114. package/dist/translate/awaitJobs.d.ts +0 -19
  115. package/dist/translate/checkJobStatus.d.ts +0 -8
  116. package/dist/translate/createBranch.d.ts +0 -10
  117. package/dist/translate/createTag.d.ts +0 -19
  118. package/dist/translate/downloadFileBatch.d.ts +0 -1
  119. package/dist/translate/enqueueFiles.d.ts +0 -8
  120. package/dist/translate/getOrphanedFiles.d.ts +0 -8
  121. package/dist/translate/processFileMoves.d.ts +0 -25
  122. package/dist/translate/publishFiles.d.ts +0 -17
  123. package/dist/translate/queryBranchData.d.ts +0 -3
  124. package/dist/translate/queryFileData.d.ts +0 -42
  125. package/dist/translate/querySourceFile.d.ts +0 -1
  126. package/dist/translate/setupProject.d.ts +0 -11
  127. package/dist/translate/submitUserEditDiffs.d.ts +0 -12
  128. package/dist/translate/translateMany.d.ts +0 -1
  129. package/dist/translate/uploadSourceFiles.d.ts +0 -1
  130. package/dist/translate/uploadTranslations.d.ts +0 -1
  131. package/dist/translate/utils/apiRequest.d.ts +0 -1
  132. package/dist/translate/utils/batch.d.ts +0 -52
  133. package/dist/translate/utils/fetchWithTimeout.d.ts +0 -1
  134. package/dist/translate/utils/generateRequestHeaders.d.ts +0 -2
  135. package/dist/translate/utils/handleFetchError.d.ts +0 -1
  136. package/dist/translate/utils/validateResponse.d.ts +0 -1
  137. package/dist/types-dir/api/branch.d.ts +0 -10
  138. package/dist/types-dir/api/checkFileTranslations.d.ts +0 -37
  139. package/dist/types-dir/api/downloadFile.d.ts +0 -3
  140. package/dist/types-dir/api/downloadFileBatch.d.ts +0 -34
  141. package/dist/types-dir/api/enqueueEntries.d.ts +0 -21
  142. package/dist/types-dir/api/enqueueFiles.d.ts +0 -56
  143. package/dist/types-dir/api/entry.d.ts +0 -36
  144. package/dist/types-dir/api/fetchTranslations.d.ts +0 -11
  145. package/dist/types-dir/api/file.d.ts +0 -54
  146. package/dist/types-dir/api/project.d.ts +0 -7
  147. package/dist/types-dir/api/translate.d.ts +0 -34
  148. package/dist/types-dir/api/translateMany.d.ts +0 -5
  149. package/dist/types-dir/api/translationStatus.d.ts +0 -9
  150. package/dist/types-dir/api/uploadFiles.d.ts +0 -43
  151. package/dist/types-dir/jsx/content.d.ts +0 -61
  152. package/dist/types-dir/jsx/variables.d.ts +0 -9
  153. package/dist/types-dir/transformations.d.ts +0 -8
  154. package/dist/types.cjs.min.cjs +0 -2
  155. package/dist/types.cjs.min.cjs.map +0 -1
  156. package/dist/types.d.ts +0 -652
  157. package/dist/types.esm.min.mjs +0 -2
  158. package/dist/types.esm.min.mjs.map +0 -1
  159. package/dist/utils/base64.d.ts +0 -2
  160. package/dist/utils/isVariable.d.ts +0 -2
  161. package/dist/utils/minify.d.ts +0 -2
  162. package/dist/utils/stableStringify.d.ts +0 -1
@@ -0,0 +1,1219 @@
1
+ import { $ as FileReference, A as BranchDataResult, B as FileUpload, C as ProcessMovesOptions, D as FileDataQuery, Dt as StringFormat, F as DownloadFileOptions, H as UploadFilesResponse, I as PublishFileEntry, J as DownloadFileBatchOptions, L as PublishFilesResult, M as TranslationError, Mt as CustomMapping, N as TranslationResult, O as FileDataResult, T as GetOrphanedFilesResult, U as CreateTagOptions, V as UploadFilesOptions, W as CreateTagResult, X as DownloadFileBatchResult, Y as DownloadFileBatchRequest, _ as AwaitJobsResult, at as CheckFileTranslationsOptions, et as FileReferenceIds, g as AwaitJobsOptions, h as SubmitUserEditDiffsPayload, j as TranslateManyResult, jt as LocaleProperties, k as BranchQuery, mt as TranslateOptions, n as FormatVariables, ot as FileQuery, pt as TranslateManyEntry, rt as EnqueueFilesResult, st as FileQueryResult, w as ProcessMovesResponse, x as MoveMapping, y as CheckJobStatusResult } from "./types-DazaDJbs.mjs";
2
+
3
+ //#region src/translate/setupProject.d.ts
4
+ type SetupProjectResult = {
5
+ setupJobId: string;
6
+ status: 'queued';
7
+ } | {
8
+ status: 'completed';
9
+ };
10
+ type SetupProjectOptions = {
11
+ force?: boolean;
12
+ locales?: string[];
13
+ timeoutMs?: number;
14
+ };
15
+ //#endregion
16
+ //#region src/translate/enqueueFiles.d.ts
17
+ type EnqueueOptions = {
18
+ sourceLocale?: string;
19
+ targetLocales: string[];
20
+ requireApproval?: boolean;
21
+ modelProvider?: string;
22
+ force?: boolean;
23
+ timeout?: number;
24
+ };
25
+ //#endregion
26
+ //#region src/locales/getRegionProperties.d.ts
27
+ type CustomRegionMapping = {
28
+ [region: string]: {
29
+ name?: string;
30
+ emoji?: string;
31
+ locale?: string;
32
+ };
33
+ };
34
+ //#endregion
35
+ //#region src/types-dir/api/project.d.ts
36
+ type ProjectData = {
37
+ id: string;
38
+ name: string;
39
+ orgId: string;
40
+ defaultLocale: string;
41
+ currentLocales: string[];
42
+ };
43
+ //#endregion
44
+ //#region src/translate/createBranch.d.ts
45
+ type CreateBranchQuery = {
46
+ branchName: string;
47
+ defaultBranch: boolean;
48
+ };
49
+ type CreateBranchResult = {
50
+ branch: {
51
+ id: string;
52
+ name: string;
53
+ };
54
+ };
55
+ //#endregion
56
+ //#region src/formatting/custom-formats/CutoffFormat/types.d.ts
57
+ /** Type of terminator */
58
+ type CutoffFormatStyle = 'none' | 'ellipsis';
59
+ /** Terminator options */
60
+ interface TerminatorOptions {
61
+ /** The terminator to use */
62
+ terminator?: string;
63
+ /** An optional separator between the terminator and the value */
64
+ separator?: string;
65
+ }
66
+ /** Input formatting options (for constructor) */
67
+ interface CutoffFormatOptions extends TerminatorOptions {
68
+ /** Cutoff length */
69
+ maxChars?: number;
70
+ /** Type of terminator */
71
+ style?: CutoffFormatStyle;
72
+ }
73
+ //#endregion
74
+ //#region src/LocaleConfig.d.ts
75
+ type LocaleConfigConstructorParams = {
76
+ defaultLocale?: string;
77
+ locales?: string[];
78
+ customMapping?: CustomMapping;
79
+ };
80
+ type LocalesOption = {
81
+ locales?: string | string[];
82
+ };
83
+ type WithLocales<T = object> = T & LocalesOption;
84
+ /**
85
+ * LocaleConfig is a client-safe locale and formatting helper.
86
+ *
87
+ * It intentionally does not store project IDs, API keys, runtime URLs, or any
88
+ * translation credentials. It only stores locale metadata needed to resolve
89
+ * aliases, choose formatting fallbacks, and format values with Intl.
90
+ */
91
+ declare class LocaleConfig {
92
+ readonly defaultLocale: string;
93
+ readonly locales: string[];
94
+ readonly customMapping?: CustomMapping;
95
+ constructor({
96
+ defaultLocale,
97
+ locales,
98
+ customMapping
99
+ }?: LocaleConfigConstructorParams);
100
+ private get translationLocales();
101
+ private resolveCanonicalLocaleList;
102
+ private resolveCanonicalLocaleArgs;
103
+ private toLocaleList;
104
+ private getFormattingLocales;
105
+ formatNum(value: number, targetLocale?: string, options?: WithLocales<Intl.NumberFormatOptions>): string;
106
+ formatDateTime(value: Date, targetLocale?: string, options?: WithLocales<Intl.DateTimeFormatOptions>): string;
107
+ formatCurrency(value: number, currency: string, targetLocale?: string, options?: WithLocales<Intl.NumberFormatOptions>): string;
108
+ formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, targetLocale?: string, options?: WithLocales<Intl.RelativeTimeFormatOptions>): string;
109
+ formatRelativeTimeFromDate(date: Date, targetLocale?: string, options?: WithLocales<Intl.RelativeTimeFormatOptions & {
110
+ baseDate?: Date;
111
+ }>): string;
112
+ formatCutoff(value: string, targetLocale?: string, options?: WithLocales<CutoffFormatOptions>): string;
113
+ formatMessage(message: string, targetLocale?: string, options?: WithLocales<{
114
+ variables?: FormatVariables;
115
+ dataFormat?: StringFormat;
116
+ }>): string;
117
+ formatList(array: Array<string | number>, targetLocale?: string, options?: WithLocales<Intl.ListFormatOptions>): string;
118
+ formatListToParts<T>(array: Array<T>, targetLocale?: string, options?: WithLocales<Intl.ListFormatOptions>): (string | T)[];
119
+ getLocaleName(locale: string): string;
120
+ getLocaleEmoji(locale: string): string;
121
+ getLocaleProperties(locale: string): LocaleProperties;
122
+ requiresTranslation(targetLocale: string, sourceLocale?: string, approvedLocales?: string[] | undefined): boolean;
123
+ determineLocale(locales: string | string[], approvedLocales?: string[]): string | undefined;
124
+ getLocaleDirection(locale: string): "ltr" | "rtl";
125
+ isValidLocale(locale: string): boolean;
126
+ resolveCanonicalLocale(locale: string): string;
127
+ resolveAliasLocale(locale: string): string;
128
+ standardizeLocale(locale: string): string;
129
+ isSameDialect(...locales: (string | string[])[]): boolean;
130
+ isSameLanguage(...locales: (string | string[])[]): boolean;
131
+ isSupersetLocale(superLocale: string, subLocale: string): boolean;
132
+ }
133
+ //#endregion
134
+ //#region src/index.d.ts
135
+ /**
136
+ * Type representing the constructor parameters for the GT class.
137
+ * @typedef {Object} GTConstructorParams
138
+ * @property {string} [apiKey] - The API key for accessing the translation service
139
+ * @property {string} [devApiKey] - The development API key for accessing the translation service
140
+ * @property {string} [sourceLocale] - The default source locale for translations
141
+ * @property {string} [targetLocale] - The default target locale for translations
142
+ * @property {string[]} [locales] - Array of supported locales
143
+ * @property {string} [projectId] - The project ID for the translation service
144
+ * @property {string} [baseUrl] - The base URL for the translation service
145
+ * @property {CustomMapping} [customMapping] - Custom mapping of locale codes to their names
146
+ */
147
+ type GTConstructorParams = {
148
+ apiKey?: string;
149
+ devApiKey?: string;
150
+ sourceLocale?: string;
151
+ targetLocale?: string;
152
+ locales?: string[];
153
+ projectId?: string;
154
+ baseUrl?: string;
155
+ customMapping?: CustomMapping;
156
+ };
157
+ /**
158
+ * GT is the core driver for the General Translation library.
159
+ * This class provides functionality for locale management, formatting, and translation operations.
160
+ *
161
+ * @class GT
162
+ * @description A comprehensive toolkit for handling internationalization and localization.
163
+ *
164
+ * @example
165
+ * const gt = new GT({
166
+ * sourceLocale: 'en-US',
167
+ * targetLocale: 'es-ES',
168
+ * locales: ['en-US', 'es-ES', 'fr-FR']
169
+ * });
170
+ */
171
+ declare class GT {
172
+ /** Base URL for the translation service API */
173
+ baseUrl?: string;
174
+ /** Project ID for the translation service */
175
+ projectId?: string;
176
+ /** API key for accessing the translation service */
177
+ apiKey?: string;
178
+ /** Development API key for accessing the translation service */
179
+ devApiKey?: string;
180
+ /** Source locale for translations */
181
+ sourceLocale?: string;
182
+ /** Target locale for translations */
183
+ targetLocale?: string;
184
+ /** Array of supported locales */
185
+ locales?: string[];
186
+ /** Custom mapping for locale codes to their names */
187
+ customMapping?: CustomMapping;
188
+ /** Lazily derived reverse custom mapping for alias locales */
189
+ reverseCustomMapping?: Record<string, string>;
190
+ /** Lazily derived custom mapping for regions */
191
+ customRegionMapping?: CustomRegionMapping;
192
+ /** Client-safe locale and formatting helpers (backing field) */
193
+ private _localeConfig;
194
+ /** Client-safe locale and formatting helpers */
195
+ get localeConfig(): LocaleConfig;
196
+ /**
197
+ * Constructs an instance of the GT class.
198
+ *
199
+ * @param {GTConstructorParams} [params] - The parameters for initializing the GT instance
200
+ * @throws {Error} If an invalid locale is provided
201
+ * @throws {Error} If any of the provided locales are invalid
202
+ *
203
+ * @example
204
+ * const gt = new GT({
205
+ * apiKey: 'your-api-key',
206
+ * sourceLocale: 'en-US',
207
+ * targetLocale: 'es-ES',
208
+ * locales: ['en-US', 'es-ES', 'fr-FR']
209
+ * });
210
+ */
211
+ constructor(params?: GTConstructorParams);
212
+ setConfig({
213
+ apiKey,
214
+ devApiKey,
215
+ sourceLocale,
216
+ targetLocale,
217
+ locales,
218
+ projectId,
219
+ customMapping,
220
+ baseUrl
221
+ }: GTConstructorParams): void;
222
+ private _getTranslationConfig;
223
+ private _validateAuth;
224
+ /**
225
+ * Queries branch information from the API.
226
+ *
227
+ * @param {BranchQuery} query - Object mapping the current branch and incoming branches
228
+ * @returns {Promise<BranchDataResult>} The branch information
229
+ */
230
+ queryBranchData(query: BranchQuery): Promise<BranchDataResult>;
231
+ /**
232
+ * Creates a new branch in the API. If the branch already exists, it will be returned.
233
+ *
234
+ * @param {CreateBranchQuery} query - Object mapping the branch name and default branch flag
235
+ * @returns {Promise<CreateBranchResult>} The created branch information
236
+ */
237
+ createBranch(query: CreateBranchQuery): Promise<CreateBranchResult>;
238
+ /**
239
+ * Processes file moves by cloning source files and translations with new fileIds.
240
+ * This is called when files have been moved/renamed and we want to preserve translations.
241
+ *
242
+ * @param {MoveMapping[]} moves - Array of move mappings (old fileId to new fileId)
243
+ * @param {ProcessMovesOptions} options - Options including branchId and timeout
244
+ * @returns {Promise<ProcessMovesResponse>} The move processing results
245
+ *
246
+ * @example
247
+ * const result = await gt.processFileMoves([
248
+ * { oldFileId: 'abc123', newFileId: 'def456', newFileName: 'locales/en.json' }
249
+ * ], { branchId: 'main' });
250
+ */
251
+ processFileMoves(moves: MoveMapping[], options?: ProcessMovesOptions): Promise<ProcessMovesResponse>;
252
+ /**
253
+ * Gets orphaned files for a branch - files that exist on the branch
254
+ * but whose fileIds are not in the provided list.
255
+ * Used for move detection.
256
+ *
257
+ * @param {string} branchId - The branch to check for orphaned files
258
+ * @param {string[]} fileIds - List of current file IDs (files that are NOT orphaned)
259
+ * @param {Object} options - Options including timeout
260
+ * @returns {Promise<GetOrphanedFilesResult>} The orphaned files
261
+ *
262
+ * @example
263
+ * const result = await gt.getOrphanedFiles('branch-id', ['file-1', 'file-2']);
264
+ */
265
+ getOrphanedFiles(branchId: string, fileIds: string[], options?: {
266
+ timeout?: number;
267
+ }): Promise<GetOrphanedFilesResult>;
268
+ /**
269
+ * Enqueues project setup job using the specified file references
270
+ *
271
+ * This method creates setup jobs that will process source file references
272
+ * and generate a project setup. The files parameter contains references (IDs) to source
273
+ * files that have already been uploaded via uploadSourceFiles. The setup jobs are queued
274
+ * for processing and will generate a project setup based on the source files.
275
+ *
276
+ * @param {FileReference[]} files - Array of file references containing IDs of previously uploaded source files
277
+ * @param {SetupProjectOptions} [options] - Optional settings for target locales and timeout
278
+ * @returns {Promise<SetupProjectResult>} Object containing the jobId and status
279
+ */
280
+ setupProject(files: FileReference[], options?: SetupProjectOptions): Promise<SetupProjectResult>;
281
+ /**
282
+ * Checks the current status of one or more project jobs by their unique identifiers.
283
+ *
284
+ * This method polls the API to determine whether one or more jobs are still running,
285
+ * have completed successfully, or have failed. Jobs are created after calling either enqueueFiles or setupProject.
286
+ *
287
+ * @param {string[]} jobIds - The unique identifiers of the jobs to check
288
+ * @param {number} [timeoutMs] - Optional timeout in milliseconds for the API request
289
+ * @returns {Promise<CheckJobStatusResult>} Object containing the job status
290
+ *
291
+ * @example
292
+ * const result = await gt.checkJobStatus([
293
+ * 'job-123',
294
+ * 'job-456',
295
+ * ], {
296
+ * timeout: 10000,
297
+ * });
298
+ */
299
+ checkJobStatus(jobIds: string[], timeoutMs?: number): Promise<CheckJobStatusResult>;
300
+ /**
301
+ * Polls job statuses until all jobs from enqueueFiles are finished or the timeout is reached.
302
+ *
303
+ * @param {EnqueueFilesResult} enqueueResult - The result returned from enqueueFiles
304
+ * @param {AwaitJobsOptions} [options] - Polling configuration (interval, timeout)
305
+ * @returns {Promise<AwaitJobsResult>} The final status of all jobs and whether they all completed
306
+ */
307
+ awaitJobs(enqueueResult: EnqueueFilesResult, options?: AwaitJobsOptions): Promise<AwaitJobsResult>;
308
+ /**
309
+ * Enqueues translation jobs for previously uploaded source files.
310
+ *
311
+ * This method creates translation jobs that will process existing source files
312
+ * and generate translations in the specified target languages. The files parameter
313
+ * contains references (IDs) to source files that have already been uploaded via
314
+ * uploadSourceFiles. The translation jobs are queued for processing and will
315
+ * generate translated content based on the source files and target locales provided.
316
+ *
317
+ * @param {FileReferenceIds[]} files - Array of file references containing IDs of previously uploaded source files
318
+ * @param {EnqueueOptions} options - Configuration options including source locale, target locales, and job settings
319
+ * @returns {Promise<EnqueueFilesResult>} Result containing job IDs, queue status, and processing information
320
+ */
321
+ enqueueFiles(files: FileReferenceIds[], options: EnqueueOptions): Promise<EnqueueFilesResult>;
322
+ /**
323
+ * Creates or upserts a file tag, associating a set of source files
324
+ * with a user-defined tag ID and optional message.
325
+ *
326
+ * @param {CreateTagOptions} options - Tag creation options including tagId, sourceFileIds, and optional message
327
+ * @returns {Promise<CreateTagResult>} The created or updated tag
328
+ */
329
+ createTag(options: CreateTagOptions): Promise<CreateTagResult>;
330
+ /**
331
+ * Publishes or unpublishes files on the CDN.
332
+ *
333
+ * @param {PublishFileEntry[]} files - Array of file entries with publish flags
334
+ * @returns {Promise<PublishFilesResult>} Result containing per-file success/failure
335
+ */
336
+ publishFiles(files: PublishFileEntry[]): Promise<PublishFilesResult>;
337
+ /**
338
+ * Submits user edit diffs for existing translations so future generations preserve user intent.
339
+ *
340
+ * @param {SubmitUserEditDiffsPayload} payload - Project-scoped diff payload.
341
+ * @returns {Promise<void>} Resolves when submission succeeds.
342
+ */
343
+ submitUserEditDiffs(payload: SubmitUserEditDiffsPayload): Promise<void>;
344
+ /**
345
+ * Queries data about one or more source or translation files.
346
+ *
347
+ * @param {FileDataQuery} data - Object mapping source and translation file information.
348
+ * @param {CheckFileTranslationsOptions} options - Options for the API call.
349
+ * @returns {Promise<FileDataResult>} The source and translation file data information.
350
+ *
351
+ * @example
352
+ * const result = await gt.queryFileData({
353
+ * sourceFiles: [
354
+ * { fileId: '1234567890', versionId: '1234567890', branchId: '1234567890' },
355
+ * ],
356
+ * translatedFiles: [
357
+ * { fileId: '1234567890', versionId: '1234567890', branchId: '1234567890', locale: 'es-ES' },
358
+ * ],
359
+ * }, {
360
+ * timeout: 10000,
361
+ * });
362
+ *
363
+ */
364
+ queryFileData(data: FileDataQuery, options?: CheckFileTranslationsOptions): Promise<FileDataResult>;
365
+ /**
366
+ * Gets source and translation information for a given file ID and version ID.
367
+ *
368
+ * @param {FileQuery} data - File query containing file ID and version ID.
369
+ * @param {CheckFileTranslationsOptions} options - Options for getting source and translation information.
370
+ * @returns {Promise<FileQueryResult>} The source file and translation information.
371
+ *
372
+ * @example
373
+ * const result = await gt.querySourceFile(
374
+ * { fileId: '1234567890', versionId: '1234567890' },
375
+ * { timeout: 10000 }
376
+ * );
377
+ *
378
+ */
379
+ querySourceFile(data: FileQuery, options?: CheckFileTranslationsOptions): Promise<FileQueryResult>;
380
+ /**
381
+ * Get project data for a given project ID.
382
+ *
383
+ * @param {string} projectId - The ID of the project to get the data for.
384
+ * @returns {Promise<ProjectData>} The project data.
385
+ *
386
+ * @example
387
+ * const result = await gt.getProjectData(
388
+ * '1234567890'
389
+ * );
390
+ *
391
+ */
392
+ getProjectData(projectId: string, options?: {
393
+ timeout?: number;
394
+ }): Promise<ProjectData>;
395
+ /**
396
+ * Downloads a single file.
397
+ *
398
+ * @param file - The file query object.
399
+ * @param {string} file.fileId - The ID of the file to download.
400
+ * @param {string} [file.branchId] - The ID of the branch to download the file from. If not provided, the default branch will be used.
401
+ * @param {string} [file.locale] - The locale to download the file for. If not provided, the source file will be downloaded.
402
+ * @param {string} [file.versionId] - The version ID to download the file from. If not provided, the latest version will be used.
403
+ * @param {DownloadFileOptions} options - Options for downloading the file.
404
+ * @returns {Promise<string>} The downloaded file content.
405
+ *
406
+ * @example
407
+ * const result = await gt.downloadFile({
408
+ * fileId: '1234567890',
409
+ * branchId: '1234567890',
410
+ * locale: 'es-ES',
411
+ * versionId: '1234567890',
412
+ * }, {
413
+ * timeout: 10000,
414
+ * });
415
+ */
416
+ downloadFile(file: {
417
+ fileId: string;
418
+ branchId?: string;
419
+ locale?: string;
420
+ versionId?: string;
421
+ useLatestAvailableVersion?: boolean;
422
+ }, options?: DownloadFileOptions): Promise<string>;
423
+ /**
424
+ * Downloads multiple files in a batch.
425
+ *
426
+ * @param {DownloadFileBatchRequest} requests - Array of file query objects to download.
427
+ * @param {DownloadFileBatchOptions} options - Options for the batch download.
428
+ * @returns {Promise<DownloadFileBatchResult>} The batch download results.
429
+ *
430
+ * @example
431
+ * const result = await gt.downloadFileBatch([{
432
+ * fileId: '1234567890',
433
+ * locale: 'es-ES',
434
+ * versionId: '1234567890',
435
+ * }], {
436
+ * timeout: 10000,
437
+ * });
438
+ */
439
+ downloadFileBatch(requests: DownloadFileBatchRequest, options?: DownloadFileBatchOptions): Promise<DownloadFileBatchResult>;
440
+ /**
441
+ * Translates a single source string to the target locale.
442
+ * Routes through {@link translateMany} under the hood.
443
+ *
444
+ * @param {string} source - The source string to translate.
445
+ * @param {object} options - Translation options including targetLocale and optional entry metadata.
446
+ * @returns {Promise<TranslationResult | TranslationError>} The translated content.
447
+ *
448
+ * @example
449
+ * const result = await gt.translate('Hello, world!', { targetLocale: 'es' });
450
+ *
451
+ * @example
452
+ * const result = await gt.translate('Hello, world!', {
453
+ * targetLocale: 'es',
454
+ * dataFormat: 'ICU',
455
+ * context: 'A formal greeting',
456
+ * });
457
+ */
458
+ translate(source: TranslateManyEntry, options: string | TranslateOptions, timeout?: number): Promise<TranslationResult | TranslationError>;
459
+ /**
460
+ * Translates multiple source strings to the target locale.
461
+ * Each entry can be a plain string or an object with source and metadata fields.
462
+ *
463
+ * @param {TranslateManyEntry[] | Record<string, TranslateManyEntry>} sources - The source entries to translate. Can be an array or a record keyed by hash.
464
+ * @param {object} options - Translation options including targetLocale.
465
+ * @returns {Promise<TranslateManyResult | Record<string, TranslationResult>>} The translated contents. An array if sources was an array, a record if sources was a record.
466
+ *
467
+ * @example
468
+ * const result = await gt.translateMany(
469
+ * ['Hello, world!', 'Goodbye, world!'],
470
+ * { targetLocale: 'es' }
471
+ * );
472
+ *
473
+ * @example
474
+ * const result = await gt.translateMany(
475
+ * [{ source: 'Hello, world!', dataFormat: 'ICU' }],
476
+ * { targetLocale: 'es' }
477
+ * );
478
+ *
479
+ * @example
480
+ * const result = await gt.translateMany(
481
+ * { 'my-hash': 'Hello, world!' },
482
+ * { targetLocale: 'es' }
483
+ * );
484
+ */
485
+ translateMany(sources: TranslateManyEntry[], options: string | TranslateOptions, timeout?: number): Promise<TranslateManyResult>;
486
+ translateMany(sources: Record<string, TranslateManyEntry>, options: string | TranslateOptions, timeout?: number): Promise<Record<string, TranslationResult>>;
487
+ /**
488
+ * Uploads source files to the translation service without any translation content.
489
+ *
490
+ * This method creates or replaces source file entries in your project. Each uploaded
491
+ * file becomes a source that can later be translated into target languages. The files
492
+ * are processed and stored as base entries that serve as the foundation for generating
493
+ * translations through the translation workflow.
494
+ *
495
+ * @param {Array<{source: FileUpload}>} files - Array of objects containing source file data to upload
496
+ * @param {UploadFilesOptions} options - Configuration options including source locale and other upload settings
497
+ * @returns {Promise<UploadFilesResponse>} Upload result containing file IDs, version information, and upload status
498
+ */
499
+ uploadSourceFiles(files: {
500
+ source: FileUpload;
501
+ }[], options: UploadFilesOptions): Promise<UploadFilesResponse>;
502
+ /**
503
+ * Uploads translation files that correspond to previously uploaded source files.
504
+ *
505
+ * This method allows you to provide translated content for existing source files in your project.
506
+ * Each translation must reference an existing source file and include the translated content
507
+ * along with the target locale information. This is used when you have pre-existing translations
508
+ * that you want to upload directly rather than generating them through the translation service.
509
+ *
510
+ * @param {Array<{source: FileUpload, translations: FileUpload[]}>} files - Array of file objects where:
511
+ * - `source`: Reference to the existing source file (contains IDs but no content)
512
+ * - `translations`: Array of translated files, each containing content, locale, and reference IDs
513
+ * @param {UploadFilesOptions} options - Configuration options including source locale and upload settings
514
+ * @returns {Promise<UploadFilesResponse>} Upload result containing translation IDs, status, and processing information
515
+ */
516
+ uploadTranslations(files: {
517
+ source: FileUpload;
518
+ translations: FileUpload[];
519
+ }[], options: UploadFilesOptions): Promise<UploadFilesResponse>;
520
+ /**
521
+ * Formats a string with cutoff behavior, applying a terminator when the string exceeds the maximum character limit.
522
+ *
523
+ * This method uses the GT instance's rendering locales by default for locale-specific terminator selection,
524
+ * but can be overridden with custom locales in the options.
525
+ *
526
+ * @param {string} value - The string value to format with cutoff behavior.
527
+ * @param {Object} [options] - Configuration options for cutoff formatting.
528
+ * @param {string | string[]} [options.locales] - The locales to use for terminator selection. Defaults to instance's rendering locales.
529
+ * @param {number} [options.maxChars] - The maximum number of characters to display.
530
+ * - Undefined values are treated as no cutoff.
531
+ * - Negative values follow .slice() behavior and terminator will be added before the value.
532
+ * - 0 will result in an empty string.
533
+ * - If cutoff results in an empty string, no terminator is added.
534
+ * @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.
535
+ * @param {string} [options.terminator] - Optional override the terminator to use.
536
+ * @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.
537
+ * - If no terminator is provided, then separator is ignored.
538
+ * @returns {string} The formatted string with terminator applied if cutoff occurs.
539
+ *
540
+ * @example
541
+ * const gt = new GT({ targetLocale: 'en-US' });
542
+ * gt.formatCutoff('Hello, world!', { maxChars: 8 });
543
+ * // Returns: 'Hello, w...'
544
+ *
545
+ * @example
546
+ * gt.formatCutoff('Hello, world!', { maxChars: -3 });
547
+ * // Returns: '...ld!'
548
+ */
549
+ formatCutoff(value: string, options?: {
550
+ locales?: string | string[];
551
+ } & CutoffFormatOptions): string;
552
+ /**
553
+ * Formats a message according to the specified locales and options.
554
+ *
555
+ * @param {string} message - The message to format.
556
+ * @param {string | string[]} [locales='en'] - The locales to use for formatting.
557
+ * @param {FormatVariables} [variables={}] - The variables to use for formatting.
558
+ * @param {StringFormat} [dataFormat='ICU'] - The format of the message.
559
+ * @returns {string} The formatted message.
560
+ *
561
+ * @example
562
+ * gt.formatMessage('Hello {name}', { name: 'John' });
563
+ * // Returns: "Hello John"
564
+ *
565
+ * gt.formatMessage('Hello {name}', { name: 'John' }, { locales: ['fr'] });
566
+ * // Returns: "Bonjour John"
567
+ */
568
+ formatMessage(message: string, options?: {
569
+ locales?: string | string[];
570
+ variables?: FormatVariables;
571
+ dataFormat?: StringFormat;
572
+ }): string;
573
+ /**
574
+ * Formats a number according to the specified locales and options.
575
+ *
576
+ * @param {number} number - The number to format
577
+ * @param {Object} [options] - Additional options for number formatting
578
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
579
+ * @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options
580
+ * @returns {string} The formatted number
581
+ *
582
+ * @example
583
+ * gt.formatNum(1234.56, { style: 'currency', currency: 'USD' });
584
+ * // Returns: "$1,234.56"
585
+ */
586
+ formatNum(number: number, options?: {
587
+ locales?: string | string[];
588
+ } & Intl.NumberFormatOptions): string;
589
+ /**
590
+ * Formats a date according to the specified locales and options.
591
+ *
592
+ * @param {Date} date - The date to format
593
+ * @param {Object} [options] - Additional options for date formatting
594
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
595
+ * @param {Intl.DateTimeFormatOptions} [options] - Additional Intl.DateTimeFormat options
596
+ * @returns {string} The formatted date
597
+ *
598
+ * @example
599
+ * gt.formatDateTime(new Date(), { dateStyle: 'full', timeStyle: 'long' });
600
+ * // Returns: "Thursday, March 14, 2024 at 2:30:45 PM GMT-7"
601
+ */
602
+ formatDateTime(date: Date, options?: {
603
+ locales?: string | string[];
604
+ } & Intl.DateTimeFormatOptions): string;
605
+ /**
606
+ * Formats a currency value according to the specified locales and options.
607
+ *
608
+ * @param {number} value - The currency value to format
609
+ * @param {string} currency - The currency code (e.g., 'USD', 'EUR')
610
+ * @param {Object} [options] - Additional options for currency formatting
611
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
612
+ * @param {Intl.NumberFormatOptions} [options] - Additional Intl.NumberFormat options
613
+ * @returns {string} The formatted currency value
614
+ *
615
+ * @example
616
+ * gt.formatCurrency(1234.56, 'USD', { style: 'currency' });
617
+ * // Returns: "$1,234.56"
618
+ */
619
+ formatCurrency(value: number, currency: string, options?: {
620
+ locales?: string | string[];
621
+ } & Intl.NumberFormatOptions): string;
622
+ /**
623
+ * Formats a list of items according to the specified locales and options.
624
+ *
625
+ * @param {Array<string | number>} array - The list of items to format
626
+ * @param {Object} [options] - Additional options for list formatting
627
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
628
+ * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options
629
+ * @returns {string} The formatted list
630
+ *
631
+ * @example
632
+ * gt.formatList(['apple', 'banana', 'orange'], { type: 'conjunction' });
633
+ * // Returns: "apple, banana, and orange"
634
+ */
635
+ formatList(array: Array<string | number>, options?: {
636
+ locales?: string | string[];
637
+ } & Intl.ListFormatOptions): string;
638
+ /**
639
+ * Formats a list of items according to the specified locales and options.
640
+ * @param {Array<T>} array - The list of items to format
641
+ * @param {Object} [options] - Additional options for list formatting
642
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
643
+ * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options
644
+ * @returns {Array<T | string>} The formatted list parts
645
+ *
646
+ * @example
647
+ * gt.formatListToParts(['apple', 42, { foo: 'bar' }], { type: 'conjunction', style: 'short', locales: ['en'] });
648
+ * // Returns: ['apple', ', ', 42, ' and ', '{ foo: "bar" }']
649
+ */
650
+ formatListToParts<T>(array: Array<T>, options?: {
651
+ locales?: string | string[];
652
+ } & Intl.ListFormatOptions): Array<T | string>;
653
+ /**
654
+ * Formats a relative time value according to the specified locales and options.
655
+ *
656
+ * @param {number} value - The relative time value to format
657
+ * @param {Intl.RelativeTimeFormatUnit} unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year')
658
+ * @param {Object} options - Additional options for relative time formatting
659
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
660
+ * @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options
661
+ * @returns {string} The formatted relative time string
662
+ *
663
+ * @example
664
+ * gt.formatRelativeTime(-1, 'day', { locales: ['en-US'], numeric: 'auto' });
665
+ * // Returns: "yesterday"
666
+ */
667
+ formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options?: {
668
+ locales?: string | string[];
669
+ } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
670
+ /**
671
+ * Formats a relative time string from a Date, automatically selecting the best unit.
672
+ *
673
+ * @param {Date} date - The date to format relative to now
674
+ * @param {Object} [options] - Additional options for relative time formatting
675
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
676
+ * @returns {string} The formatted relative time string (e.g., "2 hours ago", "in 3 days")
677
+ *
678
+ * @example
679
+ * gt.formatRelativeTimeFromDate(new Date(Date.now() - 3600000));
680
+ * // Returns: "1 hour ago"
681
+ */
682
+ formatRelativeTimeFromDate(date: Date, options?: {
683
+ locales?: string | string[];
684
+ baseDate?: Date;
685
+ } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
686
+ /**
687
+ * Retrieves the display name of a locale code using Intl.DisplayNames, returning an empty string if no name is found.
688
+ *
689
+ * @param {string} [locale=this.targetLocale] - A BCP-47 locale code
690
+ * @returns {string} The display name corresponding to the code
691
+ * @throws {Error} If no target locale is provided
692
+ *
693
+ * @example
694
+ * gt.getLocaleName('es-ES');
695
+ * // Returns: "Spanish (Spain)"
696
+ */
697
+ getLocaleName(locale?: string | undefined): string;
698
+ /**
699
+ * Retrieves an emoji based on a given locale code.
700
+ * Uses the locale's region (if present) to select an emoji or falls back on default emojis.
701
+ *
702
+ * @param {string} [locale=this.targetLocale] - A BCP-47 locale code (e.g., 'en-US', 'fr-CA')
703
+ * @returns {string} The emoji representing the locale or its region
704
+ * @throws {Error} If no target locale is provided
705
+ *
706
+ * @example
707
+ * gt.getLocaleEmoji('es-ES');
708
+ * // Returns: "🇪🇸"
709
+ */
710
+ getLocaleEmoji(locale?: string | undefined): string;
711
+ /**
712
+ * Generates linguistic details for a given locale code.
713
+ *
714
+ * This function returns information about the locale,
715
+ * script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).
716
+ * The function provides these names in both your default language and native forms, and an associated emoji.
717
+ *
718
+ * @param {string} [locale=this.targetLocale] - The locale code to get properties for (e.g., "de-AT").
719
+ * @returns {LocaleProperties} - An object containing detailed information about the locale.
720
+ *
721
+ * @property {string} code - The full locale code, e.g., "de-AT".
722
+ * @property {string} name - Language name in the default display language, e.g., "Austrian German".
723
+ * @property {string} nativeName - Language name in the locale's native language, e.g., "Österreichisches Deutsch".
724
+ * @property {string} languageCode - The base language code, e.g., "de".
725
+ * @property {string} languageName - The language name in the default display language, e.g., "German".
726
+ * @property {string} nativeLanguageName - The language name in the native language, e.g., "Deutsch".
727
+ * @property {string} nameWithRegionCode - Language name with region in the default language, e.g., "German (AT)".
728
+ * @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., "Deutsch (AT)".
729
+ * @property {string} regionCode - The region code from maximization, e.g., "AT".
730
+ * @property {string} regionName - The region name in the default display language, e.g., "Austria".
731
+ * @property {string} nativeRegionName - The region name in the native language, e.g., "Österreich".
732
+ * @property {string} scriptCode - The script code from maximization, e.g., "Latn".
733
+ * @property {string} scriptName - The script name in the default display language, e.g., "Latin".
734
+ * @property {string} nativeScriptName - The script name in the native language, e.g., "Lateinisch".
735
+ * @property {string} maximizedCode - The maximized locale code, e.g., "de-Latn-AT".
736
+ * @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., "Austrian German (Latin)".
737
+ * @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., "Österreichisches Deutsch (Lateinisch)".
738
+ * @property {string} minimizedCode - Minimized locale code, e.g., "de-AT" (or "de" for "de-DE").
739
+ * @property {string} minimizedName - Minimized language name in the default language, e.g., "Austrian German".
740
+ * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "Österreichisches Deutsch".
741
+ * @property {string} emoji - The emoji associated with the locale's region, if applicable.
742
+ */
743
+ getLocaleProperties(locale?: string | undefined): LocaleProperties;
744
+ /**
745
+ * Retrieves multiple properties for a given region code, including:
746
+ * - `code`: the original region code
747
+ * - `name`: the localized display name
748
+ * - `emoji`: the associated flag or symbol
749
+ *
750
+ * Behavior:
751
+ * - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `"US"`, `"FR"`, `"419"`).
752
+ * - Uses the instance's `targetLocale` to localize the region name for the user.
753
+ * - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.
754
+ * - Otherwise, uses `Intl.DisplayNames` to get the localized region name, falling back to `libraryDefaultLocale`.
755
+ * - Falls back to the region code as `name` if display name resolution fails.
756
+ * - Falls back to a default emoji if no emoji mapping is found in built-in data or `customMapping`.
757
+ *
758
+ * @param {string} [region=this.getLocaleProperties().regionCode] - The region code to look up (e.g., `"US"`, `"GB"`, `"DE"`).
759
+ * @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.
760
+ * @returns {{ code: string, name: string, emoji: string }} An object containing:
761
+ * - `code`: the input region code
762
+ * - `name`: the localized or custom region name
763
+ * - `emoji`: the matching emoji flag or symbol
764
+ *
765
+ * @throws {Error} If no target locale is available to determine region properties.
766
+ *
767
+ * @example
768
+ * const gt = new GT({ targetLocale: 'en-US' });
769
+ * gt.getRegionProperties('US');
770
+ * // => { code: 'US', name: 'United States', emoji: '🇺🇸' }
771
+ *
772
+ * @example
773
+ * const gt = new GT({ targetLocale: 'fr-FR' });
774
+ * gt.getRegionProperties('US');
775
+ * // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }
776
+ *
777
+ * @example
778
+ * gt.getRegionProperties('US', { US: { name: 'USA', emoji: '🗽' } });
779
+ * // => { code: 'US', name: 'USA', emoji: '🗽' }
780
+ */
781
+ getRegionProperties(region?: string, customMapping?: CustomRegionMapping): {
782
+ code: string;
783
+ name: string;
784
+ emoji: string;
785
+ };
786
+ /**
787
+ * Determines whether a translation is required based on the source and target locales.
788
+ *
789
+ * @param {string} [sourceLocale=this.sourceLocale] - The locale code for the original content
790
+ * @param {string} [targetLocale=this.targetLocale] - The locale code to translate into
791
+ * @param {string[]} [approvedLocales=this.locales] - Optional array of approved target locales
792
+ * @returns {boolean} True if translation is required, false otherwise
793
+ * @throws {Error} If no source locale is provided
794
+ * @throws {Error} If no target locale is provided
795
+ *
796
+ * @example
797
+ * gt.requiresTranslation('en-US', 'es-ES');
798
+ * // Returns: true
799
+ */
800
+ requiresTranslation(sourceLocale?: string | undefined, targetLocale?: string | undefined, approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): boolean;
801
+ /**
802
+ * Determines the best matching locale from the provided approved locales list.
803
+ *
804
+ * @param {string | string[]} locales - A single locale or array of locales in preference order
805
+ * @param {string[]} [approvedLocales=this.locales] - Array of approved locales in preference order
806
+ * @returns {string | undefined} The best matching locale or undefined if no match is found
807
+ *
808
+ * @example
809
+ * gt.determineLocale(['fr-CA', 'fr-FR'], ['en-US', 'fr-FR', 'es-ES']);
810
+ * // Returns: "fr-FR"
811
+ */
812
+ determineLocale(locales: string | string[], approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): string | undefined;
813
+ /**
814
+ * Gets the text direction for a given locale code.
815
+ *
816
+ * @param {string} [locale=this.targetLocale] - A BCP-47 locale code
817
+ * @returns {'ltr' | 'rtl'} 'rtl' if the locale is right-to-left, otherwise 'ltr'
818
+ * @throws {Error} If no target locale is provided
819
+ *
820
+ * @example
821
+ * gt.getLocaleDirection('ar-SA');
822
+ * // Returns: "rtl"
823
+ */
824
+ getLocaleDirection(locale?: string | undefined): 'ltr' | 'rtl';
825
+ /**
826
+ * Checks if a given BCP 47 locale code is valid.
827
+ *
828
+ * @param {string} [locale=this.targetLocale] - The BCP 47 locale code to validate
829
+ * @param {customMapping} [customMapping=this.customMapping] - The custom mapping to use for validation
830
+ * @returns {boolean} True if the locale code is valid, false otherwise
831
+ * @throws {Error} If no target locale is provided
832
+ *
833
+ * @example
834
+ * gt.isValidLocale('en-US');
835
+ * // Returns: true
836
+ */
837
+ isValidLocale(locale?: string | undefined, customMapping?: CustomMapping | undefined): boolean;
838
+ /**
839
+ * Resolves the canonical locale for a given locale.
840
+ * @param locale - The locale to resolve the canonical locale for
841
+ * @param customMapping - The custom mapping to use for resolving the canonical locale
842
+ * @returns The canonical locale
843
+ */
844
+ resolveCanonicalLocale(locale?: string | undefined, customMapping?: CustomMapping | undefined): string;
845
+ /**
846
+ * Resolves the alias locale for a given locale.
847
+ * @param locale - The locale to resolve the alias locale for
848
+ * @param customMapping - The custom mapping to use for resolving the alias locale
849
+ * @returns The alias locale
850
+ */
851
+ resolveAliasLocale(locale: string, customMapping?: CustomMapping | undefined): string;
852
+ /**
853
+ * Standardizes a BCP 47 locale code to ensure correct formatting.
854
+ *
855
+ * @param {string} [locale=this.targetLocale] - The BCP 47 locale code to standardize
856
+ * @returns {string} The standardized locale code or empty string if invalid
857
+ * @throws {Error} If no target locale is provided
858
+ *
859
+ * @example
860
+ * gt.standardizeLocale('en_us');
861
+ * // Returns: "en-US"
862
+ */
863
+ standardizeLocale(locale?: string | undefined): string;
864
+ /**
865
+ * Checks if multiple BCP 47 locale codes represent the same dialect.
866
+ *
867
+ * @param {...(string | string[])} locales - The BCP 47 locale codes to compare
868
+ * @returns {boolean} True if all codes represent the same dialect, false otherwise
869
+ *
870
+ * @example
871
+ * gt.isSameDialect('en-US', 'en-GB');
872
+ * // Returns: false
873
+ *
874
+ * gt.isSameDialect('en', 'en-US');
875
+ * // Returns: true
876
+ */
877
+ isSameDialect(...locales: (string | string[])[]): boolean;
878
+ /**
879
+ * Checks if multiple BCP 47 locale codes represent the same language.
880
+ *
881
+ * @param {...(string | string[])} locales - The BCP 47 locale codes to compare
882
+ * @returns {boolean} True if all codes represent the same language, false otherwise
883
+ *
884
+ * @example
885
+ * gt.isSameLanguage('en-US', 'en-GB');
886
+ * // Returns: true
887
+ */
888
+ isSameLanguage(...locales: (string | string[])[]): boolean;
889
+ /**
890
+ * Checks if a locale is a superset of another locale.
891
+ *
892
+ * @param {string} superLocale - The locale to check if it is a superset
893
+ * @param {string} subLocale - The locale to check if it is a subset
894
+ * @returns {boolean} True if superLocale is a superset of subLocale, false otherwise
895
+ *
896
+ * @example
897
+ * gt.isSupersetLocale('en', 'en-US');
898
+ * // Returns: true
899
+ *
900
+ * gt.isSupersetLocale('en-US', 'en');
901
+ * // Returns: false
902
+ */
903
+ isSupersetLocale(superLocale: string, subLocale: string): boolean;
904
+ }
905
+ /**
906
+ * Formats a string with cutoff behavior, applying a terminator when the string exceeds the maximum character limit.
907
+ *
908
+ * This standalone function provides cutoff formatting functionality without requiring a GT instance.
909
+ * The locales parameter is required for proper terminator selection based on the target language.
910
+ *
911
+ * @param {string} value - The string value to format with cutoff behavior.
912
+ * @param {Object} [options] - Configuration options for cutoff formatting.
913
+ * @param {string | string[]} [options.locales] - The locales to use for terminator selection.
914
+ * @param {number} [options.maxChars] - The maximum number of characters to display.
915
+ * - Undefined values are treated as no cutoff.
916
+ * - Negative values follow .slice() behavior and terminator will be added before the value.
917
+ * - 0 will result in an empty string.
918
+ * - If cutoff results in an empty string, no terminator is added.
919
+ * @param {CutoffFormatStyle} [options.style='ellipsis'] - The style of the terminator.
920
+ * @param {string} [options.terminator] - Optional override the terminator to use.
921
+ * @param {string} [options.separator] - Optional override the separator to use between the terminator and the value.
922
+ * - If no terminator is provided, then separator is ignored.
923
+ * @returns {string} The formatted string with terminator applied if cutoff occurs.
924
+ *
925
+ * @example
926
+ * formatCutoff('Hello, world!', { locales: 'en-US', maxChars: 8 });
927
+ * // Returns: 'Hello, w...'
928
+ *
929
+ * @example
930
+ * formatCutoff('Hello, world!', { locales: 'en-US', maxChars: -3 });
931
+ * // Returns: '...ld!'
932
+ *
933
+ * @example
934
+ * formatCutoff('Very long text that needs cutting', {
935
+ * locales: 'en-US',
936
+ * maxChars: 15,
937
+ * style: 'ellipsis',
938
+ * separator: ' '
939
+ * });
940
+ * // Returns: 'Very long text ...'
941
+ */
942
+ declare function formatCutoff(value: string, options?: {
943
+ locales?: string | string[];
944
+ } & CutoffFormatOptions): string;
945
+ /**
946
+ * Formats a message according to the specified locales and options.
947
+ *
948
+ * @param {string} message - The message to format.
949
+ * @param {string | string[]} [locales='en'] - The locales to use for formatting.
950
+ * @param {FormatVariables} [variables={}] - The variables to use for formatting.
951
+ * @param {StringFormat} [dataFormat='ICU'] - The format of the message. (When STRING, the message is returned as is)
952
+ * @returns {string} The formatted message.
953
+ *
954
+ * @example
955
+ * formatMessage('Hello {name}', { name: 'John' });
956
+ * // Returns: "Hello John"
957
+ *
958
+ * formatMessage('Hello {name}', { name: 'John' }, { locales: ['fr'] });
959
+ * // Returns: "Bonjour John"
960
+ */
961
+ declare function formatMessage(message: string, options?: {
962
+ locales?: string | string[];
963
+ variables?: FormatVariables;
964
+ dataFormat?: StringFormat;
965
+ }): string;
966
+ /**
967
+ * Formats a number according to the specified locales and options.
968
+ * @param {Object} params - The parameters for the number formatting.
969
+ * @param {number} params.value - The number to format.
970
+ * @param {Intl.NumberFormatOptions} [params.options] - Additional options for number formatting.
971
+ * @param {string | string[]} [params.options.locales] - The locales to use for formatting.
972
+ * @returns {string} The formatted number.
973
+ */
974
+ declare function formatNum(number: number, options: {
975
+ locales: string | string[];
976
+ } & Intl.NumberFormatOptions): string;
977
+ /**
978
+ * Formats a date according to the specified languages and options.
979
+ * @param {Object} params - The parameters for the date formatting.
980
+ * @param {Date} params.value - The date to format.
981
+ * @param {Intl.DateTimeFormatOptions} [params.options] - Additional options for date formatting.
982
+ * @param {string | string[]} [params.options.locales] - The languages to use for formatting.
983
+ * @returns {string} The formatted date.
984
+ */
985
+ declare function formatDateTime(date: Date, options?: {
986
+ locales?: string | string[];
987
+ } & Intl.DateTimeFormatOptions): string;
988
+ /**
989
+ * Formats a currency value according to the specified languages, currency, and options.
990
+ * @param {Object} params - The parameters for the currency formatting.
991
+ * @param {number} params.value - The currency value to format.
992
+ * @param {string} params.currency - The currency code (e.g., 'USD').
993
+ * @param {Intl.NumberFormatOptions} [params.options={}] - Additional options for currency formatting.
994
+ * @param {string | string[]} [params.options.locales] - The locale codes to use for formatting.
995
+ * @returns {string} The formatted currency value.
996
+ */
997
+ declare function formatCurrency(value: number, currency: string, options: {
998
+ locales: string | string[];
999
+ } & Intl.NumberFormatOptions): string;
1000
+ /**
1001
+ * Formats a list of items according to the specified locales and options.
1002
+ * @param {Object} params - The parameters for the list formatting.
1003
+ * @param {Array<string | number>} params.value - The list of items to format.
1004
+ * @param {Intl.ListFormatOptions} [params.options={}] - Additional options for list formatting.
1005
+ * @param {string | string[]} [params.options.locales] - The locales to use for formatting.
1006
+ * @returns {string} The formatted list.
1007
+ */
1008
+ declare function formatList(array: Array<string | number>, options: {
1009
+ locales: string | string[];
1010
+ } & Intl.ListFormatOptions): string;
1011
+ /**
1012
+ * Formats a list of items according to the specified locales and options.
1013
+ * @param {Array<T>} array - The list of items to format
1014
+ * @param {Object} [options] - Additional options for list formatting
1015
+ * @param {string | string[]} [options.locales] - The locales to use for formatting
1016
+ * @param {Intl.ListFormatOptions} [options] - Additional Intl.ListFormat options
1017
+ * @returns {Array<T | string>} The formatted list parts
1018
+ */
1019
+ declare function formatListToParts<T>(array: Array<T>, options?: {
1020
+ locales?: string | string[];
1021
+ } & Intl.ListFormatOptions): Array<T | string>;
1022
+ /**
1023
+ * Formats a relative time value according to the specified locales and options.
1024
+ * @param {Object} params - The parameters for the relative time formatting.
1025
+ * @param {number} params.value - The relative time value to format.
1026
+ * @param {Intl.RelativeTimeFormatUnit} params.unit - The unit of time (e.g., 'second', 'minute', 'hour', 'day', 'week', 'month', 'year').
1027
+ * @param {Intl.RelativeTimeFormatOptions} [params.options={}] - Additional options for relative time formatting.
1028
+ * @param {string | string[]} [params.options.locales] - The locales to use for formatting.
1029
+ * @returns {string} The formatted relative time string.
1030
+ */
1031
+ declare function formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options: {
1032
+ locales: string | string[];
1033
+ } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
1034
+ /**
1035
+ * Formats a relative time string from a Date, automatically selecting the best unit.
1036
+ * @param {Date} date - The date to format relative to now.
1037
+ * @param {Object} options - Formatting options.
1038
+ * @param {string | string[]} options.locales - The locales to use for formatting.
1039
+ * @param {Intl.RelativeTimeFormatOptions} [options] - Additional Intl.RelativeTimeFormat options.
1040
+ * @returns {string} The formatted relative time string (e.g., "2 hours ago", "in 3 days").
1041
+ */
1042
+ declare function formatRelativeTimeFromDate(date: Date, options: {
1043
+ locales: string | string[];
1044
+ baseDate?: Date;
1045
+ } & Omit<Intl.RelativeTimeFormatOptions, 'locales'>): string;
1046
+ /**
1047
+ * Retrieves the display name of locale code using Intl.DisplayNames.
1048
+ *
1049
+ * @param {string} locale - A BCP-47 locale code.
1050
+ * @param {string} [defaultLocale] - The default locale to use for formatting.
1051
+ * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
1052
+ * @returns {string} The display name corresponding to the code.
1053
+ */
1054
+ declare function getLocaleName(locale: string, defaultLocale?: string, customMapping?: CustomMapping): string;
1055
+ /**
1056
+ * Retrieves an emoji based on a given locale code, taking into account region, language, and specific exceptions.
1057
+ *
1058
+ * This function uses the locale's region (if present) to select an emoji or falls back on default emojis for certain languages.
1059
+ *
1060
+ * @param locale - A string representing the locale code (e.g., 'en-US', 'fr-CA').
1061
+ * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
1062
+ * @returns The emoji representing the locale or its region, or a default emoji if no specific match is found.
1063
+ */
1064
+ declare function getLocaleEmoji(locale: string, customMapping?: CustomMapping): string;
1065
+ /**
1066
+ * Generates linguistic details for a given locale code.
1067
+ *
1068
+ * This function returns information about the locale,
1069
+ * script, and region of a given language code both in a standard form and in a maximized form (with likely script and region).
1070
+ * The function provides these names in both your default language and native forms, and an associated emoji.
1071
+ *
1072
+ * @param {string} locale - The locale code to get properties for (e.g., "de-AT").
1073
+ * @param {string} [defaultLocale] - The default locale to use for formatting.
1074
+ * @param {CustomMapping} [customMapping] - A custom mapping of locale codes to their names.
1075
+ * @returns {LocaleProperties} - An object containing detailed information about the locale.
1076
+ *
1077
+ * @property {string} code - The full locale code, e.g., "de-AT".
1078
+ * @property {string} name - Language name in the default display language, e.g., "Austrian German".
1079
+ * @property {string} nativeName - Language name in the locale's native language, e.g., "Österreichisches Deutsch".
1080
+ * @property {string} languageCode - The base language code, e.g., "de".
1081
+ * @property {string} languageName - The language name in the default display language, e.g., "German".
1082
+ * @property {string} nativeLanguageName - The language name in the native language, e.g., "Deutsch".
1083
+ * @property {string} nameWithRegionCode - Language name with region in the default language, e.g., "German (AT)".
1084
+ * @property {string} nativeNameWithRegionCode - Language name with region in the native language, e.g., "Deutsch (AT)".
1085
+ * @property {string} regionCode - The region code from maximization, e.g., "AT".
1086
+ * @property {string} regionName - The region name in the default display language, e.g., "Austria".
1087
+ * @property {string} nativeRegionName - The region name in the native language, e.g., "Österreich".
1088
+ * @property {string} scriptCode - The script code from maximization, e.g., "Latn".
1089
+ * @property {string} scriptName - The script name in the default display language, e.g., "Latin".
1090
+ * @property {string} nativeScriptName - The script name in the native language, e.g., "Lateinisch".
1091
+ * @property {string} maximizedCode - The maximized locale code, e.g., "de-Latn-AT".
1092
+ * @property {string} maximizedName - Maximized locale name with likely script in the default language, e.g., "Austrian German (Latin)".
1093
+ * @property {string} nativeMaximizedName - Maximized locale name in the native language, e.g., "Österreichisches Deutsch (Lateinisch)".
1094
+ * @property {string} minimizedCode - Minimized locale code, e.g., "de-AT" (or "de" for "de-DE").
1095
+ * @property {string} minimizedName - Minimized language name in the default language, e.g., "Austrian German".
1096
+ * @property {string} nativeMinimizedName - Minimized language name in the native language, e.g., "Österreichisches Deutsch".
1097
+ * @property {string} emoji - The emoji associated with the locale's region, if applicable.
1098
+ */
1099
+ declare function getLocaleProperties(locale: string, defaultLocale?: string, customMapping?: CustomMapping): LocaleProperties;
1100
+ /**
1101
+ * Retrieves multiple properties for a given region code, including:
1102
+ * - `code`: the original region code
1103
+ * - `name`: the localized display name
1104
+ * - `emoji`: the associated flag or symbol
1105
+ *
1106
+ * Behavior:
1107
+ * - Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (e.g., `"US"`, `"FR"`, `"419"`).
1108
+ * - If `customMapping` contains a `name` or `emoji` for the region, those override the default values.
1109
+ * - Otherwise, uses `Intl.DisplayNames` to get the localized region name in the given `defaultLocale`,
1110
+ * falling back to `libraryDefaultLocale`.
1111
+ * - Falls back to the region code as `name` if display name resolution fails.
1112
+ * - Falls back to `defaultEmoji` if no emoji mapping is found in `emojis` or `customMapping`.
1113
+ *
1114
+ * @param {string} region - The region code to look up (e.g., `"US"`, `"GB"`, `"DE"`).
1115
+ * @param {string} [defaultLocale=libraryDefaultLocale] - The locale to use when localizing the region name.
1116
+ * @param {CustomRegionMapping} [customMapping] - Optional mapping of region codes to custom names and/or emojis.
1117
+ * @returns {{ code: string, name: string, emoji: string }} An object containing:
1118
+ * - `code`: the input region code
1119
+ * - `name`: the localized or custom region name
1120
+ * - `emoji`: the matching emoji flag or symbol
1121
+ *
1122
+ * @example
1123
+ * getRegionProperties('US', 'en');
1124
+ * // => { code: 'US', name: 'United States', emoji: '🇺🇸' }
1125
+ *
1126
+ * @example
1127
+ * getRegionProperties('US', 'fr');
1128
+ * // => { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }
1129
+ *
1130
+ * @example
1131
+ * getRegionProperties('US', 'en', { US: { name: 'USA', emoji: '🗽' } });
1132
+ * // => { code: 'US', name: 'USA', emoji: '🗽' }
1133
+ */
1134
+ declare function getRegionProperties(region: string, defaultLocale?: string, customMapping?: CustomRegionMapping): {
1135
+ code: string;
1136
+ name: string;
1137
+ emoji: string;
1138
+ };
1139
+ /**
1140
+ * Determines whether a translation is required based on the source and target locales.
1141
+ *
1142
+ * - If the target locale is not specified, the function returns `false`, as translation is not needed.
1143
+ * - If the source and target locale are the same, returns `false`, indicating that no translation is necessary.
1144
+ * - If the `approvedLocales` array is provided, and the target locale is not within that array, the function also returns `false`.
1145
+ * - Otherwise, it returns `true`, meaning that a translation is required.
1146
+ *
1147
+ * @param {string} sourceLocale - The locale code for the original content (BCP 47 locale code).
1148
+ * @param {string} targetLocale - The locale code of the language to translate the content into (BCP 47 locale code).
1149
+ * @param {string[]} [approvedLocale] - An optional array of approved target locales.
1150
+ *
1151
+ * @returns {boolean} - Returns `true` if translation is required, otherwise `false`.
1152
+ */
1153
+ declare function requiresTranslation(sourceLocale: string, targetLocale: string, approvedLocales?: string[], customMapping?: CustomMapping): boolean;
1154
+ /**
1155
+ * Determines the best matching locale from the provided approved locales list.
1156
+ * @param {string | string[]} locales - A single locale or an array of locales sorted in preference order.
1157
+ * @param {string[]} [approvedLocales=this.locales] - An array of approved locales, also sorted by preference.
1158
+ * @returns {string | undefined} - The best matching locale from the approvedLocales list, or undefined if no match is found.
1159
+ */
1160
+ declare function determineLocale(locales: string | string[], approvedLocales?: string[] | undefined, customMapping?: CustomMapping | undefined): string | undefined;
1161
+ /**
1162
+ * Get the text direction for a given locale code using the Intl.Locale API.
1163
+ *
1164
+ * @param {string} locale - A BCP-47 locale code.
1165
+ * @returns {string} - 'rtl' if the locale is right-to-left, otherwise 'ltr'.
1166
+ */
1167
+ declare function getLocaleDirection(locale: string): 'ltr' | 'rtl';
1168
+ /**
1169
+ * Checks if a given BCP 47 locale code is valid.
1170
+ * @param {string} locale - The BCP 47 locale code to validate.
1171
+ * @param {CustomMapping} [customMapping] - The custom mapping to use for validation.
1172
+ * @returns {boolean} True if the BCP 47 code is valid, false otherwise.
1173
+ */
1174
+ declare function isValidLocale(locale: string, customMapping?: CustomMapping): boolean;
1175
+ /**
1176
+ * Resolves the alias locale for a given locale.
1177
+ * @param {string} locale - The locale to resolve the alias locale for
1178
+ * @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the alias locale
1179
+ * @returns {string} The alias locale
1180
+ */
1181
+ declare function resolveAliasLocale(locale: string, customMapping?: CustomMapping): string;
1182
+ /**
1183
+ * Resolves the canonical locale for a given locale.
1184
+ * @param {string} locale - The locale to resolve the canonical locale for
1185
+ * @param {CustomMapping} [customMapping] - The custom mapping to use for resolving the canonical locale
1186
+ * @returns {string} The canonical locale
1187
+ */
1188
+ declare function resolveCanonicalLocale(locale: string, customMapping?: CustomMapping): string;
1189
+ /**
1190
+ * Standardizes a BCP 47 locale code to ensure correct formatting.
1191
+ * @param {string} locale - The BCP 47 locale code to standardize.
1192
+ * @returns {string} The standardized BCP 47 locale code or an empty string if it is an invalid code.
1193
+ */
1194
+ declare function standardizeLocale(locale: string): string;
1195
+ /**
1196
+ * Checks if multiple BCP 47 locale codes represent the same dialect.
1197
+ * @param {string[]} locales - The BCP 47 locale codes to compare.
1198
+ * @returns {boolean} True if all BCP 47 codes represent the same dialect, false otherwise.
1199
+ */
1200
+ declare function isSameDialect(...locales: (string | string[])[]): boolean;
1201
+ /**
1202
+ * Checks if multiple BCP 47 locale codes represent the same language.
1203
+ * @param {string[]} locales - The BCP 47 locale codes to compare.
1204
+ * @returns {boolean} True if all BCP 47 codes represent the same language, false otherwise.
1205
+ */
1206
+ declare function isSameLanguage(...locales: (string | string[])[]): boolean;
1207
+ /**
1208
+ * Checks if a locale is a superset of another locale.
1209
+ * A subLocale is a subset of superLocale if it is an extension of superLocale or are otherwise identical.
1210
+ *
1211
+ * @param {string} superLocale - The locale to check if it is a superset of the other locale.
1212
+ * @param {string} subLocale - The locale to check if it is a subset of the other locale.
1213
+ * @returns {boolean} True if the first locale is a superset of the second locale, false otherwise.
1214
+ */
1215
+ declare function isSupersetLocale(superLocale: string, subLocale: string): boolean;
1216
+ declare const API_VERSION = "2026-03-06.v1";
1217
+ //#endregion
1218
+ export { API_VERSION, GT, LocaleConfig, type LocaleConfigConstructorParams, determineLocale, formatCurrency, formatCutoff, formatDateTime, formatList, formatListToParts, formatMessage, formatNum, formatRelativeTime, formatRelativeTimeFromDate, getLocaleDirection, getLocaleEmoji, getLocaleName, getLocaleProperties, getRegionProperties, isSameDialect, isSameLanguage, isSupersetLocale, isValidLocale, requiresTranslation, resolveAliasLocale, resolveCanonicalLocale, standardizeLocale };
1219
+ //# sourceMappingURL=index.d.mts.map