gt-react 10.19.15 → 10.19.16

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 +13 -0
  2. package/dist/browser.cjs +10789 -0
  3. package/dist/browser.cjs.map +1 -0
  4. package/dist/browser.d.cts +732 -0
  5. package/dist/browser.d.cts.map +1 -0
  6. package/dist/browser.d.mts +734 -0
  7. package/dist/browser.d.mts.map +1 -0
  8. package/dist/browser.mjs +10751 -0
  9. package/dist/browser.mjs.map +1 -0
  10. package/dist/client.cjs +3356 -0
  11. package/dist/client.cjs.map +1 -0
  12. package/dist/client.d.cts +249 -0
  13. package/dist/client.d.cts.map +1 -0
  14. package/dist/client.d.mts +250 -0
  15. package/dist/client.d.mts.map +1 -0
  16. package/dist/client.mjs +3296 -0
  17. package/dist/client.mjs.map +1 -0
  18. package/dist/index.cjs +3509 -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 +3453 -0
  25. package/dist/index.mjs.map +1 -0
  26. package/dist/internal.cjs +3954 -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 +3893 -0
  33. package/dist/internal.mjs.map +1 -0
  34. package/dist/macros.cjs +6139 -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 +6140 -0
  41. package/dist/macros.mjs.map +1 -0
  42. package/package.json +60 -40
  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,732 @@
1
+ import React, { ReactNode } from "react";
2
+ //#region ../format/dist/types-UnF22q9r.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
+ /**
253
+ * The `<Branch>` component dynamically renders a specified branch of content
254
+ * or a fallback child component. It allows for flexible content switching
255
+ * based on the `branch` prop.
256
+ *
257
+ * This is the i18n-context version — does not use React Context.
258
+ */
259
+ declare function Branch({
260
+ children,
261
+ branch,
262
+ ...branches
263
+ }: {
264
+ children?: React.ReactNode;
265
+ branch: string | number | boolean | undefined;
266
+ [key: string]: React.ReactNode;
267
+ }): React.ReactNode;
268
+ declare namespace Branch {
269
+ var _gtt: string;
270
+ }
271
+ /**
272
+ * Equivalent to the `<Branch>` component, but used for auto insertion.
273
+ */
274
+ declare function GtInternalBranch(props: {
275
+ children?: React.ReactNode;
276
+ branch: string | number | boolean | undefined;
277
+ [key: string]: React.ReactNode;
278
+ }): React.ReactNode;
279
+ declare namespace GtInternalBranch {
280
+ var _gtt: string;
281
+ }
282
+ //#endregion
283
+ //#region src/i18n-context/functions/branching/GtInternalPlural.d.ts
284
+ /**
285
+ * The `<Plural>` component dynamically renders content based on the plural
286
+ * form of the given number (`n`).
287
+ *
288
+ * This is the i18n-context version — uses singleton locale instead of React Context.
289
+ */
290
+ declare function Plural({
291
+ children,
292
+ n,
293
+ locales: localesProp,
294
+ ...branches
295
+ }: {
296
+ children?: React.ReactNode;
297
+ n: number;
298
+ locales?: string;
299
+ [key: string]: React.ReactNode;
300
+ }): React.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: {
308
+ children?: React.ReactNode;
309
+ n: number;
310
+ locales?: string;
311
+ [key: string]: React.ReactNode;
312
+ }): React.ReactNode;
313
+ declare namespace GtInternalPlural {
314
+ var _gtt: string;
315
+ }
316
+ //#endregion
317
+ //#region src/i18n-context/functions/derivation/GtInternalDerive.d.ts
318
+ /**
319
+ * Marks JSX children as derivable by the GT compiler and CLI.
320
+ *
321
+ * Use `<Derive>` inside translated JSX when child content is computed from
322
+ * source code, but should still be discovered during extraction instead of
323
+ * treated as a runtime interpolation variable. It renders its children
324
+ * unchanged at runtime.
325
+ *
326
+ * Run `gt validate` after adding or changing `<Derive>` usage to verify that
327
+ * each derivable expression can be resolved by the CLI.
328
+ *
329
+ * This is the i18n-context version and does not use React Context.
330
+ */
331
+ declare function Derive<T extends ReactNode>({
332
+ children
333
+ }: {
334
+ children: T;
335
+ }): T;
336
+ declare namespace Derive {
337
+ var _gtt: string;
338
+ }
339
+ /**
340
+ * Equivalent to the `<Derive>` component, but used for auto insertion.
341
+ */
342
+ declare function GtInternalDerive<T extends ReactNode>({
343
+ children
344
+ }: {
345
+ children: T;
346
+ }): T;
347
+ declare namespace GtInternalDerive {
348
+ var _gtt: string;
349
+ }
350
+ //#endregion
351
+ //#region ../i18n/dist/functions-DI1QpQoC.d.cts
352
+ /**
353
+ * Synchronous resolution function type
354
+ * @param {string} message - The message to translate.
355
+ * @param {InlineTranslationOptions} options - The options for the translation.
356
+ * @returns {string | undefined} The translated message or undefined if the message is not found.
357
+ *
358
+ * @important This is base type for user API
359
+ *
360
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
361
+ */
362
+ type SyncResolutionFunction = (message: string, options?: InlineTranslationOptions) => string | undefined;
363
+ /**
364
+ * Synchronous resolution function type
365
+ * @param {string} message - The message to translate.
366
+ * @param {InlineTranslationOptions} options - The options for the translation.
367
+ * @returns {string} The translated message.
368
+ *
369
+ * @important This is base type for user API
370
+ *
371
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
372
+ */
373
+ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
374
+ /**
375
+ * Type for the gt() function
376
+ * @param {string} message - The message to translate
377
+ * @param {InlineTranslationOptions} options - The options for the translation
378
+ * @returns {string} The translated message
379
+ * TODO: next major version, remove the "...type" suffix, it's redundant
380
+ */
381
+ //#endregion
382
+ //#region src/i18n-context/functions/translation/types.d.ts
383
+ /**
384
+ * Overloaded type for the `t` function.
385
+ * - Tagged template: t`Hello, ${name}` (transformed by the compiler plugin at build time)
386
+ * - Function call: t("Hello, {name}", { name: "John" })
387
+ *
388
+ * {@link TemplateSyncResolutionFunction}
389
+ * {@link SyncResolutionFunction}
390
+ */
391
+ interface StringOrTemplateSyncResolutionFunction {
392
+ (strings: TemplateStringsArray, ...values: unknown[]): string;
393
+ (message: string, options?: InlineTranslationOptions): string;
394
+ }
395
+ //#endregion
396
+ //#region src/i18n-context/functions/translation/t.d.ts
397
+ /**
398
+ * NOTE: t() is the only function exported from the 'gt-react' entry point.
399
+ * All other functions in i18n-context are exported from the 'gt-react/browser' entry point.
400
+ */
401
+ /**
402
+ * Translate a message
403
+ * @param {string} message - The message to translate.
404
+ * @param {InlineTranslationOptions} [options] - The options for the translation.
405
+ * @returns {string} The translated message.
406
+ *
407
+ * This is a BROWSER ONLY function.
408
+ *
409
+ * @example
410
+ * t('Hello, world!'); // Translates 'Hello, world!'
411
+ *
412
+ * @example
413
+ * t('Hello, {name}!', { name: 'John' }); // Translates 'Hello, John!'
414
+ *
415
+ * @example
416
+ * t`Hello, ${name}` // Translate via tagged template literal
417
+ *
418
+ */
419
+ declare const t: StringOrTemplateSyncResolutionFunction;
420
+ //#endregion
421
+ //#region src/i18n-context/functions/translation/GtInternalRuntimeTranslateString.d.ts
422
+ type RuntimeStringTranslationOptions = Omit<RuntimeTranslationOptions, '$format'> & {
423
+ $format?: StringFormat;
424
+ };
425
+ /**
426
+ * Internal runtime translate string function for dev only
427
+ */
428
+ declare const GtInternalRuntimeTranslateString: (content: string, options?: RuntimeStringTranslationOptions) => Promise<string>;
429
+ //#endregion
430
+ //#region src/i18n-context/functions/translation/GtInternalRuntimeTranslateJsx.d.ts
431
+ type RuntimeJsxTranslationOptions = JsxTranslationOptions$1 & {
432
+ $locale?: string;
433
+ };
434
+ /**
435
+ * Internal runtime translate JSX function for dev only
436
+ */
437
+ declare const GtInternalRuntimeTranslateJsx: (content: JsxChildren, options?: RuntimeJsxTranslationOptions) => Promise<JsxChildren>;
438
+ //#endregion
439
+ //#region src/i18n-context/functions/translation/GtInternalTranslateJsx.d.ts
440
+ /**
441
+ * Equivalent to the `<T>` component, but used for auto insertion
442
+ */
443
+ declare function GtInternalTranslateJsx(props: {
444
+ children: ReactNode;
445
+ } & JsxTranslationOptions): ReactNode;
446
+ declare namespace GtInternalTranslateJsx {
447
+ var _gtt: string;
448
+ }
449
+ /**
450
+ * User facing component for translation.
451
+ */
452
+ declare function T(props: {
453
+ children: ReactNode;
454
+ } & JsxTranslationOptions): ReactNode;
455
+ declare namespace T {
456
+ var _gtt: string;
457
+ }
458
+ /**
459
+ * Strips the sugar character $ from option keys (e.g. `$context` → `context`).
460
+ */
461
+ type StripDollarPrefix<T> = { [K in keyof T as K extends `$${infer Rest}` ? Rest : K]: T[K] };
462
+ /**
463
+ * Internal type for the JsxTranslationOptions.
464
+ * @internal
465
+ */
466
+ type JsxTranslationOptions = StripDollarPrefix<JsxTranslationOptions$1> & JsxTranslationOptions$1; //# sourceMappingURL=GtInternalTranslateJsx.d.ts.map
467
+ //#endregion
468
+ //#region src/i18n-context/functions/variables/GtInternalVar.d.ts
469
+ /**
470
+ * Equivalent to the `<Var>` component, but used for auto insertion
471
+ */
472
+ declare function GtInternalVar<T extends ReactNode>({
473
+ children
474
+ }: {
475
+ children: T;
476
+ name?: string;
477
+ }): T;
478
+ declare namespace GtInternalVar {
479
+ var _gtt: string;
480
+ }
481
+ /**
482
+ * User facing version of the Var component
483
+ */
484
+ declare function Var<T extends ReactNode>({
485
+ children
486
+ }: {
487
+ children: T;
488
+ name?: string;
489
+ }): T;
490
+ declare namespace Var {
491
+ var _gtt: string;
492
+ }
493
+ //#endregion
494
+ //#region src/i18n-context/functions/variables/GtInternalNum.d.ts
495
+ /**
496
+ * Equivalent to the `<Num>` component, but used for auto insertion
497
+ */
498
+ declare function GtInternalNum({
499
+ children,
500
+ options,
501
+ locales: localesProp
502
+ }: {
503
+ children: number | string | null | undefined;
504
+ options?: Intl.NumberFormatOptions;
505
+ locales?: string[];
506
+ name?: string;
507
+ }): string | null;
508
+ declare namespace GtInternalNum {
509
+ var _gtt: string;
510
+ }
511
+ /**
512
+ * User facing component for the `<Num>` variable
513
+ */
514
+ declare function Num(props: {
515
+ children: number | string | null | undefined;
516
+ options?: Intl.NumberFormatOptions;
517
+ locales?: string[];
518
+ name?: string;
519
+ }): string | null;
520
+ declare namespace Num {
521
+ var _gtt: string;
522
+ }
523
+ //#endregion
524
+ //#region src/i18n-context/functions/variables/GtInternalDateTime.d.ts
525
+ /**
526
+ * Equivalent to the `<DateTime>` component, but used for auto insertion
527
+ */
528
+ declare function GtInternalDateTime({
529
+ children,
530
+ options,
531
+ locales: localesProp
532
+ }: {
533
+ children: Date | null | undefined;
534
+ locales?: string[];
535
+ options?: Intl.DateTimeFormatOptions;
536
+ name?: string;
537
+ }): string | null;
538
+ declare namespace GtInternalDateTime {
539
+ var _gtt: string;
540
+ }
541
+ /**
542
+ * User facing component for the `<DateTime>` variable
543
+ */
544
+ declare function DateTime(props: {
545
+ children: Date | null | undefined;
546
+ locales?: string[];
547
+ options?: Intl.DateTimeFormatOptions;
548
+ name?: string;
549
+ }): string | null;
550
+ declare namespace DateTime {
551
+ var _gtt: string;
552
+ }
553
+ //#endregion
554
+ //#region src/i18n-context/functions/variables/GtInternalCurrency.d.ts
555
+ /**
556
+ * Equivalent to the `<Currency>` component, but used for auto insertion
557
+ */
558
+ declare function GtInternalCurrency({
559
+ children,
560
+ currency,
561
+ options,
562
+ locales: localesProp
563
+ }: {
564
+ children: number | string | null | undefined;
565
+ currency?: string;
566
+ options?: Intl.NumberFormatOptions;
567
+ locales?: string[];
568
+ name?: string;
569
+ }): string | null;
570
+ declare namespace GtInternalCurrency {
571
+ var _gtt: string;
572
+ }
573
+ /**
574
+ * User facing component for the `<Currency>` variable
575
+ */
576
+ declare function Currency(props: {
577
+ children: number | string | null | undefined;
578
+ currency?: string;
579
+ options?: Intl.NumberFormatOptions;
580
+ locales?: string[];
581
+ name?: string;
582
+ }): string | null;
583
+ declare namespace Currency {
584
+ var _gtt: string;
585
+ }
586
+ //#endregion
587
+ //#region src/i18n-context/functions/variables/GtInternalRelativeTime.d.ts
588
+ /**
589
+ * Equivalent to the `<RelativeTime>` component, but used for auto insertion
590
+ */
591
+ declare function GtInternalRelativeTime({
592
+ date,
593
+ children,
594
+ value,
595
+ unit,
596
+ baseDate,
597
+ locales: localesProp,
598
+ options
599
+ }: {
600
+ date?: Date | null | undefined;
601
+ children?: Date | null | undefined; /** Used by the GT CLI for additional context during extraction. */
602
+ name?: string;
603
+ value?: number;
604
+ unit?: Intl.RelativeTimeFormatUnit; /** Base date for computing relative time. Defaults to `new Date()` at render time. Required for hydration safety. */
605
+ baseDate?: Date;
606
+ locales?: string[];
607
+ options?: Intl.RelativeTimeFormatOptions;
608
+ }): string | null;
609
+ declare namespace GtInternalRelativeTime {
610
+ var _gtt: string;
611
+ }
612
+ /**
613
+ * User facing component for the `<RelativeTime>` variable
614
+ */
615
+ declare function RelativeTime(props: {
616
+ date?: Date | null | undefined;
617
+ children?: Date | null | undefined;
618
+ value?: number;
619
+ unit?: Intl.RelativeTimeFormatUnit;
620
+ baseDate?: Date;
621
+ locales?: string[];
622
+ options?: Intl.RelativeTimeFormatOptions;
623
+ }): string | null;
624
+ declare namespace RelativeTime {
625
+ var _gtt: string;
626
+ }
627
+ //#endregion
628
+ //#region ../i18n/dist/index-UDlCzB02.d.cts
629
+ //#region src/helpers/locale.d.ts
630
+ /**
631
+ * Get the current locale
632
+ * @returns The current locale
633
+ *
634
+ * @example
635
+ * const locale = getLocale();
636
+ * console.log(locale); // 'en-US'
637
+ */
638
+ declare function getLocale(): string;
639
+ /**
640
+ * Get the configured locales
641
+ * @returns The configured locales
642
+ *
643
+ * @example
644
+ * const locales = getLocales();
645
+ * console.log(locales); // ['en-US', 'es-ES']
646
+ */
647
+ declare function getLocales(): string[];
648
+ /**
649
+ * Get the default locale
650
+ * @returns The default locale
651
+ *
652
+ * @example
653
+ * const defaultLocale = getDefaultLocale();
654
+ * console.log(defaultLocale); // 'en-US'
655
+ */
656
+ declare function getDefaultLocale(): string;
657
+ /**
658
+ * Get the locale properties
659
+ * @param {string} [locale] - The locale to get the properties for. When not provided, uses the current locale.
660
+ * @returns The locale properties
661
+ *
662
+ * @example
663
+ * const localeProperties = getLocaleProperties();
664
+ *
665
+ * @example
666
+ * const localeProperties = getLocaleProperties('en-US');
667
+ */
668
+ //#endregion
669
+ //#region src/helpers/versionId.d.ts
670
+ /**
671
+ * Get the version ID for the current source
672
+ * @returns The version ID, if set
673
+ *
674
+ * @example
675
+ * const versionId = getVersionId();
676
+ * console.log(versionId); // 'abc123'
677
+ */
678
+ declare function getVersionId(): string | undefined; //#endregion
679
+ //#endregion
680
+ //#region src/i18n-context/functions/locale-operations.d.ts
681
+ /**
682
+ * Sets the user's current locale.
683
+ *
684
+ * @note This function causes a page reload
685
+ *
686
+ * @example
687
+ * setLocale('es-ES');
688
+ */
689
+ declare function setLocale(locale: string): void;
690
+ //#endregion
691
+ //#region src/i18n-context/functions/html-tag-operations.d.ts
692
+ /**
693
+ * Update the html tag lang property
694
+ * @param {string} locale - The locale to update the html tag lang property to
695
+ * @returns {void}
696
+ *
697
+ * @example
698
+ * updateHtmlTagLang('en');
699
+ */
700
+ declare function updateHtmlTagLang(locale: string): void;
701
+ /**
702
+ * Update the html tag dir property
703
+ * @param {string} dir - The direction to update the html tag dir property to
704
+ * @returns {void}
705
+ *
706
+ * @example
707
+ * updateHtmlTagDir('ltr');
708
+ */
709
+ declare function updateHtmlTagDir(dir: 'ltr' | 'rtl'): void;
710
+ //#endregion
711
+ //#region src/i18n-context/ui/LocaleSelector.d.ts
712
+ /**
713
+ * A dropdown component that allows users to select a locale.
714
+ * @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.
715
+ * @param {object} [customNames] - (deprecated) An optional object to map locales to custom names. Use `customMapping` instead.
716
+ * @param {CustomMapping} [customMapping] - An optional object to map locales to custom display names, emojis, or other properties.
717
+ * @returns {React.ReactElement | null} The rendered locale dropdown component or null to prevent rendering.
718
+ */
719
+ declare function LocaleSelector({
720
+ locales,
721
+ ...props
722
+ }: {
723
+ locales?: string[];
724
+ customNames?: {
725
+ [key: string]: string;
726
+ };
727
+ customMapping?: CustomMapping;
728
+ [key: string]: unknown;
729
+ }): React.JSX.Element | null;
730
+ //#endregion
731
+ 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 };
732
+ //# sourceMappingURL=browser.d.cts.map