gt-react 10.19.15 → 10.19.17

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 (170) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/browser.cjs +10914 -0
  3. package/dist/browser.cjs.map +1 -0
  4. package/dist/browser.d.cts +699 -0
  5. package/dist/browser.d.cts.map +1 -0
  6. package/dist/browser.d.mts +701 -0
  7. package/dist/browser.d.mts.map +1 -0
  8. package/dist/browser.mjs +10877 -0
  9. package/dist/browser.mjs.map +1 -0
  10. package/dist/client.cjs +3451 -0
  11. package/dist/client.cjs.map +1 -0
  12. package/dist/client.d.cts +248 -0
  13. package/dist/client.d.cts.map +1 -0
  14. package/dist/client.d.mts +249 -0
  15. package/dist/client.d.mts.map +1 -0
  16. package/dist/client.mjs +3392 -0
  17. package/dist/client.mjs.map +1 -0
  18. package/dist/index.cjs +3691 -0
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/index.d.cts +377 -0
  21. package/dist/index.d.cts.map +1 -0
  22. package/dist/index.d.mts +376 -0
  23. package/dist/index.d.mts.map +1 -0
  24. package/dist/index.mjs +3636 -0
  25. package/dist/index.mjs.map +1 -0
  26. package/dist/internal.cjs +4046 -0
  27. package/dist/internal.cjs.map +1 -0
  28. package/dist/internal.d.cts +1118 -0
  29. package/dist/internal.d.cts.map +1 -0
  30. package/dist/internal.d.mts +1118 -0
  31. package/dist/internal.d.mts.map +1 -0
  32. package/dist/internal.mjs +3985 -0
  33. package/dist/internal.mjs.map +1 -0
  34. package/dist/macros.cjs +6206 -0
  35. package/dist/macros.cjs.map +1 -0
  36. package/dist/macros.d.cts +25 -0
  37. package/dist/macros.d.cts.map +1 -0
  38. package/dist/macros.d.mts +25 -0
  39. package/dist/macros.d.mts.map +1 -0
  40. package/dist/macros.mjs +6207 -0
  41. package/dist/macros.mjs.map +1 -0
  42. package/package.json +61 -41
  43. package/dist/browser-types.d.ts +0 -5
  44. package/dist/browser-types.d.ts.map +0 -1
  45. package/dist/browser.cjs.min.cjs +0 -2
  46. package/dist/browser.cjs.min.cjs.map +0 -1
  47. package/dist/browser.d.ts +0 -4
  48. package/dist/browser.d.ts.map +0 -1
  49. package/dist/browser.esm.min.mjs +0 -2
  50. package/dist/browser.esm.min.mjs.map +0 -1
  51. package/dist/client.cjs.min.cjs +0 -2
  52. package/dist/client.cjs.min.cjs.map +0 -1
  53. package/dist/client.d.ts +0 -6
  54. package/dist/client.d.ts.map +0 -1
  55. package/dist/client.esm.min.mjs +0 -2
  56. package/dist/client.esm.min.mjs.map +0 -1
  57. package/dist/i18n-context/browser-i18n-manager/BrowserConditionStore.d.ts +0 -32
  58. package/dist/i18n-context/browser-i18n-manager/BrowserConditionStore.d.ts.map +0 -1
  59. package/dist/i18n-context/browser-i18n-manager/BrowserI18nManager.d.ts +0 -42
  60. package/dist/i18n-context/browser-i18n-manager/BrowserI18nManager.d.ts.map +0 -1
  61. package/dist/i18n-context/browser-i18n-manager/LocalStorageTranslationCache.d.ts +0 -90
  62. package/dist/i18n-context/browser-i18n-manager/LocalStorageTranslationCache.d.ts.map +0 -1
  63. package/dist/i18n-context/browser-i18n-manager/singleton-operations.d.ts +0 -9
  64. package/dist/i18n-context/browser-i18n-manager/singleton-operations.d.ts.map +0 -1
  65. package/dist/i18n-context/browser-i18n-manager/utils/constants.d.ts +0 -3
  66. package/dist/i18n-context/browser-i18n-manager/utils/constants.d.ts.map +0 -1
  67. package/dist/i18n-context/browser-i18n-manager/utils/cookies.d.ts +0 -19
  68. package/dist/i18n-context/browser-i18n-manager/utils/cookies.d.ts.map +0 -1
  69. package/dist/i18n-context/browser-i18n-manager/utils/determineLocale.d.ts +0 -15
  70. package/dist/i18n-context/browser-i18n-manager/utils/determineLocale.d.ts.map +0 -1
  71. package/dist/i18n-context/browser-i18n-manager/utils/types.d.ts +0 -14
  72. package/dist/i18n-context/browser-i18n-manager/utils/types.d.ts.map +0 -1
  73. package/dist/i18n-context/functions/branching/GtInternalBranch.d.ts +0 -29
  74. package/dist/i18n-context/functions/branching/GtInternalBranch.d.ts.map +0 -1
  75. package/dist/i18n-context/functions/branching/GtInternalPlural.d.ts +0 -30
  76. package/dist/i18n-context/functions/branching/GtInternalPlural.d.ts.map +0 -1
  77. package/dist/i18n-context/functions/branching/index.d.ts +0 -3
  78. package/dist/i18n-context/functions/branching/index.d.ts.map +0 -1
  79. package/dist/i18n-context/functions/derivation/GtInternalDerive.d.ts +0 -31
  80. package/dist/i18n-context/functions/derivation/GtInternalDerive.d.ts.map +0 -1
  81. package/dist/i18n-context/functions/derivation/index.d.ts +0 -2
  82. package/dist/i18n-context/functions/derivation/index.d.ts.map +0 -1
  83. package/dist/i18n-context/functions/html-tag-operations.d.ts +0 -19
  84. package/dist/i18n-context/functions/html-tag-operations.d.ts.map +0 -1
  85. package/dist/i18n-context/functions/index.d.ts +0 -8
  86. package/dist/i18n-context/functions/index.d.ts.map +0 -1
  87. package/dist/i18n-context/functions/locale-operations.d.ts +0 -11
  88. package/dist/i18n-context/functions/locale-operations.d.ts.map +0 -1
  89. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateJsx.d.ts +0 -11
  90. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateJsx.d.ts.map +0 -1
  91. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateString.d.ts +0 -11
  92. package/dist/i18n-context/functions/translation/GtInternalRuntimeTranslateString.d.ts.map +0 -1
  93. package/dist/i18n-context/functions/translation/GtInternalTranslateJsx.d.ts +0 -33
  94. package/dist/i18n-context/functions/translation/GtInternalTranslateJsx.d.ts.map +0 -1
  95. package/dist/i18n-context/functions/translation/index.d.ts +0 -5
  96. package/dist/i18n-context/functions/translation/index.d.ts.map +0 -1
  97. package/dist/i18n-context/functions/translation/t.d.ts +0 -25
  98. package/dist/i18n-context/functions/translation/t.d.ts.map +0 -1
  99. package/dist/i18n-context/functions/translation/types.d.ts +0 -21
  100. package/dist/i18n-context/functions/translation/types.d.ts.map +0 -1
  101. package/dist/i18n-context/functions/variables/GtInternalCurrency.d.ts +0 -28
  102. package/dist/i18n-context/functions/variables/GtInternalCurrency.d.ts.map +0 -1
  103. package/dist/i18n-context/functions/variables/GtInternalDateTime.d.ts +0 -26
  104. package/dist/i18n-context/functions/variables/GtInternalDateTime.d.ts.map +0 -1
  105. package/dist/i18n-context/functions/variables/GtInternalNum.d.ts +0 -26
  106. package/dist/i18n-context/functions/variables/GtInternalNum.d.ts.map +0 -1
  107. package/dist/i18n-context/functions/variables/GtInternalRelativeTime.d.ts +0 -35
  108. package/dist/i18n-context/functions/variables/GtInternalRelativeTime.d.ts.map +0 -1
  109. package/dist/i18n-context/functions/variables/GtInternalVar.d.ts +0 -23
  110. package/dist/i18n-context/functions/variables/GtInternalVar.d.ts.map +0 -1
  111. package/dist/i18n-context/functions/variables/index.d.ts +0 -6
  112. package/dist/i18n-context/functions/variables/index.d.ts.map +0 -1
  113. package/dist/i18n-context/functions/variables/utils/computeVar.d.ts +0 -9
  114. package/dist/i18n-context/functions/variables/utils/computeVar.d.ts.map +0 -1
  115. package/dist/i18n-context/functions/variables/utils/renderVariable.d.ts +0 -15
  116. package/dist/i18n-context/functions/variables/utils/renderVariable.d.ts.map +0 -1
  117. package/dist/i18n-context/setup/bootstrap.d.ts +0 -22
  118. package/dist/i18n-context/setup/bootstrap.d.ts.map +0 -1
  119. package/dist/i18n-context/setup/index.d.ts +0 -3
  120. package/dist/i18n-context/setup/index.d.ts.map +0 -1
  121. package/dist/i18n-context/setup/initializeGT.d.ts +0 -7
  122. package/dist/i18n-context/setup/initializeGT.d.ts.map +0 -1
  123. package/dist/i18n-context/setup/types.d.ts +0 -19
  124. package/dist/i18n-context/setup/types.d.ts.map +0 -1
  125. package/dist/i18n-context/ui/LocaleSelector.d.ts +0 -18
  126. package/dist/i18n-context/ui/LocaleSelector.d.ts.map +0 -1
  127. package/dist/i18n-context/utils/enforceBrowser.d.ts +0 -7
  128. package/dist/i18n-context/utils/enforceBrowser.d.ts.map +0 -1
  129. package/dist/index.cjs.min.cjs +0 -2
  130. package/dist/index.cjs.min.cjs.map +0 -1
  131. package/dist/index.d.ts +0 -8
  132. package/dist/index.d.ts.map +0 -1
  133. package/dist/index.esm.min.mjs +0 -2
  134. package/dist/index.esm.min.mjs.map +0 -1
  135. package/dist/internal.cjs.min.cjs +0 -2
  136. package/dist/internal.cjs.min.cjs.map +0 -1
  137. package/dist/internal.d.ts +0 -7
  138. package/dist/internal.d.ts.map +0 -1
  139. package/dist/internal.esm.min.mjs +0 -2
  140. package/dist/internal.esm.min.mjs.map +0 -1
  141. package/dist/macros.cjs.min.cjs +0 -2
  142. package/dist/macros.cjs.min.cjs.map +0 -1
  143. package/dist/macros.d.ts +0 -22
  144. package/dist/macros.d.ts.map +0 -1
  145. package/dist/macros.esm.min.mjs +0 -2
  146. package/dist/macros.esm.min.mjs.map +0 -1
  147. package/dist/react-context/provider/ClientProvider.d.ts +0 -4
  148. package/dist/react-context/provider/ClientProvider.d.ts.map +0 -1
  149. package/dist/react-context/provider/GTProvider.d.ts +0 -29
  150. package/dist/react-context/provider/GTProvider.d.ts.map +0 -1
  151. package/dist/react-context/provider/helpers/isSSREnabled.d.ts +0 -2
  152. package/dist/react-context/provider/helpers/isSSREnabled.d.ts.map +0 -1
  153. package/dist/react-context/provider/hooks/locales/useDetermineLocale.d.ts +0 -5
  154. package/dist/react-context/provider/hooks/locales/useDetermineLocale.d.ts.map +0 -1
  155. package/dist/react-context/provider/hooks/useEnableI18n.d.ts +0 -10
  156. package/dist/react-context/provider/hooks/useEnableI18n.d.ts.map +0 -1
  157. package/dist/react-context/provider/hooks/useRegionState.d.ts +0 -9
  158. package/dist/react-context/provider/hooks/useRegionState.d.ts.map +0 -1
  159. package/dist/react-context/types/config.d.ts +0 -67
  160. package/dist/react-context/types/config.d.ts.map +0 -1
  161. package/dist/react-context/ui/LocaleSelector.d.ts +0 -18
  162. package/dist/react-context/ui/LocaleSelector.d.ts.map +0 -1
  163. package/dist/react-context/ui/RegionSelector.d.ts +0 -38
  164. package/dist/react-context/ui/RegionSelector.d.ts.map +0 -1
  165. package/dist/react-context/utils/readAuthFromEnv.d.ts +0 -9
  166. package/dist/react-context/utils/readAuthFromEnv.d.ts.map +0 -1
  167. package/dist/shared/InternalLocaleSelector.d.ts +0 -26
  168. package/dist/shared/InternalLocaleSelector.d.ts.map +0 -1
  169. package/dist/shared/messages.d.ts +0 -11
  170. package/dist/shared/messages.d.ts.map +0 -1
@@ -0,0 +1,701 @@
1
+ import { GT } from "generaltranslation";
2
+ import { JSX, ReactNode } from "react";
3
+
4
+ //#region ../format/dist/types-COaQnqVZ.d.cts
5
+ //#region src/locales/customLocaleMapping.d.ts
6
+ type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
7
+ //#region src/locales/getLocaleProperties.d.ts
8
+ type LocaleProperties = {
9
+ code: string;
10
+ name: string;
11
+ nativeName: string;
12
+ languageCode: string;
13
+ languageName: string;
14
+ nativeLanguageName: string;
15
+ nameWithRegionCode: string;
16
+ nativeNameWithRegionCode: string;
17
+ regionCode: string;
18
+ regionName: string;
19
+ nativeRegionName: string;
20
+ scriptCode: string;
21
+ scriptName: string;
22
+ nativeScriptName: string;
23
+ maximizedCode: string;
24
+ maximizedName: string;
25
+ nativeMaximizedName: string;
26
+ minimizedCode: string;
27
+ minimizedName: string;
28
+ nativeMinimizedName: string;
29
+ emoji: string;
30
+ }; //#endregion
31
+ //#region src/locales/getRegionProperties.d.ts
32
+ //#endregion
33
+ //#region src/types-dir/jsx/variables.d.ts
34
+ type VariableType = 'v' | 'n' | 'd' | 'c' | 'rt';
35
+ /**
36
+ * Variables are used to store the variable name and type.
37
+ */
38
+ type Variable = {
39
+ k: string;
40
+ i?: number;
41
+ v?: VariableType;
42
+ }; //#endregion
43
+ //#region src/types-dir/jsx/content.d.ts
44
+ /**
45
+ * Map of data-_gt properties to their corresponding React props
46
+ */
47
+ declare const HTML_CONTENT_PROPS: {
48
+ readonly pl: "placeholder";
49
+ readonly ti: "title";
50
+ readonly alt: "alt";
51
+ readonly arl: "aria-label";
52
+ readonly arb: "aria-labelledby";
53
+ readonly ard: "aria-describedby";
54
+ };
55
+ type HtmlContentPropKeysRecord = Partial<Record<keyof typeof HTML_CONTENT_PROPS, string>>;
56
+ /**
57
+ * GTProp is an internal property used to contain data for translating and rendering elements.
58
+ * note, transformations are only read on the server side if they are 'plural' or 'branch'
59
+ */
60
+ type GTProp = {
61
+ b?: Record<string, JsxChildren>;
62
+ t?: 'p' | 'b';
63
+ } & HtmlContentPropKeysRecord;
64
+ type JsxElement = {
65
+ t?: string;
66
+ i?: number;
67
+ d?: GTProp;
68
+ c?: JsxChildren;
69
+ };
70
+ type JsxChild = string | JsxElement | Variable;
71
+ /**
72
+ * The format of the string content
73
+ */
74
+ type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';
75
+ /**
76
+ * The format of the content.
77
+ */
78
+ type DataFormat = 'JSX' | StringFormat;
79
+ /**
80
+ * String format content.
81
+ */
82
+ /**
83
+ * A content type representing JSX elements.
84
+ */
85
+ type JsxChildren = JsxChild | JsxChild[];
86
+ /**
87
+ * A content type representing ICU messages.
88
+ */
89
+ //#endregion
90
+ //#region ../i18n/dist/options-D0Lnxv2X.d.cts
91
+ //#region src/translation-functions/types/options.d.ts
92
+ type BaseTranslationOptions = Record<string, unknown>;
93
+ /**
94
+ * Options for string resolution
95
+ * Used by the gt() function
96
+ */
97
+ type InlineTranslationOptions = BaseTranslationOptions & {
98
+ $context?: string;
99
+ $id?: string; /** The data format for the message (e.g., 'ICU', 'STRING'). Defaults to 'ICU'. */
100
+ $format?: StringFormat; /** The locale to use for formatting the message. */
101
+ $locale?: string;
102
+ /**
103
+ * @deprecated use {@link $locale} instead
104
+ */
105
+ $_locales?: string | string[];
106
+ $_hash?: string;
107
+ $maxChars?: number; /** @deprecated use {@link EncodedTranslationOptions} instead */
108
+ $_source?: string;
109
+ };
110
+ /**
111
+ * Options for string resolution
112
+ * Used by the m() function
113
+ */
114
+ /**
115
+ * Options for runtime translation
116
+ * Used by the tx() function
117
+ */
118
+ type RuntimeTranslationOptions = {
119
+ $locale?: string;
120
+ $format?: DataFormat;
121
+ } & Omit<InlineTranslationOptions, '$id' | '$format'>;
122
+ /**
123
+ * Options for JSX translation
124
+ * Used by the resolveJsxTranslation() function
125
+ */
126
+ type JsxTranslationOptions$1 = {
127
+ $format?: 'JSX';
128
+ $context?: string;
129
+ $id?: string;
130
+ $_hash?: string;
131
+ };
132
+ /**
133
+ * Resolution options - options needed to perform a resolution for a given content
134
+ */
135
+ //#endregion
136
+ //#region ../i18n/dist/localeResolver-CYvrEtm0.d.cts
137
+ /**
138
+ * TODO: this disagrees with the type in react-core/src/types-dir/config.ts, we need to move this
139
+ * General Config:
140
+ * @param defaultLocale - The default locale to use
141
+ * @param locales - The locales to support
142
+ * @param customMapping - The custom mapping to use (for aliasing locale codes and other properties)
143
+ * @param enableI18n - Whether to enable i18n
144
+ *
145
+ * Remote Store/Cache Config:
146
+ * @param projectId - The project id
147
+ * @param devApiKey - The dev api key
148
+ * @param _versionId - The version id
149
+ * @param _branchId - The branch id
150
+ * @param cacheUrl - The cache url
151
+ * @param runtimeUrl - The runtime url
152
+ * @param timeout - The timeout
153
+ * @param modelProvider - The model provider
154
+ */
155
+ type GTConfig = {
156
+ defaultLocale?: string;
157
+ locales?: string[];
158
+ customMapping?: CustomMapping;
159
+ enableI18n?: boolean;
160
+ projectId?: string;
161
+ devApiKey?: string;
162
+ apiKey?: string;
163
+ _versionId?: string;
164
+ _branchId?: string;
165
+ cacheUrl?: string | null;
166
+ cacheExpiryTime?: number;
167
+ runtimeUrl?: string | null;
168
+ modelProvider?: string;
169
+ localeCookieName?: string;
170
+ files?: {
171
+ gt?: {
172
+ parsingFlags?: {
173
+ /**
174
+ * Dev hot reload config, gt-react/browser only.
175
+ * - `true` enables strings hot reload (jsx handled at runtime via Suspense)
176
+ * - `{ strings?: boolean; jsx?: boolean }` enables selectively
177
+ */
178
+ devHotReload?: boolean | {
179
+ strings?: boolean;
180
+ jsx?: boolean;
181
+ };
182
+ };
183
+ };
184
+ };
185
+ }; //#endregion
186
+ //#region src/i18n-manager/translations-manager/translations-loaders/types.d.ts
187
+ /**
188
+ * Translations loader function type
189
+ */
190
+ type TranslationsLoader = (locale: string) => Promise<unknown>; //#endregion
191
+ //#region src/i18n-manager/types.d.ts
192
+ //#endregion
193
+ //#region src/i18n-context/browser-i18n-manager/utils/types.d.ts
194
+ /**
195
+ * Type for custom getLocale function
196
+ */
197
+ type GetLocale = () => string;
198
+ /**
199
+ * Html tag options
200
+ * @param {boolean} updateHtmlLangTag - Whether to update the html lang tag on locale change
201
+ * @param {boolean} updateHtmlDirTag - Whether to update the html dir tag on locale change
202
+ */
203
+ type HtmlTagOptions = {
204
+ updateHtmlLangTag?: boolean;
205
+ updateHtmlDirTag?: boolean;
206
+ };
207
+ //#endregion
208
+ //#region src/i18n-context/setup/types.d.ts
209
+ /**
210
+ * Parameters for the initializing GT
211
+ * @param {string} params.defaultLocale - The default locale to use
212
+ * @param {string[]} params.locales - The locales to support
213
+ * @param {TranslationsLoader} params.loadTranslations - The custom translation loader to use
214
+ * @param {GetLocale} [params.getLocale] - The function to get the locale
215
+ * @param {HtmlTagOptions} [params.htmlTagOptions.updateHtmlLangTag] - (true) Whether to update the html lang tag on locale change
216
+ * @param {HtmlTagOptions} [params.htmlTagOptions.updateHtmlDirTag] - (true) Whether to update the html dir tag on locale change
217
+ */
218
+ type InitializeGTParams = GTConfig & {
219
+ loadTranslations?: TranslationsLoader;
220
+ getLocale?: GetLocale;
221
+ htmlTagOptions?: HtmlTagOptions;
222
+ };
223
+ //#endregion
224
+ //#region src/i18n-context/setup/bootstrap.d.ts
225
+ /**
226
+ * Initialization function for react-core library invoked to enable synchronous resolution
227
+ * @param {InitializeGTParams} params - The parameters for the initialization
228
+ * @returns {Promise<void>} A promise that resolves when the bootstrap is complete
229
+ *
230
+ * @example
231
+ * import gtConfig from '../gt.config.json';
232
+ *
233
+ * async function loadTranslations(locale: string) {
234
+ * return (await import(`./_gt/${locale}.json`)).default;
235
+ * }
236
+ *
237
+ * await bootstrap({
238
+ * ...gtConfig,
239
+ * loadTranslations,
240
+ * });
241
+ *
242
+ * await import('./main.tsx')
243
+ */
244
+ declare function bootstrap(params: InitializeGTParams): Promise<void>;
245
+ //#endregion
246
+ //#region src/i18n-context/setup/initializeGT.d.ts
247
+ /**
248
+ * Configure GT for browser runtime. This must be called to setup GT for browser runtime.
249
+ * @param {InitializeGTParams} config - The configuration for the GT instance
250
+ */
251
+ declare function initializeGT(params: InitializeGTParams): void;
252
+ //#endregion
253
+ //#region src/i18n-context/functions/branching/GtInternalBranch.d.ts
254
+ type BranchProps = {
255
+ children?: ReactNode;
256
+ branch: string | number | boolean | undefined;
257
+ [key: string]: ReactNode;
258
+ };
259
+ /**
260
+ * The `<Branch>` component dynamically renders a specified branch of content
261
+ * or a fallback child component. It allows for flexible content switching
262
+ * based on the `branch` prop.
263
+ *
264
+ * This is the i18n-context version — does not use React Context.
265
+ */
266
+ declare function Branch({
267
+ children,
268
+ branch,
269
+ ...branches
270
+ }: BranchProps): ReactNode;
271
+ declare namespace Branch {
272
+ var _gtt: string;
273
+ }
274
+ /**
275
+ * Equivalent to the `<Branch>` component, but used for auto insertion.
276
+ */
277
+ declare function GtInternalBranch(props: BranchProps): ReactNode;
278
+ declare namespace GtInternalBranch {
279
+ var _gtt: string;
280
+ }
281
+ //#endregion
282
+ //#region src/i18n-context/functions/branching/GtInternalPlural.d.ts
283
+ type PluralProps = {
284
+ children?: ReactNode;
285
+ n: number;
286
+ locales?: string;
287
+ [key: string]: ReactNode;
288
+ };
289
+ /**
290
+ * The `<Plural>` component dynamically renders content based on the plural
291
+ * form of the given number (`n`).
292
+ *
293
+ * This is the i18n-context version — uses singleton locale instead of React Context.
294
+ */
295
+ declare function Plural({
296
+ children,
297
+ n,
298
+ locales: localesProp,
299
+ ...branches
300
+ }: PluralProps): ReactNode;
301
+ declare namespace Plural {
302
+ var _gtt: string;
303
+ }
304
+ /**
305
+ * Equivalent to the `<Plural>` component, but used for auto insertion.
306
+ */
307
+ declare function GtInternalPlural(props: PluralProps): ReactNode;
308
+ declare namespace GtInternalPlural {
309
+ var _gtt: string;
310
+ }
311
+ //#endregion
312
+ //#region src/i18n-context/functions/derivation/GtInternalDerive.d.ts
313
+ type DeriveProps<T extends ReactNode> = {
314
+ children: T;
315
+ };
316
+ /**
317
+ * Marks JSX children as derivable by the GT compiler and CLI.
318
+ *
319
+ * Use `<Derive>` inside translated JSX when child content is computed from
320
+ * source code, but should still be discovered during extraction instead of
321
+ * treated as a runtime interpolation variable. It renders its children
322
+ * unchanged at runtime.
323
+ *
324
+ * Run `gt validate` after adding or changing `<Derive>` usage to verify that
325
+ * each derivable expression can be resolved by the CLI.
326
+ *
327
+ * This is the i18n-context version and does not use React Context.
328
+ */
329
+ declare function Derive<T extends ReactNode>({
330
+ children
331
+ }: DeriveProps<T>): T;
332
+ declare namespace Derive {
333
+ var _gtt: string;
334
+ }
335
+ /**
336
+ * Equivalent to the `<Derive>` component, but used for auto insertion.
337
+ */
338
+ declare function GtInternalDerive<T extends ReactNode>(props: DeriveProps<T>): T;
339
+ declare namespace GtInternalDerive {
340
+ var _gtt: string;
341
+ }
342
+ //#endregion
343
+ //#region ../i18n/dist/functions-DI1QpQoC.d.cts
344
+ /**
345
+ * Synchronous resolution function type
346
+ * @param {string} message - The message to translate.
347
+ * @param {InlineTranslationOptions} options - The options for the translation.
348
+ * @returns {string | undefined} The translated message or undefined if the message is not found.
349
+ *
350
+ * @important This is base type for user API
351
+ *
352
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
353
+ */
354
+ type SyncResolutionFunction = (message: string, options?: InlineTranslationOptions) => string | undefined;
355
+ /**
356
+ * Synchronous resolution function type
357
+ * @param {string} message - The message to translate.
358
+ * @param {InlineTranslationOptions} options - The options for the translation.
359
+ * @returns {string} The translated message.
360
+ *
361
+ * @important This is base type for user API
362
+ *
363
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
364
+ */
365
+ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
366
+ /**
367
+ * Type for the gt() function
368
+ * @param {string} message - The message to translate
369
+ * @param {InlineTranslationOptions} options - The options for the translation
370
+ * @returns {string} The translated message
371
+ * TODO: next major version, remove the "...type" suffix, it's redundant
372
+ */
373
+ //#endregion
374
+ //#region src/i18n-context/functions/translation/types.d.ts
375
+ /**
376
+ * Overloaded type for the `t` function.
377
+ * - Tagged template: t`Hello, ${name}` (transformed by the compiler plugin at build time)
378
+ * - Function call: t("Hello, {name}", { name: "John" })
379
+ *
380
+ * {@link TemplateSyncResolutionFunction}
381
+ * {@link SyncResolutionFunction}
382
+ */
383
+ interface StringOrTemplateSyncResolutionFunction {
384
+ (strings: TemplateStringsArray, ...values: unknown[]): string;
385
+ (message: string, options?: InlineTranslationOptions): string;
386
+ }
387
+ //#endregion
388
+ //#region src/i18n-context/functions/translation/t.d.ts
389
+ /**
390
+ * NOTE: t() is the only function exported from the 'gt-react' entry point.
391
+ * All other functions in i18n-context are exported from the 'gt-react/browser' entry point.
392
+ */
393
+ /**
394
+ * Translate a message
395
+ * @param {string} message - The message to translate.
396
+ * @param {InlineTranslationOptions} [options] - The options for the translation.
397
+ * @returns {string} The translated message.
398
+ *
399
+ * This is a BROWSER ONLY function.
400
+ *
401
+ * @example
402
+ * t('Hello, world!'); // Translates 'Hello, world!'
403
+ *
404
+ * @example
405
+ * t('Hello, {name}!', { name: 'John' }); // Translates 'Hello, John!'
406
+ *
407
+ * @example
408
+ * t`Hello, ${name}` // Translate via tagged template literal
409
+ *
410
+ */
411
+ declare const t: StringOrTemplateSyncResolutionFunction;
412
+ //#endregion
413
+ //#region src/i18n-context/functions/translation/GtInternalRuntimeTranslateString.d.ts
414
+ type RuntimeStringTranslationOptions = Omit<RuntimeTranslationOptions, '$format'> & {
415
+ $format?: StringFormat;
416
+ };
417
+ /**
418
+ * Internal runtime translate string function for dev only
419
+ */
420
+ declare const GtInternalRuntimeTranslateString: (content: string, options?: RuntimeStringTranslationOptions) => Promise<string>;
421
+ //#endregion
422
+ //#region src/i18n-context/functions/translation/GtInternalRuntimeTranslateJsx.d.ts
423
+ type RuntimeJsxTranslationOptions = JsxTranslationOptions$1 & {
424
+ $locale?: string;
425
+ };
426
+ /**
427
+ * Internal runtime translate JSX function for dev only
428
+ */
429
+ declare const GtInternalRuntimeTranslateJsx: (content: JsxChildren, options?: RuntimeJsxTranslationOptions) => Promise<JsxChildren>;
430
+ //#endregion
431
+ //#region src/i18n-context/functions/translation/GtInternalTranslateJsx.d.ts
432
+ type TranslateJsxProps = {
433
+ children: ReactNode;
434
+ } & JsxTranslationOptions;
435
+ /**
436
+ * Equivalent to the `<T>` component, but used for auto insertion
437
+ */
438
+ declare function GtInternalTranslateJsx(props: TranslateJsxProps): ReactNode;
439
+ declare namespace GtInternalTranslateJsx {
440
+ var _gtt: string;
441
+ }
442
+ /**
443
+ * User facing component for translation.
444
+ */
445
+ declare function T(props: TranslateJsxProps): ReactNode;
446
+ declare namespace T {
447
+ var _gtt: string;
448
+ }
449
+ /**
450
+ * Strips the sugar character $ from option keys (e.g. `$context` → `context`).
451
+ */
452
+ type StripDollarPrefix<T> = { [K in keyof T as K extends `$${infer Rest}` ? Rest : K]: T[K] };
453
+ /**
454
+ * Internal type for the JsxTranslationOptions.
455
+ * @internal
456
+ */
457
+ type JsxTranslationOptions = StripDollarPrefix<JsxTranslationOptions$1> & JsxTranslationOptions$1; //# sourceMappingURL=GtInternalTranslateJsx.d.ts.map
458
+ //#endregion
459
+ //#region src/i18n-context/functions/variables/GtInternalVar.d.ts
460
+ type VarProps<T extends ReactNode> = {
461
+ children: T;
462
+ name?: string;
463
+ };
464
+ /**
465
+ * Equivalent to the `<Var>` component, but used for auto insertion
466
+ */
467
+ declare function GtInternalVar<T extends ReactNode>({
468
+ children
469
+ }: VarProps<T>): T;
470
+ declare namespace GtInternalVar {
471
+ var _gtt: string;
472
+ }
473
+ /**
474
+ * User facing version of the Var component
475
+ */
476
+ declare function Var<T extends ReactNode>({
477
+ children
478
+ }: VarProps<T>): T;
479
+ declare namespace Var {
480
+ var _gtt: string;
481
+ }
482
+ //#endregion
483
+ //#region src/i18n-context/functions/variables/GtInternalNum.d.ts
484
+ type NumProps = {
485
+ children: number | string | null | undefined;
486
+ options?: Intl.NumberFormatOptions;
487
+ locales?: string[];
488
+ name?: string;
489
+ };
490
+ /**
491
+ * Equivalent to the `<Num>` component, but used for auto insertion
492
+ */
493
+ declare function GtInternalNum({
494
+ children,
495
+ options,
496
+ locales: localesProp
497
+ }: NumProps): string | null;
498
+ declare namespace GtInternalNum {
499
+ var _gtt: string;
500
+ }
501
+ /**
502
+ * User facing component for the `<Num>` variable
503
+ */
504
+ declare function Num(props: NumProps): string | null;
505
+ declare namespace Num {
506
+ var _gtt: string;
507
+ }
508
+ //#endregion
509
+ //#region src/i18n-context/functions/variables/GtInternalDateTime.d.ts
510
+ type DateTimeProps = {
511
+ children: Date | null | undefined;
512
+ locales?: string[];
513
+ options?: Intl.DateTimeFormatOptions;
514
+ name?: string;
515
+ };
516
+ /**
517
+ * Equivalent to the `<DateTime>` component, but used for auto insertion
518
+ */
519
+ declare function GtInternalDateTime({
520
+ children,
521
+ options,
522
+ locales: localesProp
523
+ }: DateTimeProps): string | null;
524
+ declare namespace GtInternalDateTime {
525
+ var _gtt: string;
526
+ }
527
+ /**
528
+ * User facing component for the `<DateTime>` variable
529
+ */
530
+ declare function DateTime(props: DateTimeProps): string | null;
531
+ declare namespace DateTime {
532
+ var _gtt: string;
533
+ }
534
+ //#endregion
535
+ //#region src/i18n-context/functions/variables/GtInternalCurrency.d.ts
536
+ type CurrencyProps = {
537
+ children: number | string | null | undefined;
538
+ currency?: string;
539
+ options?: Intl.NumberFormatOptions;
540
+ locales?: string[];
541
+ name?: string;
542
+ };
543
+ /**
544
+ * Equivalent to the `<Currency>` component, but used for auto insertion
545
+ */
546
+ declare function GtInternalCurrency({
547
+ children,
548
+ currency,
549
+ options,
550
+ locales: localesProp
551
+ }: CurrencyProps): string | null;
552
+ declare namespace GtInternalCurrency {
553
+ var _gtt: string;
554
+ }
555
+ /**
556
+ * User facing component for the `<Currency>` variable
557
+ */
558
+ declare function Currency(props: CurrencyProps): string | null;
559
+ declare namespace Currency {
560
+ var _gtt: string;
561
+ }
562
+ //#endregion
563
+ //#region src/i18n-context/functions/variables/GtInternalRelativeTime.d.ts
564
+ type RelativeTimeProps = {
565
+ date?: Date | null | undefined;
566
+ children?: Date | null | undefined; /** Used by the GT CLI for additional context during extraction. */
567
+ name?: string;
568
+ value?: number;
569
+ unit?: Intl.RelativeTimeFormatUnit; /** Base date for computing relative time. Defaults to `new Date()` at render time. Required for hydration safety. */
570
+ baseDate?: Date;
571
+ locales?: string[];
572
+ options?: Intl.RelativeTimeFormatOptions;
573
+ };
574
+ /**
575
+ * Equivalent to the `<RelativeTime>` component, but used for auto insertion
576
+ */
577
+ declare function GtInternalRelativeTime({
578
+ date,
579
+ children,
580
+ value,
581
+ unit,
582
+ baseDate,
583
+ locales: localesProp,
584
+ options
585
+ }: RelativeTimeProps): string | null;
586
+ declare namespace GtInternalRelativeTime {
587
+ var _gtt: string;
588
+ }
589
+ /**
590
+ * User facing component for the `<RelativeTime>` variable
591
+ */
592
+ declare function RelativeTime(props: RelativeTimeProps): string | null;
593
+ declare namespace RelativeTime {
594
+ var _gtt: string;
595
+ }
596
+ //#endregion
597
+ //#region ../i18n/dist/index-UDlCzB02.d.cts
598
+ //#region src/helpers/locale.d.ts
599
+ /**
600
+ * Get the current locale
601
+ * @returns The current locale
602
+ *
603
+ * @example
604
+ * const locale = getLocale();
605
+ * console.log(locale); // 'en-US'
606
+ */
607
+ declare function getLocale(): string;
608
+ /**
609
+ * Get the configured locales
610
+ * @returns The configured locales
611
+ *
612
+ * @example
613
+ * const locales = getLocales();
614
+ * console.log(locales); // ['en-US', 'es-ES']
615
+ */
616
+ declare function getLocales(): string[];
617
+ /**
618
+ * Get the default locale
619
+ * @returns The default locale
620
+ *
621
+ * @example
622
+ * const defaultLocale = getDefaultLocale();
623
+ * console.log(defaultLocale); // 'en-US'
624
+ */
625
+ declare function getDefaultLocale(): string;
626
+ /**
627
+ * Get the locale properties
628
+ * @param {string} [locale] - The locale to get the properties for. When not provided, uses the current locale.
629
+ * @returns The locale properties
630
+ *
631
+ * @example
632
+ * const localeProperties = getLocaleProperties();
633
+ *
634
+ * @example
635
+ * const localeProperties = getLocaleProperties('en-US');
636
+ */
637
+ //#endregion
638
+ //#region src/helpers/versionId.d.ts
639
+ /**
640
+ * Get the version ID for the current source
641
+ * @returns The version ID, if set
642
+ *
643
+ * @example
644
+ * const versionId = getVersionId();
645
+ * console.log(versionId); // 'abc123'
646
+ */
647
+ declare function getVersionId(): string | undefined; //#endregion
648
+ //#endregion
649
+ //#region src/i18n-context/functions/locale-operations.d.ts
650
+ /**
651
+ * Sets the user's current locale.
652
+ *
653
+ * @note This function causes a page reload
654
+ *
655
+ * @example
656
+ * setLocale('es-ES');
657
+ */
658
+ declare function setLocale(locale: string): void;
659
+ //#endregion
660
+ //#region src/i18n-context/functions/html-tag-operations.d.ts
661
+ /**
662
+ * Update the html tag lang property
663
+ * @param {string} locale - The locale to update the html tag lang property to
664
+ * @returns {void}
665
+ *
666
+ * @example
667
+ * updateHtmlTagLang('en');
668
+ */
669
+ declare function updateHtmlTagLang(locale: string): void;
670
+ /**
671
+ * Update the html tag dir property
672
+ * @param {string} dir - The direction to update the html tag dir property to
673
+ * @returns {void}
674
+ *
675
+ * @example
676
+ * updateHtmlTagDir('ltr');
677
+ */
678
+ declare function updateHtmlTagDir(dir: 'ltr' | 'rtl'): void;
679
+ //#endregion
680
+ //#region src/i18n-context/ui/LocaleSelector.d.ts
681
+ /**
682
+ * A dropdown component that allows users to select a locale.
683
+ * @param {string[]} [locales] - An optional list of locales to use for the dropdown. If not provided, the list of locales from the `<GTProvider>` context is used.
684
+ * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.
685
+ * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.
686
+ * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.
687
+ */
688
+ declare function LocaleSelector({
689
+ locales,
690
+ ...props
691
+ }: {
692
+ locales?: string[];
693
+ customNames?: {
694
+ [key: string]: string;
695
+ };
696
+ customMapping?: CustomMapping;
697
+ [key: string]: unknown;
698
+ }): JSX.Element | null;
699
+ //#endregion
700
+ export { Branch, Currency, DateTime, Derive, GtInternalBranch, GtInternalCurrency, GtInternalDateTime, GtInternalDerive, GtInternalNum, GtInternalPlural, GtInternalRelativeTime, GtInternalRuntimeTranslateJsx, GtInternalRuntimeTranslateString, GtInternalTranslateJsx, GtInternalVar, LocaleSelector, Num, Plural, RelativeTime, type SyncResolutionFunction, type SyncResolutionFunctionWithFallback, T, Var, bootstrap, getDefaultLocale, getLocale, getLocales, getVersionId, initializeGT, setLocale, t, updateHtmlTagDir, updateHtmlTagLang };
701
+ //# sourceMappingURL=browser.d.mts.map