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