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,1118 @@
1
+ import t, { ReactNode } from "react";
2
+ //#region ../react-core/dist/internal.d.ts
3
+ //#region ../format/dist/types-UnF22q9r.d.cts
4
+ //#endregion
5
+ //#region src/types-dir/jsx/variables.d.ts
6
+ type VariableType$1 = 'v' | 'n' | 'd' | 'c' | 'rt';
7
+ /**
8
+ * Variables are used to store the variable name and type.
9
+ */
10
+ type Variable$1 = {
11
+ k: string;
12
+ i?: number;
13
+ v?: VariableType$1;
14
+ }; //#endregion
15
+ //#region src/types-dir/jsx/content.d.ts
16
+ /**
17
+ * Map of data-_gt properties to their corresponding React props
18
+ */
19
+ declare const HTML_CONTENT_PROPS$1: {
20
+ readonly pl: "placeholder";
21
+ readonly ti: "title";
22
+ readonly alt: "alt";
23
+ readonly arl: "aria-label";
24
+ readonly arb: "aria-labelledby";
25
+ readonly ard: "aria-describedby";
26
+ };
27
+ type HtmlContentPropKeysRecord$1 = Partial<Record<keyof typeof HTML_CONTENT_PROPS$1, string>>;
28
+ /**
29
+ * GTProp is an internal property used to contain data for translating and rendering elements.
30
+ * note, transformations are only read on the server side if they are 'plural' or 'branch'
31
+ */
32
+ type GTProp$1 = {
33
+ b?: Record<string, JsxChildren$1>;
34
+ t?: 'p' | 'b';
35
+ } & HtmlContentPropKeysRecord$1;
36
+ type JsxElement$1 = {
37
+ t?: string;
38
+ i?: number;
39
+ d?: GTProp$1;
40
+ c?: JsxChildren$1;
41
+ };
42
+ type JsxChild$1 = string | JsxElement$1 | Variable$1;
43
+ /**
44
+ * The format of the string content
45
+ */
46
+ type StringFormat$1 = 'ICU' | 'I18NEXT' | 'STRING';
47
+ /**
48
+ * The format of the content.
49
+ */
50
+ /**
51
+ * A content type representing JSX elements.
52
+ */
53
+ type JsxChildren$1 = JsxChild$1 | JsxChild$1[];
54
+ /**
55
+ * A content type representing ICU messages.
56
+ */
57
+ //#endregion
58
+ //#region ../core/dist/types-YrrGRHBP.d.cts
59
+ type TransformationPrefix = 'translate' | 'variable' | 'plural' | 'branch' | 'fragment' | 'derive';
60
+ type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency' | 'relative-time';
61
+ type InjectionType$1 = 'automatic' | 'manual'; //#endregion
62
+ //#region src/types.d.ts
63
+ /**
64
+ * @deprecated Use {@link Content} instead.
65
+ */
66
+ //#endregion
67
+ //#region ../i18n/dist/options-D0Lnxv2X.d.cts
68
+ //#region src/translation-functions/types/options.d.ts
69
+ type BaseTranslationOptions$1 = Record<string, unknown>;
70
+ /**
71
+ * Options for string resolution
72
+ * Used by the gt() function
73
+ */
74
+ type InlineTranslationOptions$1 = BaseTranslationOptions$1 & {
75
+ $context?: string;
76
+ $id?: string; /** The data format for the message (e.g., 'ICU', 'STRING'). Defaults to 'ICU'. */
77
+ $format?: StringFormat$1; /** The locale to use for formatting the message. */
78
+ $locale?: string;
79
+ /**
80
+ * @deprecated use {@link $locale} instead
81
+ */
82
+ $_locales?: string | string[];
83
+ $_hash?: string;
84
+ $maxChars?: number; /** @deprecated use {@link EncodedTranslationOptions} instead */
85
+ $_source?: string;
86
+ };
87
+ /**
88
+ * Options for string resolution
89
+ * Used by the m() function
90
+ */
91
+ //#endregion
92
+ //#region ../i18n/dist/functions-DI1QpQoC.d.cts
93
+ /**
94
+ * Synchronous resolution function type
95
+ * @param {string} message - The message to translate.
96
+ * @param {InlineTranslationOptions} options - The options for the translation.
97
+ * @returns {string} The translated message.
98
+ *
99
+ * @important This is base type for user API
100
+ *
101
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
102
+ */
103
+ type SyncResolutionFunctionWithFallback$1 = (message: string, options?: InlineTranslationOptions$1) => string;
104
+ /**
105
+ * Type for the gt() function
106
+ * @param {string} message - The message to translate
107
+ * @param {InlineTranslationOptions} options - The options for the translation
108
+ * @returns {string} The translated message
109
+ * TODO: next major version, remove the "...type" suffix, it's redundant
110
+ */
111
+ type GTFunctionType$1 = SyncResolutionFunctionWithFallback$1;
112
+ /**
113
+ * Type for the m() function
114
+ * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
115
+ * @param {InlineTranslationOptions} options - The options to interpolate.
116
+ * @returns {string | null | undefined} The decoded and interpolated message.
117
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
118
+ * TODO: next major version, remove the "...type" suffix, it's redundant
119
+ */
120
+ type MFunctionType$1 = <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>) => T extends string ? string : T;
121
+ /**
122
+ * Type for the t() function
123
+ * @param {string} id - The id of the translation to translate.
124
+ * @param {DictionaryTranslationOptions} options - The options for the translation.
125
+ * @returns {string} The translated message.
126
+ * TODO: next major version, remove the "...type" suffix, it's redundant
127
+ */
128
+ //#endregion
129
+ //#region ../i18n/dist/message-C62MTLwE.d.cts
130
+ //#region src/translation-functions/types/message.d.ts
131
+ /**
132
+ * Valid types for messages that can be registered.
133
+ * msg('Hello, World!')
134
+ * msg(['Hello, World!', 'Welcome, {user}!'])
135
+ */
136
+ type RegisterableMessages = string | string[] | readonly string[]; //#endregion
137
+ //#endregion
138
+ //#region src/types-dir/types.d.ts
139
+ /**
140
+ * TaggedElement is a React element with a GTProp property.
141
+ */
142
+ type GTTag = {
143
+ id: number;
144
+ injectionType: InjectionType$1;
145
+ transformation?: TransformationPrefix;
146
+ branches?: Record<string, TaggedChildren>;
147
+ variableType?: VariableTransformationSuffix;
148
+ };
149
+ type TaggedElementProps = Record<string, unknown> & {
150
+ 'data-_gt': GTTag;
151
+ children?: TaggedChildren;
152
+ branch?: string | number | boolean;
153
+ n?: number;
154
+ key?: t.Key;
155
+ };
156
+ type TaggedElement = t.ReactElement<TaggedElementProps>;
157
+ type TaggedChild = Exclude<t.ReactNode, t.ReactElement> | TaggedElement;
158
+ type TaggedChildren = TaggedChild[] | TaggedChild;
159
+ /**
160
+ * For dictionaries, we have Entry and MetaEntry
161
+ */
162
+ type Entry$1 = string;
163
+ type MetaEntry$1 = {
164
+ $context?: string;
165
+ $maxChars?: number;
166
+ $_hash?: string;
167
+ [key: string]: unknown;
168
+ };
169
+ type DictionaryEntry$1 = Entry$1 | [Entry$1] | [Entry$1, MetaEntry$1];
170
+ type Dictionary$1 = {
171
+ [key: string]: Dictionary$1 | DictionaryEntry$1;
172
+ } | (Dictionary$1 | DictionaryEntry$1)[];
173
+ type FlattenedDictionary$1 = {
174
+ [key: string]: DictionaryEntry$1;
175
+ };
176
+ /**
177
+ * Translated content types
178
+ * TODO: move these types to JsxElement etc from generaltranslation/types
179
+ * remember to omit the t property (tag name) from the translated element
180
+ */
181
+ type TranslatedElement$1 = {
182
+ i?: number;
183
+ d?: GTProp$1;
184
+ c?: TranslatedChildren$1;
185
+ };
186
+ type TranslatedChild$1 = TranslatedElement$1 | string | Variable$1;
187
+ type TranslatedChildren$1 = TranslatedChild$1 | TranslatedChild$1[];
188
+ type Translations$1 = {
189
+ [hash: string]: TranslatedChildren$1 | null;
190
+ };
191
+ type RenderMethod$1 = 'skeleton' | 'replace' | 'default';
192
+ type RelativeTimeFormatOptions$1 = Intl.RelativeTimeFormatOptions & {
193
+ unit?: Intl.RelativeTimeFormatUnit;
194
+ baseDate?: Date;
195
+ };
196
+ type VariableProps$1 = {
197
+ /** Whether the variable was automatically injected by the compiler */variableType: VariableType$1;
198
+ variableValue: unknown;
199
+ variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions | RelativeTimeFormatOptions$1;
200
+ variableName: string;
201
+ injectionType: InjectionType$1;
202
+ };
203
+ type RenderVariable$1 = ({
204
+ variableType,
205
+ variableValue,
206
+ variableOptions,
207
+ locales,
208
+ injectionType
209
+ }: Omit<VariableProps$1, 'variableName'> & {
210
+ locales: string[];
211
+ }) => t.ReactNode; //#endregion
212
+ //#region src/internal/flattenDictionary.d.ts
213
+ /**
214
+ * Flattens a nested dictionary by concatenating nested keys.
215
+ * Throws an error if two keys result in the same flattened key.
216
+ * @param {Record<string, any>} dictionary - The dictionary to flatten.
217
+ * @param {string} [prefix=''] - The prefix for nested keys.
218
+ * @returns {Record<string, React.ReactNode>} The flattened dictionary object.
219
+ * @throws {Error} If two keys result in the same flattened key.
220
+ */
221
+ declare function flattenDictionary(dictionary: Dictionary$1, prefix?: string): FlattenedDictionary$1; //#endregion
222
+ //#region src/internal/addGTIdentifier.d.ts
223
+ declare function addGTIdentifier(children: ReactNode, startingIndex?: number): TaggedChildren; //#endregion
224
+ //#region src/internal/removeInjectedT.d.ts
225
+ /**
226
+ * Remove injected _T components at runtime. This is only for i18n-context T components to use.
227
+ * This is necessary because when dealing with deriving fragmented content. The compiler will always
228
+ * inject a `_T` component.
229
+ *
230
+ * Only remove if within a `<Derive>` or `<Static>` component as this scopes this behavior
231
+ * to only where it can actually appear.
232
+ */
233
+ //#endregion
234
+ //#region src/internal/writeChildrenAsObjects.d.ts
235
+ /**
236
+ * Transforms children elements into objects, processing each child recursively if needed.
237
+ * TaggedChildren are transformed into JsxChildren
238
+ * @param {Children} children - The children to process.
239
+ * @returns {object} The processed children as objects.
240
+ */
241
+ declare function writeChildrenAsObjects(children: TaggedChildren): JsxChildren$1; //#endregion
242
+ //#region src/branches/plurals/getPluralBranch.d.ts
243
+ /**
244
+ * Main function to get the appropriate branch based on the provided number and branches.
245
+ *
246
+ * @param {number} n - The number to determine the branch for.
247
+ * @param {any} branches - The object containing possible branches.
248
+ * @returns {any} The determined branch.
249
+ */
250
+ declare function getPluralBranch(n: number, locales: string[], branches: Record<string, unknown>): unknown; //#endregion
251
+ //#region src/dictionaries/getDictionaryEntry.d.ts
252
+ declare function isValidDictionaryEntry(value: unknown): value is DictionaryEntry$1;
253
+ declare function getDictionaryEntry<T extends Dictionary$1>(dictionary: T, id: string): Dictionary$1 | DictionaryEntry$1 | undefined; //#endregion
254
+ //#region src/dictionaries/getEntryAndMetadata.d.ts
255
+ declare function getEntryAndMetadata(value: DictionaryEntry$1): {
256
+ entry: string;
257
+ metadata?: MetaEntry$1;
258
+ }; //#endregion
259
+ //#region src/variables/_getVariableProps.d.ts
260
+ type VariableElementProps = {
261
+ 'data-_gt': GTTag & {
262
+ transformation: 'variable';
263
+ };
264
+ [key: string]: unknown;
265
+ };
266
+ declare function getVariableProps(props: VariableElementProps): VariableProps$1; //#endregion
267
+ //#region src/rendering/isVariableObject.d.ts
268
+ declare function isVariableObject(obj: unknown): obj is Variable$1; //#endregion
269
+ //#region src/variables/getVariableName.d.ts
270
+ declare const defaultVariableNames: {
271
+ readonly variable: "value";
272
+ readonly number: "n";
273
+ readonly datetime: "date";
274
+ readonly currency: "cost";
275
+ readonly 'relative-time': "time";
276
+ };
277
+ declare function getVariableName(props: Record<string, unknown> | undefined, variableType: keyof typeof defaultVariableNames): string; //#endregion
278
+ //#region src/rendering/renderDefaultChildren.d.ts
279
+ declare function renderDefaultChildren({
280
+ children,
281
+ defaultLocale,
282
+ renderVariable
283
+ }: {
284
+ children: TaggedChildren;
285
+ defaultLocale: string;
286
+ renderVariable: RenderVariable$1;
287
+ }): t.ReactNode; //#endregion
288
+ //#region src/rendering/renderTranslatedChildren.d.ts
289
+ declare function renderTranslatedChildren({
290
+ source,
291
+ target,
292
+ locales,
293
+ renderVariable
294
+ }: {
295
+ source: TaggedChildren;
296
+ target: TranslatedChildren$1;
297
+ locales: string[];
298
+ renderVariable: RenderVariable$1;
299
+ }): ReactNode; //#endregion
300
+ //#region src/rendering/getDefaultRenderSettings.d.ts
301
+ declare const getDefaultRenderSettings: (environment?: "development" | "production" | "test") => {
302
+ method: RenderMethod$1;
303
+ timeout: number;
304
+ }; //#endregion
305
+ //#region src/rendering/renderSkeleton.d.ts
306
+ /**
307
+ * renderSkeleton is a function that handles the rendering behavior for the skeleton loading method.
308
+ * It replaces all content with empty strings
309
+ * @returns an empty string
310
+ */
311
+ declare function renderSkeleton(): t.ReactNode; //#endregion
312
+ //#region src/utils/cookies.d.ts
313
+ /**
314
+ * Cookie name for tracking the referrer locale
315
+ */
316
+ declare const defaultLocaleCookieName = "generaltranslation.locale";
317
+ /**
318
+ * Cookie name for tracking the user's selected region
319
+ */
320
+ declare const defaultRegionCookieName = "generaltranslation.region";
321
+ /**
322
+ * Cookie name for persisting the enableI18n feature flag
323
+ * "true" or "false"
324
+ */
325
+ //#endregion
326
+ //#region src/dictionaries/mergeDictionaries.d.ts
327
+ declare function mergeDictionaries(defaultLocaleDictionary: Dictionary$1, localeDictionary: Dictionary$1): Dictionary$1; //#endregion
328
+ //#region src/promises/reactHasUse.d.ts
329
+ declare const reactHasUse: boolean; //#endregion
330
+ //#region src/dictionaries/getSubtree.d.ts
331
+ declare function getSubtree<T extends Dictionary$1>({
332
+ dictionary,
333
+ id
334
+ }: {
335
+ dictionary: T;
336
+ id: string;
337
+ }): Dictionary$1 | DictionaryEntry$1 | undefined;
338
+ /**
339
+ * @description A function that gets a subtree from a dictionary
340
+ * @param dictionary - new dictionary to get the subtree from
341
+ * @param id - id of the subtree to get
342
+ * @param sourceDictionary - source dictionary to model off of
343
+ * @returns
344
+ */
345
+ declare function getSubtreeWithCreation<T extends Dictionary$1>({
346
+ dictionary,
347
+ id,
348
+ sourceDictionary
349
+ }: {
350
+ dictionary: T;
351
+ id: string;
352
+ sourceDictionary: T;
353
+ }): Dictionary$1 | DictionaryEntry$1 | undefined; //#endregion
354
+ //#region src/dictionaries/injectEntry.d.ts
355
+ /**
356
+ * @description Injects an entry into a translations object
357
+ * @param translations - The translations object to inject the entry into
358
+ * @param entry - The entry to inject
359
+ * @param hash - The hash of the entry
360
+ * @param sourceDictionary - The source dictionary to model the new dictionary after
361
+ */
362
+ declare function injectEntry(dictionaryEntry: DictionaryEntry$1, dictionary: Dictionary$1 | DictionaryEntry$1, id: string, sourceDictionary: Dictionary$1 | DictionaryEntry$1): DictionaryEntry$1 | undefined; //#endregion
363
+ //#region src/dictionaries/isDictionaryEntry.d.ts
364
+ /**
365
+ * Type guard function that checks if a value is a DictionaryEntry
366
+ * @param value - The value to check
367
+ * @returns true if the value is a DictionaryEntry, false otherwise
368
+ */
369
+ declare function isDictionaryEntry(value: Dictionary$1 | DictionaryEntry$1 | undefined): value is DictionaryEntry$1; //#endregion
370
+ //#region src/dictionaries/stripMetadataFromEntries.d.ts
371
+ /**
372
+ * @description Iterate over tree and remove metadata leaving just the entry
373
+ */
374
+ declare function stripMetadataFromEntries(dictionary: Dictionary$1): Dictionary$1; //#endregion
375
+ //#region src/dictionaries/injectHashes.d.ts
376
+ /**
377
+ * @description Given a dictionary, adds hashes to all dictionary entries
378
+ * @param dictionary - The dictionary to add hashes to
379
+ * @param id - The starting point of dictionary (if subtree)
380
+ */
381
+ declare function injectHashes(dictionary: Dictionary$1, id?: string): {
382
+ dictionary: Dictionary$1;
383
+ updateDictionary: boolean;
384
+ }; //#endregion
385
+ //#region src/dictionaries/injectTranslations.d.ts
386
+ /**
387
+ * @description Injects translations into a dictionary
388
+ * @param dictionary - The dictionary to inject translations into
389
+ * @param translationsDictionary - The translations to inject into the dictionary
390
+ * @param translations - The translations to inject into the dictionary
391
+ * @param id - The id of the dictionary to inject translations into
392
+ */
393
+ declare function injectTranslations(dictionary: Dictionary$1, translationsDictionary: Dictionary$1, translations: Translations$1, missingTranslations: {
394
+ source: string;
395
+ metadata: {
396
+ $id: string;
397
+ $context?: string;
398
+ $maxChars?: number;
399
+ $_hash: string;
400
+ };
401
+ }[], prefixToRemove?: string): {
402
+ dictionary: Dictionary$1;
403
+ updateDictionary: boolean;
404
+ }; //#endregion
405
+ //#region src/dictionaries/injectFallbacks.d.ts
406
+ /**
407
+ * @description Injects fallbacks into a dictionary
408
+ * @param dictionary - The dictionary to inject translations into
409
+ * @param translationsDictionary - The translations to inject into the dictionary
410
+ * @param translations - The translations to inject into the dictionary
411
+ * @param id - The id of the dictionary to inject translations into
412
+ */
413
+ declare function injectFallbacks(dictionary: Dictionary$1, translationsDictionary: Dictionary$1, missingTranslations: {
414
+ source: string;
415
+ metadata: {
416
+ $id: string;
417
+ $context?: string;
418
+ $maxChars?: number;
419
+ $_hash: string;
420
+ };
421
+ }[], prefixToRemove?: string): Dictionary$1; //#endregion
422
+ //#region src/dictionaries/injectAndMerge.d.ts
423
+ /**
424
+ * @description Given a subtree and a dictionary, injects the subtree into the dictionary at the given id
425
+ * @param dictionary - The dictionary to inject the subtree into
426
+ * @param subtree - The subtree to inject into the dictionary
427
+ * @param id - The id of the subtree to inject into the dictionary
428
+ */
429
+ declare function injectAndMerge(dictionary: Dictionary$1, subtree: Dictionary$1, id: string): Dictionary$1; //#endregion
430
+ //#region src/dictionaries/collectUntranslatedEntries.d.ts
431
+ /**
432
+ * @description Collects all untranslated entries from a dictionary
433
+ * @param dictionary - The dictionary to collect untranslated entries from
434
+ * @param translationsDictionary - The translated dictionary to compare against
435
+ * @param id - The id of the dictionary to collect untranslated entries from
436
+ * @returns An array of untranslated entries
437
+ */
438
+ declare function collectUntranslatedEntries(dictionary: Dictionary$1, translationsDictionary: Dictionary$1, id?: string): {
439
+ source: string;
440
+ metadata: {
441
+ $id: string;
442
+ $context?: string;
443
+ $maxChars?: number;
444
+ $_hash: string;
445
+ };
446
+ }[]; //#endregion
447
+ //#region ../i18n/dist/index-BLWcN0wI.d.cts
448
+ //#region src/translation-functions/fallbacks/gtFallback.d.ts
449
+ /**
450
+ * A fallback function for the gt() function that decodes and interpolates.
451
+ * @param {string | null | undefined} message - The ICU formatted message to interpolate.
452
+ * @param {InlineTranslationOptions} options - The options to interpolate.
453
+ * @returns - The decoded and interpolated message.
454
+ *
455
+ * @note This function is useful as a placeholder when for incrementally migrating to the m() function.
456
+ * @example
457
+ * // A backwards compatible translation function
458
+ * function getMessage(gt: GTFunctionType = gtFallback) {
459
+ * return gt('Hello, world!');
460
+ * }
461
+ *
462
+ * // Here i18n has been implemented
463
+ * function WithTranslation() {
464
+ * const gt = useGT();
465
+ * return <>{getMessage(gt)}</>;
466
+ * }
467
+ *
468
+ *
469
+ * // i18n has not yet been implemented yet
470
+ * function WithoutTranslations() {
471
+ * return <>{getMessage()}</>;
472
+ * }
473
+ */
474
+ declare const gtFallback: GTFunctionType$1; //#endregion
475
+ //#region src/translation-functions/fallbacks/mFallback.d.ts
476
+ /**
477
+ * A fallback function for the m() function that decodes and interpolates.
478
+ * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
479
+ * @param {InlineTranslationOptions} options - The options to interpolate.
480
+ * @returns - The decoded and interpolated message.
481
+ *
482
+ * @note This function is useful as a placeholder when for incrementally migrating to the m() function.
483
+ * @example
484
+ * // A backwards compatible translation function
485
+ * function getMessage(m: MFunctionType = mFallback) {
486
+ * return m(msg('Hello, world!'));
487
+ * }
488
+ *
489
+ * // Here i18n has been implemented
490
+ * function WithTranslation() {
491
+ * const m = useMessages();
492
+ * return <>{getMessage(m)}</>;
493
+ * }
494
+ *
495
+ *
496
+ * // i18n has not yet been implemented yet
497
+ * function WithoutTranslations() {
498
+ * return <>{getMessage()}</>;
499
+ * }
500
+ */
501
+ declare const mFallback: MFunctionType$1; //#endregion
502
+ //#endregion
503
+ //#region ../core/dist/internal.d.cts
504
+ //#endregion
505
+ //#region src/derive/decodeVars.d.ts
506
+ /**
507
+ * Given an encoded ICU string, interpolate only _gt_ variables that have been marked with declareVar()
508
+ * @example
509
+ * const encodedIcu = "Hi" + declareVar("Brian") + ", my name is {name}"
510
+ * // 'Hi {_gt_, select, other {Brian}}, my name is {name}'
511
+ * decodeVars(encodedIcu)
512
+ * // 'Hi Brian, my name is {name}'
513
+ */
514
+ declare function decodeVars(icuString: string): string; //#endregion
515
+ //#region src/derive/declareVar.d.ts
516
+ /**
517
+ * Mark as a non-translatable string. Use within a derive() call to mark content as not derivable (e.g., not possible to statically analyze).
518
+ *
519
+ * @example
520
+ * function nonDerivableFunction() {
521
+ * return Math.random();
522
+ * }
523
+ *
524
+ * function derivableFunction() {
525
+ * if (condition) {
526
+ * return declareVar(nonDerivableFunction())
527
+ * }
528
+ * return 'John Doe';
529
+ * }
530
+ *
531
+ * const gt = useGT();
532
+ * gt(`My name is ${derive(derivableFunction())}`);
533
+ *
534
+ * @param {string | number | boolean | null | undefined} variable - The variable to sanitize.
535
+ * @param {Object} [options] - The options for the sanitization.
536
+ * @param {string} [options.$name] - The name of the variable.
537
+ * @returns {string} The sanitized value.
538
+ */
539
+ declare function declareVar(variable: string | number | boolean | null | undefined, options?: {
540
+ $name?: string;
541
+ }): string; //#endregion
542
+ //#region src/derive/derive.d.ts
543
+ /**
544
+ * Marks content as derivable by the GT compiler and CLI.
545
+ *
546
+ * Use `derive()` when a translation string or context needs content that is
547
+ * computed from source code, but should still be discovered during extraction
548
+ * instead of treated as a runtime interpolation variable. The CLI attempts to
549
+ * resolve the derivable expression into every possible static value and
550
+ * includes those values in the source content that gets translated.
551
+ *
552
+ * `derive()` returns its argument unchanged at runtime.
553
+ *
554
+ * Run `gt validate` after adding or changing `derive()` calls to verify that
555
+ * each derivable expression can be resolved by the CLI before translating or
556
+ * building.
557
+ *
558
+ * @example
559
+ * ```jsx
560
+ * function getSubject() {
561
+ * return (Math.random() > 0.5) ? "Alice" : "Brian";
562
+ * }
563
+ * ...
564
+ * gt(`My name is ${derive(getSubject())}`);
565
+ * ```
566
+ *
567
+ * @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.
568
+ * @returns {T} The same content, unchanged at runtime.
569
+ */
570
+ declare function derive<T extends string | boolean | number | null | undefined>(content: T): T;
571
+ /**
572
+ * @deprecated Use derive() instead.
573
+ *
574
+ * Marks content as derivable by the GT compiler and CLI.
575
+ *
576
+ * Use `derive()` instead of `declareStatic()` for new code. This alias is kept
577
+ * for backwards compatibility and returns its argument unchanged at runtime.
578
+ *
579
+ * Run `gt validate` after adding or changing derived content to verify that
580
+ * each derivable expression can be resolved by the CLI before translating or
581
+ * building.
582
+ *
583
+ * @example
584
+ * ```jsx
585
+ * function getSubject() {
586
+ * return (Math.random() > 0.5) ? "Alice" : "Brian";
587
+ * }
588
+ * ...
589
+ * gt(`My name is ${declareStatic(getSubject())}`);
590
+ * ```
591
+ *
592
+ * @param {T extends string | boolean | number | null | undefined} content - Content to derive for translation extraction.
593
+ * @returns {T} The same content, unchanged at runtime.
594
+ */
595
+ declare const declareStatic: typeof derive; //#endregion
596
+ //#region src/derive/indexVars.d.ts
597
+ /**
598
+ * Given an ICU string adds identifiers to each _gt_ placeholder
599
+ * indexVars('Hello {_gt_} {_gt_} World') => 'Hello {_gt_1_} {_gt_2_} World'
600
+ */
601
+ //#endregion
602
+ //#region ../i18n/dist/index.d.cts
603
+ //#endregion
604
+ //#region src/translation-functions/msg/msg.d.ts
605
+ /**
606
+ * Registers a message to be translated. Returns the message unchanged if no options are provided.
607
+ * @param {string | string[]} message The message to encode.
608
+ * @param {InlineTranslationOptions} [options] The options to encode.
609
+ * @returns The message or array of messages.
610
+ *
611
+ * @note - This function registers the message before the build process. The actual translation does not
612
+ * occur until the m() function is invoked.
613
+ *
614
+ * @note - Message format
615
+ * A message is broken into two parts separated by colons:
616
+ * - interpolated content - the content with interpolated variables
617
+ * - hash + options - a unique identifier for the source content and options for the translation
618
+ *
619
+ * @example - Basic usage
620
+ *
621
+ * const message1 = msg('Hello, World!');
622
+ * console.log(message1); // "Hello, World!"
623
+ *
624
+ * const message2 = msg('Hello, {name}!', { name: 'Brian' });
625
+ * console.log(message2); // "Hello, Brian:eyIkX2hhc2giOiAiMHgxMjMiLCAiJF9zb3VyY2UiOiAiSGVsbG8sIHtuYW1lfSEiLCAibmFtZSI6ICJCcmlhbiJ9"
626
+ *
627
+ * @example - Array usage
628
+ *
629
+ * const messages = msg(['Hello, Alice!', 'Hello, Bob!']);
630
+ * console.log(messages); // ["Hello, Alice!", "Hello, Bob!"]
631
+ *
632
+ * @example - When specifying an id for an array, each message will have a unique id of `${id}.${index}`
633
+ * const messages = msg(['Hello, Alice!', 'Hello, Bob!'], { $id: 'greetings' });
634
+ * // "Hello, Alice!" id: "greetings.0"
635
+ * // "Hello, Bob!" id: "greetings.1"
636
+ *
637
+ * @important Internal note: until other packages are updated to use i18n-context practices, msg cannot use any functions that use i18nManager at all!
638
+ */
639
+ declare function msg<T extends RegisterableMessages = string>(message: T): T;
640
+ declare function msg<T extends RegisterableMessages = string>(message: T, options?: InlineTranslationOptions$1): T extends string ? string : string[]; //#endregion
641
+ //#region src/translation-functions/msg/decodeMsg.d.ts
642
+ /**
643
+ * Extracts the original interpolated message string.
644
+ * If the message cannot be decoded (i.e., it does not contain a colon separator),
645
+ * the input is returned as-is.
646
+ * @param encodedMsg The message to decode.
647
+ * @returns The decoded message, or the input if it cannot be decoded.
648
+ */
649
+ declare function decodeMsg(encodedMsg: string): string;
650
+ declare function decodeMsg<T extends null | undefined>(encodedMsg: T): T;
651
+ declare function decodeMsg<T extends string | null | undefined>(encodedMsg: T): T extends string ? string : T; //#endregion
652
+ //#region src/translation-functions/msg/decodeOptions.d.ts
653
+ /**
654
+ * Decodes the options from an encoded message.
655
+ * @param encodedMsg The message to decode.
656
+ * @returns The decoded options.
657
+ */
658
+ declare function decodeOptions(encodedMsg: string): InlineTranslationOptions$1 | null; //#endregion
659
+ //#endregion
660
+ //#region src/variables/Derive.d.ts
661
+ /**
662
+ * Marks JSX children as derivable by the GT compiler and CLI.
663
+ *
664
+ * Use `<Derive>` inside translated JSX when child content is computed from
665
+ * source code, but should still be discovered during extraction instead of
666
+ * treated as a runtime interpolation variable. The CLI attempts to resolve the
667
+ * derivable children into every possible static value and includes those values
668
+ * in the source content that gets translated.
669
+ *
670
+ * `<Derive>` renders its children unchanged at runtime.
671
+ *
672
+ * Run `gt validate` after adding or changing `<Derive>` usage to verify that
673
+ * each derivable expression can be resolved by the CLI before translating or
674
+ * building.
675
+ *
676
+ * @example
677
+ * ```jsx
678
+ * function getSubject() {
679
+ * return (Math.random() > 0.5) ? "Alice" : "Brian";
680
+ * }
681
+ * ...
682
+ * <T>
683
+ * <Derive>
684
+ * {getSubject()}
685
+ * </Derive>
686
+ * is going to school today.
687
+ * </T>
688
+ * ```
689
+ *
690
+ * @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.
691
+ * @returns {T} The same children, unchanged at runtime.
692
+ */
693
+ declare function Derive<T extends t.ReactNode>({
694
+ children
695
+ }: {
696
+ children: T;
697
+ }): T;
698
+ declare namespace Derive {
699
+ var _gtt: string;
700
+ }
701
+ /**
702
+ * @deprecated Use `<Derive>` instead.
703
+ *
704
+ * Marks JSX children as derivable by the GT compiler and CLI.
705
+ *
706
+ * Use `<Derive>` instead of `<Static>` for new code. This alias is kept for
707
+ * backwards compatibility and renders its children unchanged at runtime.
708
+ *
709
+ * Run `gt validate` after adding or changing derived JSX content to verify that
710
+ * each derivable expression can be resolved by the CLI before translating or
711
+ * building.
712
+ *
713
+ * @example
714
+ * ```jsx
715
+ * function getSubject() {
716
+ * return (Math.random() > 0.5) ? "Alice" : "Brian";
717
+ * }
718
+ * ...
719
+ * <T>
720
+ * <Static>
721
+ * {getSubject()}
722
+ * </Static>
723
+ * is going to school today.
724
+ * </T>
725
+ * ```
726
+ *
727
+ * @param {T extends React.ReactNode} children - JSX content to derive for translation extraction.
728
+ * @returns {T} The same children, unchanged at runtime.
729
+ */
730
+ declare function Static<T extends t.ReactNode>(props: {
731
+ children: T;
732
+ }): T;
733
+ declare namespace Static {
734
+ var _gtt: string;
735
+ } //#endregion
736
+ //#endregion
737
+ //#region ../react-core/dist/types.d.ts
738
+ //#region ../format/dist/types-UnF22q9r.d.cts
739
+ //#region src/locales/customLocaleMapping.d.ts
740
+ type CustomMapping$1 = Record<string, string | Partial<LocaleProperties$1>>; //#endregion
741
+ //#region src/locales/getLocaleProperties.d.ts
742
+ type LocaleProperties$1 = {
743
+ code: string;
744
+ name: string;
745
+ nativeName: string;
746
+ languageCode: string;
747
+ languageName: string;
748
+ nativeLanguageName: string;
749
+ nameWithRegionCode: string;
750
+ nativeNameWithRegionCode: string;
751
+ regionCode: string;
752
+ regionName: string;
753
+ nativeRegionName: string;
754
+ scriptCode: string;
755
+ scriptName: string;
756
+ nativeScriptName: string;
757
+ maximizedCode: string;
758
+ maximizedName: string;
759
+ nativeMaximizedName: string;
760
+ minimizedCode: string;
761
+ minimizedName: string;
762
+ nativeMinimizedName: string;
763
+ emoji: string;
764
+ }; //#endregion
765
+ //#region src/locales/getRegionProperties.d.ts
766
+ //#endregion
767
+ //#region src/types-dir/jsx/variables.d.ts
768
+ type VariableType = 'v' | 'n' | 'd' | 'c' | 'rt';
769
+ /**
770
+ * Variables are used to store the variable name and type.
771
+ */
772
+ type Variable = {
773
+ k: string;
774
+ i?: number;
775
+ v?: VariableType;
776
+ }; //#endregion
777
+ //#region src/types-dir/jsx/content.d.ts
778
+ /**
779
+ * Map of data-_gt properties to their corresponding React props
780
+ */
781
+ declare const HTML_CONTENT_PROPS: {
782
+ readonly pl: "placeholder";
783
+ readonly ti: "title";
784
+ readonly alt: "alt";
785
+ readonly arl: "aria-label";
786
+ readonly arb: "aria-labelledby";
787
+ readonly ard: "aria-describedby";
788
+ };
789
+ type HtmlContentPropKeysRecord = Partial<Record<keyof typeof HTML_CONTENT_PROPS, string>>;
790
+ /**
791
+ * GTProp is an internal property used to contain data for translating and rendering elements.
792
+ * note, transformations are only read on the server side if they are 'plural' or 'branch'
793
+ */
794
+ type GTProp = {
795
+ b?: Record<string, JsxChildren>;
796
+ t?: 'p' | 'b';
797
+ } & HtmlContentPropKeysRecord;
798
+ type JsxElement = {
799
+ t?: string;
800
+ i?: number;
801
+ d?: GTProp;
802
+ c?: JsxChildren;
803
+ };
804
+ type JsxChild = string | JsxElement | Variable;
805
+ /**
806
+ * The format of the string content
807
+ */
808
+ type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';
809
+ /**
810
+ * The format of the content.
811
+ */
812
+ type DataFormat = 'JSX' | StringFormat;
813
+ /**
814
+ * String format content.
815
+ */
816
+ /**
817
+ * A content type representing JSX elements.
818
+ */
819
+ type JsxChildren = JsxChild | JsxChild[];
820
+ /**
821
+ * A content type representing ICU messages.
822
+ */
823
+ //#endregion
824
+ //#region ../core/dist/types-YrrGRHBP.d.cts
825
+ type InjectionType = 'automatic' | 'manual'; //#endregion
826
+ //#region src/types.d.ts
827
+ /**
828
+ * @deprecated Use {@link Content} instead.
829
+ */
830
+ //#endregion
831
+ //#region ../i18n/dist/options-D0Lnxv2X.d.cts
832
+ //#region src/translation-functions/types/options.d.ts
833
+ type BaseTranslationOptions = Record<string, unknown>;
834
+ type DictionaryTranslationOptions = BaseTranslationOptions;
835
+ /**
836
+ * Options for string resolution
837
+ * Used by the gt() function
838
+ */
839
+ type InlineTranslationOptions = BaseTranslationOptions & {
840
+ $context?: string;
841
+ $id?: string; /** The data format for the message (e.g., 'ICU', 'STRING'). Defaults to 'ICU'. */
842
+ $format?: StringFormat; /** The locale to use for formatting the message. */
843
+ $locale?: string;
844
+ /**
845
+ * @deprecated use {@link $locale} instead
846
+ */
847
+ $_locales?: string | string[];
848
+ $_hash?: string;
849
+ $maxChars?: number; /** @deprecated use {@link EncodedTranslationOptions} instead */
850
+ $_source?: string;
851
+ };
852
+ /**
853
+ * Options for string resolution
854
+ * Used by the m() function
855
+ */
856
+ /**
857
+ * Options for runtime translation
858
+ * Used by the tx() function
859
+ */
860
+ type RuntimeTranslationOptions = {
861
+ $locale?: string;
862
+ $format?: DataFormat;
863
+ } & Omit<InlineTranslationOptions, '$id' | '$format'>;
864
+ /**
865
+ * Options for JSX translation
866
+ * Used by the resolveJsxTranslation() function
867
+ */
868
+ //#endregion
869
+ //#region ../i18n/dist/functions-DI1QpQoC.d.cts
870
+ /**
871
+ * Synchronous resolution function type
872
+ * @param {string} message - The message to translate.
873
+ * @param {InlineTranslationOptions} options - The options for the translation.
874
+ * @returns {string} The translated message.
875
+ *
876
+ * @important This is base type for user API
877
+ *
878
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
879
+ */
880
+ type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
881
+ /**
882
+ * Type for the gt() function
883
+ * @param {string} message - The message to translate
884
+ * @param {InlineTranslationOptions} options - The options for the translation
885
+ * @returns {string} The translated message
886
+ * TODO: next major version, remove the "...type" suffix, it's redundant
887
+ */
888
+ type GTFunctionType = SyncResolutionFunctionWithFallback;
889
+ /**
890
+ * Type for the m() function
891
+ * @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
892
+ * @param {InlineTranslationOptions} options - The options to interpolate.
893
+ * @returns {string | null | undefined} The decoded and interpolated message.
894
+ * TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
895
+ * TODO: next major version, remove the "...type" suffix, it's redundant
896
+ */
897
+ type MFunctionType = <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>) => T extends string ? string : T;
898
+ /**
899
+ * Type for the t() function
900
+ * @param {string} id - The id of the translation to translate.
901
+ * @param {DictionaryTranslationOptions} options - The options for the translation.
902
+ * @returns {string} The translated message.
903
+ * TODO: next major version, remove the "...type" suffix, it's redundant
904
+ */
905
+ //#endregion
906
+ //#region src/types-dir/types.d.ts
907
+ /**
908
+ * TaggedElement is a React element with a GTProp property.
909
+ */
910
+ /**
911
+ * For dictionaries, we have Entry and MetaEntry
912
+ */
913
+ type Entry = string;
914
+ type MetaEntry = {
915
+ $context?: string;
916
+ $maxChars?: number;
917
+ $_hash?: string;
918
+ [key: string]: unknown;
919
+ };
920
+ type DictionaryEntry = Entry | [Entry] | [Entry, MetaEntry];
921
+ type Dictionary = {
922
+ [key: string]: Dictionary | DictionaryEntry;
923
+ } | (Dictionary | DictionaryEntry)[];
924
+ type FlattenedDictionary = {
925
+ [key: string]: DictionaryEntry;
926
+ };
927
+ /**
928
+ * Translated content types
929
+ * TODO: move these types to JsxElement etc from generaltranslation/types
930
+ * remember to omit the t property (tag name) from the translated element
931
+ */
932
+ type TranslatedElement = {
933
+ i?: number;
934
+ d?: GTProp;
935
+ c?: TranslatedChildren;
936
+ };
937
+ type TranslatedChild = TranslatedElement | string | Variable;
938
+ type TranslatedChildren = TranslatedChild | TranslatedChild[];
939
+ type Translations = {
940
+ [hash: string]: TranslatedChildren | null;
941
+ };
942
+ /**
943
+ * @deprecated use {@link Dictionary}
944
+ */
945
+ type DictionaryContent = string;
946
+ /**
947
+ * @deprecated use {@link Dictionary}
948
+ */
949
+ type DictionaryObject = {
950
+ [id: string]: DictionaryContent;
951
+ };
952
+ type LocalesDictionary = {
953
+ [locale: string]: DictionaryObject;
954
+ };
955
+ type CustomLoader = (locale: string) => Promise<unknown>;
956
+ type RenderMethod = 'skeleton' | 'replace' | 'default';
957
+ type RelativeTimeFormatOptions = Intl.RelativeTimeFormatOptions & {
958
+ unit?: Intl.RelativeTimeFormatUnit;
959
+ baseDate?: Date;
960
+ };
961
+ type VariableProps = {
962
+ /** Whether the variable was automatically injected by the compiler */variableType: VariableType;
963
+ variableValue: unknown;
964
+ variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions | RelativeTimeFormatOptions;
965
+ variableName: string;
966
+ injectionType: InjectionType;
967
+ };
968
+ type RenderVariable = ({
969
+ variableType,
970
+ variableValue,
971
+ variableOptions,
972
+ locales,
973
+ injectionType
974
+ }: Omit<VariableProps, 'variableName'> & {
975
+ locales: string[];
976
+ }) => t.ReactNode;
977
+ type _Message = {
978
+ message: string;
979
+ $id?: string;
980
+ $context?: string;
981
+ $maxChars?: number;
982
+ $_hash?: string;
983
+ };
984
+ type _Messages = _Message[]; //#endregion
985
+ //#region src/types-dir/runtime.d.ts
986
+ //#endregion
987
+ //#region src/provider/hooks/locales/types.d.ts
988
+ type UseDetermineLocaleParams = {
989
+ defaultLocale: string;
990
+ locales: string[];
991
+ enableI18n: boolean;
992
+ locale?: string;
993
+ localeCookieName?: string;
994
+ ssr?: boolean;
995
+ customMapping?: CustomMapping$1;
996
+ reloadOnLocaleUpdate?: boolean;
997
+ };
998
+ type UseDetermineLocaleReturn = [string, (locale: string) => void]; //#endregion
999
+ //#region src/provider/hooks/types.d.ts
1000
+ //#endregion
1001
+ //#region src/types-dir/config.d.ts
1002
+ type GTConfig = {
1003
+ projectId?: string;
1004
+ devApiKey?: string;
1005
+ locales?: string[];
1006
+ defaultLocale?: string;
1007
+ dictionary?: string;
1008
+ runtimeUrl?: string | null;
1009
+ cacheUrl?: string | null;
1010
+ renderSettings?: {
1011
+ method: RenderMethod;
1012
+ timeout?: number;
1013
+ };
1014
+ _versionId?: string;
1015
+ ssr?: boolean;
1016
+ localeCookieName?: string;
1017
+ customMapping?: CustomMapping$1;
1018
+ modelProvider?: string;
1019
+ enableI18n?: boolean;
1020
+ };
1021
+ //#endregion
1022
+ //#region ../format/dist/types-UnF22q9r.d.cts
1023
+ //#region src/locales/customLocaleMapping.d.ts
1024
+ type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
1025
+ //#region src/locales/getLocaleProperties.d.ts
1026
+ type LocaleProperties = {
1027
+ code: string;
1028
+ name: string;
1029
+ nativeName: string;
1030
+ languageCode: string;
1031
+ languageName: string;
1032
+ nativeLanguageName: string;
1033
+ nameWithRegionCode: string;
1034
+ nativeNameWithRegionCode: string;
1035
+ regionCode: string;
1036
+ regionName: string;
1037
+ nativeRegionName: string;
1038
+ scriptCode: string;
1039
+ scriptName: string;
1040
+ nativeScriptName: string;
1041
+ maximizedCode: string;
1042
+ maximizedName: string;
1043
+ nativeMaximizedName: string;
1044
+ minimizedCode: string;
1045
+ minimizedName: string;
1046
+ nativeMinimizedName: string;
1047
+ emoji: string;
1048
+ }; //#endregion
1049
+ //#region src/locales/getRegionProperties.d.ts
1050
+ //#endregion
1051
+ //#region src/react-context/types/config.d.ts
1052
+ type ClientProviderProps = {
1053
+ children: React.ReactNode;
1054
+ dictionary: Dictionary;
1055
+ dictionaryTranslations: Dictionary;
1056
+ translations: Translations;
1057
+ locale: string;
1058
+ locales: string[];
1059
+ region?: string;
1060
+ _versionId?: string;
1061
+ dictionaryEnabled?: boolean;
1062
+ defaultLocale: string;
1063
+ translationRequired: boolean;
1064
+ dialectTranslationRequired: boolean;
1065
+ renderSettings: {
1066
+ method: RenderMethod;
1067
+ timeout?: number;
1068
+ };
1069
+ developmentApiEnabled: boolean;
1070
+ projectId?: string;
1071
+ devApiKey?: string;
1072
+ runtimeUrl?: string | null;
1073
+ gtServicesEnabled?: boolean;
1074
+ localeCookieName?: string;
1075
+ resetLocaleCookieName: string;
1076
+ regionCookieName?: string;
1077
+ customMapping?: CustomMapping;
1078
+ environment: 'development' | 'production' | 'test';
1079
+ reloadServer: () => void;
1080
+ };
1081
+ type GTProviderProps = {
1082
+ children?: React.ReactNode;
1083
+ projectId?: string;
1084
+ devApiKey?: string;
1085
+ dictionary?: Dictionary;
1086
+ locales?: string[];
1087
+ defaultLocale?: string;
1088
+ locale?: string;
1089
+ region?: string;
1090
+ cacheUrl?: string | null;
1091
+ runtimeUrl?: string | null;
1092
+ renderSettings?: {
1093
+ method: RenderMethod;
1094
+ timeout?: number;
1095
+ };
1096
+ _versionId?: string;
1097
+ ssr?: boolean;
1098
+ localeCookieName?: string;
1099
+ translations?: Translations | null;
1100
+ loadDictionary?: CustomLoader;
1101
+ loadTranslations?: CustomLoader;
1102
+ config?: GTConfig;
1103
+ fallback?: React.ReactNode;
1104
+ customMapping?: CustomMapping;
1105
+ modelProvider?: string;
1106
+ enableI18n?: boolean;
1107
+ enableI18nLoaded?: boolean;
1108
+ /**
1109
+ * @internal - internal use only
1110
+ * TODO: this should have a separate export for internal use
1111
+ */
1112
+ useDetermineLocale?: (params: UseDetermineLocaleParams) => UseDetermineLocaleReturn;
1113
+ reloadOnLocaleUpdate?: boolean;
1114
+ [key: string]: unknown;
1115
+ };
1116
+ //#endregion
1117
+ export { type ClientProviderProps, type CustomLoader, Derive, type Dictionary, type DictionaryContent, type DictionaryEntry, type DictionaryObject, type DictionaryTranslationOptions, type Entry, type FlattenedDictionary, type GTFunctionType, type GTProp, type GTProviderProps, type InlineTranslationOptions, type LocalesDictionary, type MFunctionType, type MetaEntry as Metadata, type RenderMethod, type RenderVariable, type RuntimeTranslationOptions, Static, type TranslatedChildren, type Translations, type VariableProps, type _Message, type _Messages, addGTIdentifier, collectUntranslatedEntries, declareStatic, declareVar, decodeMsg, decodeOptions, decodeVars, defaultLocaleCookieName, defaultRegionCookieName, derive, flattenDictionary, getDefaultRenderSettings, getDictionaryEntry, getEntryAndMetadata, getPluralBranch, getSubtree, getSubtreeWithCreation, getVariableName, getVariableProps, gtFallback, injectAndMerge, injectEntry, injectFallbacks, injectHashes, injectTranslations, isDictionaryEntry, isValidDictionaryEntry, isVariableObject, mFallback, mergeDictionaries, msg, reactHasUse, renderDefaultChildren, renderSkeleton, renderTranslatedChildren, stripMetadataFromEntries, writeChildrenAsObjects };
1118
+ //# sourceMappingURL=internal.d.mts.map