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