@generaltranslation/react-core 1.8.21 → 2.0.0-odysseus.0
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 +18 -0
- package/dist/components-rsc.cjs.min.cjs +2 -0
- package/dist/components-rsc.cjs.min.cjs.map +1 -0
- package/dist/components-rsc.d.ts +531 -0
- package/dist/components-rsc.d.ts.map +1 -0
- package/dist/components-rsc.esm.min.mjs +2 -0
- package/dist/components-rsc.esm.min.mjs.map +1 -0
- package/dist/components.cjs.min.cjs +2 -0
- package/dist/components.cjs.min.cjs.map +1 -0
- package/dist/components.d.ts +495 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.esm.min.mjs +2 -0
- package/dist/components.esm.min.mjs.map +1 -0
- package/dist/hooks.cjs.min.cjs +2 -0
- package/dist/hooks.cjs.min.cjs.map +1 -0
- package/dist/hooks.d.ts +130 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.esm.min.mjs +2 -0
- package/dist/hooks.esm.min.mjs.map +1 -0
- package/dist/pure.cjs.min.cjs +2 -0
- package/dist/pure.cjs.min.cjs.map +1 -0
- package/dist/pure.d.ts +677 -0
- package/dist/pure.d.ts.map +1 -0
- package/dist/pure.esm.min.mjs +2 -0
- package/dist/pure.esm.min.mjs.map +1 -0
- package/package.json +40 -35
- package/dist/errors.cjs.min.cjs +0 -2
- package/dist/errors.cjs.min.cjs.map +0 -1
- package/dist/errors.d.ts +0 -5
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.esm.min.mjs +0 -2
- package/dist/errors.esm.min.mjs.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 -1385
- 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 -765
- 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/types.d.ts +0 -437
- package/dist/types.d.ts.map +0 -1
package/dist/types.d.ts
DELETED
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
import { GT } from "generaltranslation";
|
|
3
|
-
|
|
4
|
-
//#region ../format/dist/types-COaQnqVZ.d.cts
|
|
5
|
-
//#region src/locales/customLocaleMapping.d.ts
|
|
6
|
-
type CustomMapping = Record<string, string | Partial<LocaleProperties>>; //#endregion
|
|
7
|
-
//#region src/locales/getLocaleProperties.d.ts
|
|
8
|
-
type LocaleProperties = {
|
|
9
|
-
code: string;
|
|
10
|
-
name: string;
|
|
11
|
-
nativeName: string;
|
|
12
|
-
languageCode: string;
|
|
13
|
-
languageName: string;
|
|
14
|
-
nativeLanguageName: string;
|
|
15
|
-
nameWithRegionCode: string;
|
|
16
|
-
nativeNameWithRegionCode: string;
|
|
17
|
-
regionCode: string;
|
|
18
|
-
regionName: string;
|
|
19
|
-
nativeRegionName: string;
|
|
20
|
-
scriptCode: string;
|
|
21
|
-
scriptName: string;
|
|
22
|
-
nativeScriptName: string;
|
|
23
|
-
maximizedCode: string;
|
|
24
|
-
maximizedName: string;
|
|
25
|
-
nativeMaximizedName: string;
|
|
26
|
-
minimizedCode: string;
|
|
27
|
-
minimizedName: string;
|
|
28
|
-
nativeMinimizedName: string;
|
|
29
|
-
emoji: string;
|
|
30
|
-
}; //#endregion
|
|
31
|
-
//#region src/locales/getRegionProperties.d.ts
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/types-dir/jsx/variables.d.ts
|
|
34
|
-
type VariableType = 'v' | 'n' | 'd' | 'c' | 'rt';
|
|
35
|
-
/**
|
|
36
|
-
* Variables are used to store the variable name and type.
|
|
37
|
-
*/
|
|
38
|
-
type Variable = {
|
|
39
|
-
k: string;
|
|
40
|
-
i?: number;
|
|
41
|
-
v?: VariableType;
|
|
42
|
-
}; //#endregion
|
|
43
|
-
//#region src/types-dir/jsx/content.d.ts
|
|
44
|
-
/**
|
|
45
|
-
* Map of data-_gt properties to their corresponding React props
|
|
46
|
-
*/
|
|
47
|
-
declare const HTML_CONTENT_PROPS: {
|
|
48
|
-
readonly pl: "placeholder";
|
|
49
|
-
readonly ti: "title";
|
|
50
|
-
readonly alt: "alt";
|
|
51
|
-
readonly arl: "aria-label";
|
|
52
|
-
readonly arb: "aria-labelledby";
|
|
53
|
-
readonly ard: "aria-describedby";
|
|
54
|
-
};
|
|
55
|
-
type HtmlContentPropKeysRecord = Partial<Record<keyof typeof HTML_CONTENT_PROPS, string>>;
|
|
56
|
-
/**
|
|
57
|
-
* GTProp is an internal property used to contain data for translating and rendering elements.
|
|
58
|
-
* note, transformations are only read on the server side if they are 'plural' or 'branch'
|
|
59
|
-
*/
|
|
60
|
-
type GTProp = {
|
|
61
|
-
b?: Record<string, JsxChildren>;
|
|
62
|
-
t?: 'p' | 'b';
|
|
63
|
-
} & HtmlContentPropKeysRecord;
|
|
64
|
-
type JsxElement = {
|
|
65
|
-
t?: string;
|
|
66
|
-
i?: number;
|
|
67
|
-
d?: GTProp;
|
|
68
|
-
c?: JsxChildren;
|
|
69
|
-
};
|
|
70
|
-
type JsxChild = string | JsxElement | Variable;
|
|
71
|
-
/**
|
|
72
|
-
* The format of the string content
|
|
73
|
-
*/
|
|
74
|
-
type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';
|
|
75
|
-
/**
|
|
76
|
-
* The format of the content.
|
|
77
|
-
*/
|
|
78
|
-
type DataFormat = 'JSX' | StringFormat;
|
|
79
|
-
/**
|
|
80
|
-
* String format content.
|
|
81
|
-
*/
|
|
82
|
-
/**
|
|
83
|
-
* A content type representing JSX elements.
|
|
84
|
-
*/
|
|
85
|
-
type JsxChildren = JsxChild | JsxChild[];
|
|
86
|
-
/**
|
|
87
|
-
* A content type representing ICU messages.
|
|
88
|
-
*/
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region ../core/dist/types-CdRgQtET.d.cts
|
|
91
|
-
type TransformationPrefix = 'translate' | 'variable' | 'plural' | 'branch' | 'fragment' | 'derive';
|
|
92
|
-
type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency' | 'relative-time';
|
|
93
|
-
type InjectionType = 'automatic' | 'manual'; //#endregion
|
|
94
|
-
//#region src/types.d.ts
|
|
95
|
-
/**
|
|
96
|
-
* @deprecated Use {@link Content} instead.
|
|
97
|
-
*/
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region ../i18n/dist/options-D0Lnxv2X.d.cts
|
|
100
|
-
//#region src/translation-functions/types/options.d.ts
|
|
101
|
-
type BaseTranslationOptions = Record<string, unknown>;
|
|
102
|
-
type DictionaryTranslationOptions = BaseTranslationOptions;
|
|
103
|
-
/**
|
|
104
|
-
* Options for string resolution
|
|
105
|
-
* Used by the gt() function
|
|
106
|
-
*/
|
|
107
|
-
type InlineTranslationOptions = BaseTranslationOptions & {
|
|
108
|
-
$context?: string;
|
|
109
|
-
$id?: string; /** The data format for the message (e.g., 'ICU', 'STRING'). Defaults to 'ICU'. */
|
|
110
|
-
$format?: StringFormat; /** The locale to use for formatting the message. */
|
|
111
|
-
$locale?: string;
|
|
112
|
-
/**
|
|
113
|
-
* @deprecated use {@link $locale} instead
|
|
114
|
-
*/
|
|
115
|
-
$_locales?: string | string[];
|
|
116
|
-
$_hash?: string;
|
|
117
|
-
$maxChars?: number; /** @deprecated use {@link EncodedTranslationOptions} instead */
|
|
118
|
-
$_source?: string;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Options for string resolution
|
|
122
|
-
* Used by the m() function
|
|
123
|
-
*/
|
|
124
|
-
/**
|
|
125
|
-
* Options for runtime translation
|
|
126
|
-
* Used by the tx() function
|
|
127
|
-
*/
|
|
128
|
-
type RuntimeTranslationOptions = {
|
|
129
|
-
$locale?: string;
|
|
130
|
-
$format?: DataFormat;
|
|
131
|
-
} & Omit<InlineTranslationOptions, '$id' | '$format'>;
|
|
132
|
-
/**
|
|
133
|
-
* Options for JSX translation
|
|
134
|
-
* Used by the resolveJsxTranslation() function
|
|
135
|
-
*/
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region ../i18n/dist/functions-DI1QpQoC.d.cts
|
|
138
|
-
/**
|
|
139
|
-
* Synchronous resolution function type
|
|
140
|
-
* @param {string} message - The message to translate.
|
|
141
|
-
* @param {InlineTranslationOptions} options - The options for the translation.
|
|
142
|
-
* @returns {string} The translated message.
|
|
143
|
-
*
|
|
144
|
-
* @important This is base type for user API
|
|
145
|
-
*
|
|
146
|
-
* TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
|
|
147
|
-
*/
|
|
148
|
-
type SyncResolutionFunctionWithFallback = (message: string, options?: InlineTranslationOptions) => string;
|
|
149
|
-
/**
|
|
150
|
-
* Type for the gt() function
|
|
151
|
-
* @param {string} message - The message to translate
|
|
152
|
-
* @param {InlineTranslationOptions} options - The options for the translation
|
|
153
|
-
* @returns {string} The translated message
|
|
154
|
-
* TODO: next major version, remove the "...type" suffix, it's redundant
|
|
155
|
-
*/
|
|
156
|
-
type GTFunctionType = SyncResolutionFunctionWithFallback;
|
|
157
|
-
/**
|
|
158
|
-
* Type for the m() function
|
|
159
|
-
* @param {string | null | undefined} encodedMsg - The encoded message to decode and interpolate.
|
|
160
|
-
* @param {InlineTranslationOptions} options - The options to interpolate.
|
|
161
|
-
* @returns {string | null | undefined} The decoded and interpolated message.
|
|
162
|
-
* TODO: next major version, this should be <T extends string | null | undefined>(message: T, options?: InlineTranslationOptions) => T extends string ? string : T;
|
|
163
|
-
* TODO: next major version, remove the "...type" suffix, it's redundant
|
|
164
|
-
*/
|
|
165
|
-
type MFunctionType = <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, any>) => T extends string ? string : T;
|
|
166
|
-
/**
|
|
167
|
-
* Type for the t() function
|
|
168
|
-
* @param {string} id - The id of the translation to translate.
|
|
169
|
-
* @param {DictionaryTranslationOptions} options - The options for the translation.
|
|
170
|
-
* @returns {string} The translated message.
|
|
171
|
-
* TODO: next major version, remove the "...type" suffix, it's redundant
|
|
172
|
-
*/
|
|
173
|
-
//#endregion
|
|
174
|
-
//#region src/types-dir/types.d.ts
|
|
175
|
-
/**
|
|
176
|
-
* TaggedElement is a React element with a GTProp property.
|
|
177
|
-
*/
|
|
178
|
-
type GTTag = {
|
|
179
|
-
id: number;
|
|
180
|
-
injectionType: InjectionType;
|
|
181
|
-
transformation?: TransformationPrefix;
|
|
182
|
-
branches?: Record<string, TaggedChildren>;
|
|
183
|
-
variableType?: VariableTransformationSuffix;
|
|
184
|
-
};
|
|
185
|
-
type TaggedElementProps = Record<string, unknown> & {
|
|
186
|
-
'data-_gt': GTTag;
|
|
187
|
-
children?: TaggedChildren;
|
|
188
|
-
branch?: string | number | boolean;
|
|
189
|
-
n?: number;
|
|
190
|
-
key?: React.Key;
|
|
191
|
-
};
|
|
192
|
-
type TaggedElement = React.ReactElement<TaggedElementProps>;
|
|
193
|
-
type TaggedChild = Exclude<React.ReactNode, React.ReactElement> | TaggedElement;
|
|
194
|
-
type TaggedChildren = TaggedChild[] | TaggedChild;
|
|
195
|
-
/**
|
|
196
|
-
* For dictionaries, we have Entry and MetaEntry
|
|
197
|
-
*/
|
|
198
|
-
type Entry = string;
|
|
199
|
-
type MetaEntry = {
|
|
200
|
-
$context?: string;
|
|
201
|
-
$maxChars?: number;
|
|
202
|
-
$_hash?: string;
|
|
203
|
-
[key: string]: unknown;
|
|
204
|
-
};
|
|
205
|
-
type DictionaryEntry = Entry | [Entry] | [Entry, MetaEntry];
|
|
206
|
-
type Dictionary = {
|
|
207
|
-
[key: string]: Dictionary | DictionaryEntry;
|
|
208
|
-
} | (Dictionary | DictionaryEntry)[];
|
|
209
|
-
type FlattenedDictionary = {
|
|
210
|
-
[key: string]: DictionaryEntry;
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Translated content types
|
|
214
|
-
* TODO: move these types to JsxElement etc from generaltranslation/types
|
|
215
|
-
* remember to omit the t property (tag name) from the translated element
|
|
216
|
-
*/
|
|
217
|
-
type TranslatedElement = {
|
|
218
|
-
i?: number;
|
|
219
|
-
d?: GTProp;
|
|
220
|
-
c?: TranslatedChildren;
|
|
221
|
-
};
|
|
222
|
-
type TranslatedChild = TranslatedElement | string | Variable;
|
|
223
|
-
type TranslatedChildren = TranslatedChild | TranslatedChild[];
|
|
224
|
-
type Translations = {
|
|
225
|
-
[hash: string]: TranslatedChildren | null;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* @deprecated use {@link Dictionary}
|
|
229
|
-
*/
|
|
230
|
-
type DictionaryContent = string;
|
|
231
|
-
/**
|
|
232
|
-
* @deprecated use {@link Dictionary}
|
|
233
|
-
*/
|
|
234
|
-
type DictionaryObject = {
|
|
235
|
-
[id: string]: DictionaryContent;
|
|
236
|
-
};
|
|
237
|
-
type LocalesDictionary = {
|
|
238
|
-
[locale: string]: DictionaryObject;
|
|
239
|
-
};
|
|
240
|
-
type CustomLoader = (locale: string) => Promise<unknown>;
|
|
241
|
-
type RenderMethod = 'skeleton' | 'replace' | 'default';
|
|
242
|
-
type RelativeTimeFormatOptions = Intl.RelativeTimeFormatOptions & {
|
|
243
|
-
unit?: Intl.RelativeTimeFormatUnit;
|
|
244
|
-
baseDate?: Date;
|
|
245
|
-
};
|
|
246
|
-
type VariableProps = {
|
|
247
|
-
/** Whether the variable was automatically injected by the compiler */variableType: VariableType;
|
|
248
|
-
variableValue: unknown;
|
|
249
|
-
variableOptions: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions | RelativeTimeFormatOptions;
|
|
250
|
-
variableName: string;
|
|
251
|
-
injectionType: InjectionType;
|
|
252
|
-
};
|
|
253
|
-
type RenderVariable = ({
|
|
254
|
-
variableType,
|
|
255
|
-
variableValue,
|
|
256
|
-
variableOptions,
|
|
257
|
-
locales,
|
|
258
|
-
injectionType
|
|
259
|
-
}: Omit<VariableProps, 'variableName'> & {
|
|
260
|
-
locales: string[];
|
|
261
|
-
}) => React.ReactNode;
|
|
262
|
-
type _Message = {
|
|
263
|
-
message: string;
|
|
264
|
-
$id?: string;
|
|
265
|
-
$context?: string;
|
|
266
|
-
$maxChars?: number;
|
|
267
|
-
$_hash?: string;
|
|
268
|
-
};
|
|
269
|
-
type _Messages = _Message[];
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region src/types-dir/runtime.d.ts
|
|
272
|
-
type TranslateIcuCallback = (params: {
|
|
273
|
-
source: string;
|
|
274
|
-
targetLocale: string;
|
|
275
|
-
metadata: {
|
|
276
|
-
hash: string;
|
|
277
|
-
context?: string;
|
|
278
|
-
maxChars?: number;
|
|
279
|
-
} & Record<string, unknown>;
|
|
280
|
-
}) => Promise<TranslatedChildren>;
|
|
281
|
-
type TranslateChildrenCallback = (params: {
|
|
282
|
-
source: JsxChildren | undefined;
|
|
283
|
-
targetLocale: string;
|
|
284
|
-
metadata: {
|
|
285
|
-
hash: string;
|
|
286
|
-
context?: string;
|
|
287
|
-
maxChars?: number;
|
|
288
|
-
} & Record<string, unknown>;
|
|
289
|
-
}) => Promise<TranslatedChildren>;
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region src/types-dir/context.d.ts
|
|
292
|
-
type GTContextType = {
|
|
293
|
-
gt: GT;
|
|
294
|
-
registerIcuForTranslation: TranslateIcuCallback;
|
|
295
|
-
registerJsxForTranslation: TranslateChildrenCallback;
|
|
296
|
-
_gtFunction: (message: string, options?: InlineTranslationOptions, preloadedTranslations?: Translations) => string;
|
|
297
|
-
_mFunction: <T extends string | null | undefined>(encodedMsg: T, options?: Record<string, unknown>, preloadedTranslations?: Translations) => T extends string ? string : T;
|
|
298
|
-
_filterMessagesForPreload: (_messages: _Messages) => _Messages;
|
|
299
|
-
_preloadMessages: (_messages: _Messages) => Promise<Translations>;
|
|
300
|
-
_dictionaryFunction: (id: string, options?: DictionaryTranslationOptions) => string;
|
|
301
|
-
_dictionaryObjFunction: (id: string, idWithParent: string, options?: DictionaryTranslationOptions) => Dictionary | DictionaryEntry | string | undefined;
|
|
302
|
-
developmentApiEnabled: boolean;
|
|
303
|
-
locale: string;
|
|
304
|
-
locales: string[];
|
|
305
|
-
setLocale: (locale: string) => void;
|
|
306
|
-
defaultLocale: string;
|
|
307
|
-
region: string | undefined;
|
|
308
|
-
setRegion: (region: string | undefined) => void;
|
|
309
|
-
translations: Translations | null;
|
|
310
|
-
translationRequired: boolean;
|
|
311
|
-
dialectTranslationRequired: boolean;
|
|
312
|
-
renderSettings: {
|
|
313
|
-
method: RenderMethod;
|
|
314
|
-
timeout?: number;
|
|
315
|
-
};
|
|
316
|
-
projectId?: string;
|
|
317
|
-
_versionId?: string;
|
|
318
|
-
};
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region src/utils/types.d.ts
|
|
321
|
-
type AuthFromEnvParams = {
|
|
322
|
-
projectId?: string;
|
|
323
|
-
devApiKey?: string;
|
|
324
|
-
};
|
|
325
|
-
type AuthFromEnvReturn = {
|
|
326
|
-
projectId: string;
|
|
327
|
-
devApiKey?: string;
|
|
328
|
-
};
|
|
329
|
-
//#endregion
|
|
330
|
-
//#region src/provider/hooks/locales/types.d.ts
|
|
331
|
-
type UseDetermineLocaleParams = {
|
|
332
|
-
defaultLocale: string;
|
|
333
|
-
locales: string[];
|
|
334
|
-
enableI18n: boolean;
|
|
335
|
-
locale?: string;
|
|
336
|
-
localeCookieName?: string;
|
|
337
|
-
ssr?: boolean;
|
|
338
|
-
customMapping?: CustomMapping;
|
|
339
|
-
reloadOnLocaleUpdate?: boolean;
|
|
340
|
-
};
|
|
341
|
-
type UseDetermineLocaleReturn = [string, (locale: string) => void];
|
|
342
|
-
//#endregion
|
|
343
|
-
//#region src/provider/hooks/types.d.ts
|
|
344
|
-
type UseRegionStateParams = {
|
|
345
|
-
_region: string | undefined;
|
|
346
|
-
ssr: boolean;
|
|
347
|
-
regionCookieName: string;
|
|
348
|
-
};
|
|
349
|
-
type UseRegionStateReturn = {
|
|
350
|
-
region: string | undefined;
|
|
351
|
-
setRegion: (region: string | undefined) => void;
|
|
352
|
-
};
|
|
353
|
-
type UseEnableI18nParams = {
|
|
354
|
-
enableI18n: boolean;
|
|
355
|
-
enableI18nCookieName: string;
|
|
356
|
-
enableI18nLoaded?: boolean;
|
|
357
|
-
ssr: boolean;
|
|
358
|
-
};
|
|
359
|
-
type UseEnableI18nReturn = {
|
|
360
|
-
enableI18n: boolean;
|
|
361
|
-
};
|
|
362
|
-
//#endregion
|
|
363
|
-
//#region src/ui/types.d.ts
|
|
364
|
-
type LocaleSelectorProps = {
|
|
365
|
-
locales?: string[];
|
|
366
|
-
customNames?: {
|
|
367
|
-
[key: string]: string;
|
|
368
|
-
};
|
|
369
|
-
customMapping?: CustomMapping;
|
|
370
|
-
[key: string]: unknown;
|
|
371
|
-
};
|
|
372
|
-
type RegionSelectorProps<Regions extends string[]> = {
|
|
373
|
-
regions?: Regions;
|
|
374
|
-
placeholder?: ReactNode;
|
|
375
|
-
customMapping?: CustomMapping;
|
|
376
|
-
prioritizeCurrentLocaleRegion?: boolean;
|
|
377
|
-
sortRegionsAlphabetically?: boolean;
|
|
378
|
-
};
|
|
379
|
-
//#endregion
|
|
380
|
-
//#region src/types-dir/config.d.ts
|
|
381
|
-
type GTConfig = {
|
|
382
|
-
projectId?: string;
|
|
383
|
-
devApiKey?: string;
|
|
384
|
-
locales?: string[];
|
|
385
|
-
defaultLocale?: string;
|
|
386
|
-
dictionary?: string;
|
|
387
|
-
runtimeUrl?: string | null;
|
|
388
|
-
cacheUrl?: string | null;
|
|
389
|
-
renderSettings?: {
|
|
390
|
-
method: RenderMethod;
|
|
391
|
-
timeout?: number;
|
|
392
|
-
};
|
|
393
|
-
_versionId?: string;
|
|
394
|
-
ssr?: boolean;
|
|
395
|
-
localeCookieName?: string;
|
|
396
|
-
customMapping?: CustomMapping;
|
|
397
|
-
modelProvider?: string;
|
|
398
|
-
enableI18n?: boolean;
|
|
399
|
-
};
|
|
400
|
-
type InternalGTProviderProps = {
|
|
401
|
-
children?: React.ReactNode;
|
|
402
|
-
projectId?: string;
|
|
403
|
-
devApiKey?: string;
|
|
404
|
-
dictionary?: Dictionary;
|
|
405
|
-
locales?: string[];
|
|
406
|
-
defaultLocale?: string;
|
|
407
|
-
locale?: string;
|
|
408
|
-
region?: string;
|
|
409
|
-
cacheUrl?: string | null;
|
|
410
|
-
runtimeUrl?: string | null;
|
|
411
|
-
renderSettings?: {
|
|
412
|
-
method: RenderMethod;
|
|
413
|
-
timeout?: number;
|
|
414
|
-
};
|
|
415
|
-
_versionId?: string;
|
|
416
|
-
ssr?: boolean;
|
|
417
|
-
localeCookieName?: string;
|
|
418
|
-
translations?: Translations | null;
|
|
419
|
-
loadDictionary?: CustomLoader;
|
|
420
|
-
loadTranslations?: CustomLoader;
|
|
421
|
-
config?: GTConfig;
|
|
422
|
-
fallback?: React.ReactNode;
|
|
423
|
-
customMapping?: CustomMapping;
|
|
424
|
-
modelProvider?: string;
|
|
425
|
-
environment: 'development' | 'production' | 'test';
|
|
426
|
-
enableI18n?: boolean; /** Flag to indicate if the enableI18n flag is finished loading asynchronously */
|
|
427
|
-
enableI18nLoaded?: boolean;
|
|
428
|
-
readAuthFromEnv: (params: AuthFromEnvParams) => AuthFromEnvReturn;
|
|
429
|
-
useDetermineLocale: (params: UseDetermineLocaleParams) => UseDetermineLocaleReturn;
|
|
430
|
-
useRegionState: (params: UseRegionStateParams) => UseRegionStateReturn;
|
|
431
|
-
useEnableI18n?: (params: UseEnableI18nParams) => UseEnableI18nReturn;
|
|
432
|
-
reloadOnLocaleUpdate?: boolean;
|
|
433
|
-
[key: string]: unknown;
|
|
434
|
-
};
|
|
435
|
-
//#endregion
|
|
436
|
-
export { type AuthFromEnvParams, type AuthFromEnvReturn, type CustomLoader, type Dictionary, type DictionaryContent, type DictionaryEntry, type DictionaryObject, type DictionaryTranslationOptions, type Entry, type FlattenedDictionary, type GTConfig, type GTContextType, type GTFunctionType, type GTProp, type InlineTranslationOptions, type InternalGTProviderProps, type LocaleSelectorProps, type LocalesDictionary, type MFunctionType, type MetaEntry as Metadata, type RegionSelectorProps, type RenderMethod, type RenderVariable, type RuntimeTranslationOptions, type TaggedChildren, type TranslatedChildren, type Translations, type UseDetermineLocaleParams, type UseDetermineLocaleReturn, type UseEnableI18nParams, type UseEnableI18nReturn, type UseRegionStateParams, type UseRegionStateReturn, type VariableProps, type _Message, type _Messages };
|
|
437
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":["CustomMapping","LocaleProperties","Partial","Record","code","name","nativeName","languageCode","languageName","nativeLanguageName","nameWithRegionCode","nativeNameWithRegionCode","regionCode","regionName","nativeRegionName","scriptCode","scriptName","nativeScriptName","maximizedCode","maximizedName","nativeMaximizedName","minimizedCode","minimizedName","nativeMinimizedName","emoji","CustomRegionMapping","region","locale","getRegionProperties","defaultLocale","customMapping","CutoffFormatStyle","TerminatorOptions","terminator","separator","CutoffFormatOptions","maxChars","style","VariableType","Variable","k","i","v","HTML_CONTENT_PROPS","pl","ti","alt","arl","arb","ard","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","GTProp","JsxChildren","b","t","JsxElement","d","c","JsxChild","StringFormat","DataFormat","StringContent","IcuMessage","StringMessage","I18nextMessage","Content","FormatVariables","Date","S","_","a","f","g","h","l","m","n","o","p","r","s","u","x","y","Content","Content$1","CustomMapping","CustomMapping$1","CustomRegionMapping","CustomRegionMapping$1","CutoffFormatOptions","CutoffFormatOptions$1","DataFormat","DataFormat$1","FormatVariables","FormatVariables$1","GTProp","HTML_CONTENT_PROPS","HtmlContentPropKeysRecord","HtmlContentPropValuesRecord","I18nextMessage","I18nextMessage$1","IcuMessage","IcuMessage$1","JsxChild","JsxChildren","JsxChildren$1","JsxElement","LocaleProperties","LocaleProperties$1","StringContent","StringFormat","StringFormat$1","StringMessage","StringMessage$1","Variable","Variable$1","VariableType","ActionType","EntryMetadata","id","hash","context","maxChars","dataFormat","actionType","RuntimeTranslateManyOptions","sourceLocale","modelProvider","key","TranslateOptions","targetLocale","TranslateManyEntry","source","metadata","HashMetadata","TranslationStatusResult","count","availableLocales","locales","localesWaitingForApproval","JsonPrimitive","JsonValue","JsonObject","FileTranslationQuery","versionId","fileName","fileId","locale","CheckFileTranslationsOptions","timeout","FileQuery","branchId","FileQueryResult","sourceFile","fileFormat","createdAt","updatedAt","approvalRequiredAt","translations","completedAt","approvedAt","publishedAt","UpdateMetadata","staticId","format","filePaths","sourceCode","contextDeriveExpr","_contextDeriveExpr","Updates","EnqueueFilesOptions","requireApproval","description","targetLocales","version","_versionId","force","EnqueueFilesResult","jobData","jobId","sourceFileId","projectId","message","FileFormat","FormatMetadata","FileToUpload","FileReference","Omit","content","transformFormat","formatMetadata","incomingBranchId","checkedOutBranchId","FileReferenceIds","DownloadFileBatchRequest","useLatestAvailableVersion","DownloadFileBatchOptions","DownloadedFile","data","DownloadFileBatchResult","files","FetchTranslationsOptions","RetrievedTranslation","translation","RetrievedTranslations","FetchTranslationsResult","CreateTagFileReference","CreateTagOptions","tagId","CreateTagResult","tag","GTJsonFormatMetadata","Record","domain","requestVersion","approved_at","approved_by","FileUpload","UploadFilesOptions","UploadFilesResponse","uploadedFiles","EnqueueEntriesOptions","EnqueueEntriesResult","projectSettings","cdnEnabled","PublishFileEntry","publish","PublishFilesResult","results","success","error","DownloadFileOptions","TranslationResultReference","TypedResult","TranslationError","code","RequestSuccess","TranslationResult","TranslateManyResult","BranchDataResult","branches","name","defaultBranch","BranchQuery","branchNames","FileDataQuery","sourceFiles","translatedFiles","FileDataResult","OrphanedFile","GetOrphanedFilesResult","orphanedFiles","MoveMapping","oldFileId","newFileId","newFileName","MoveResult","newSourceFileId","clonedTranslationsCount","ProcessMovesResponse","summary","total","succeeded","failed","ProcessMovesOptions","JobStatus","CheckJobStatusResult","status","AwaitJobsOptions","pollingIntervalSeconds","timeoutSeconds","JobResult","AwaitJobsResult","complete","jobs","SubmitUserEditDiff","diff","localContent","SubmitUserEditDiffsPayload","diffs","Transformation","BaseTransformation","InjectionType","TransformationPrefix","VariableTransformationSuffix","_Content","Array","Metadata","Update","type","Request","ContentTranslationResult","reference","IcuTranslationResult","JsxTranslationResult","TranslationRequestConfig","baseUrl","apiKey","$","A","At","B","C","Ct","D","Dt","E","Et","F","Ft","G","H","I","It","J","K","L","Lt","M","Mt","N","Nt","O","Ot","P","Pt","Q","R","Rt","S","St","T","Tt","U","V","W","X","Y","Z","_","_t","a","at","b","bt","c","ct","d","dt","et","f","ft","g","gt","h","ht","i","it","j","jt","k","kt","l","lt","m","mt","n","nt","o","ot","p","pt","q","r","rt","s","st","t","tt","u","ut","v","vt","w","wt","x","xt","y","yt","z","DataFormat","StringFormat","BaseTranslationOptions","Record","DictionaryTranslationOptions","DictionaryOptions","$format","$context","$maxChars","context","InlineTranslationOptions","$id","$locale","$_locales","$_hash","$_source","InlineResolveOptions","EncodedTranslationOptions","RuntimeTranslationOptions","Omit","JsxTranslationOptions","LookupOptions","DictionaryLookupOptions","ResolutionOptions","T","NormalizedLookupOptions","a","c","d","f","i","l","n","o","r","s","t","u","c","JsxTranslationOptions","i","DictionaryTranslationOptions","s","InlineTranslationOptions","JsxChildren","DictionaryObjectTranslation","key","SyncResolutionFunction","message","options","SyncResolutionFunctionWithFallback","GTFunctionType","MFunctionType","T","Record","encodedMsg","TFunctionType","id","obj","ResolveJsxTranslationFunction","locale","children","a","n","o","r","t"],"sources":["../../format/dist/types-COaQnqVZ.d.cts","../../core/dist/types-CdRgQtET.d.cts","../../i18n/dist/options-D0Lnxv2X.d.cts","../../i18n/dist/functions-DI1QpQoC.d.cts","../src/types-dir/types.ts","../src/types-dir/runtime.ts","../src/types-dir/context.ts","../src/utils/types.ts","../src/provider/hooks/locales/types.ts","../src/provider/hooks/types.ts","../src/ui/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