gt-react 9.2.17 → 9.2.19

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/dist/client.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import * as React from 'react';
1
+ import * as React$1 from 'react';
2
2
  import React__default from 'react';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
3
 
5
4
  type Entry = string;
6
5
  type Metadata = {
@@ -125,7 +124,7 @@ type ClientProviderProps = {
125
124
  resetLocaleCookieName: string;
126
125
  };
127
126
 
128
- declare const GTContext: React.Context<GTContextType | undefined>;
127
+ declare const GTContext: React$1.Context<GTContextType | undefined>;
129
128
 
130
129
  declare function useRuntimeTranslation({ projectId, devApiKey, locale, versionId, defaultLocale, runtimeUrl, renderSettings, setTranslations, runtimeTranslationEnabled, ...globalMetadata }: {
131
130
  projectId?: string;
@@ -139,7 +138,7 @@ declare function useRuntimeTranslation({ projectId, devApiKey, locale, versionId
139
138
  method: RenderMethod;
140
139
  timeout?: number;
141
140
  };
142
- setTranslations: React.Dispatch<React.SetStateAction<any>>;
141
+ setTranslations: React$1.Dispatch<React$1.SetStateAction<any>>;
143
142
  [key: string]: any;
144
143
  }): {
145
144
  registerContentForTranslation: TranslateContentCallback;
@@ -148,7 +147,7 @@ declare function useRuntimeTranslation({ projectId, devApiKey, locale, versionId
148
147
 
149
148
  declare const renderVariable: RenderVariable;
150
149
 
151
- declare function ClientProvider({ children, dictionary, initialTranslations, locale: _locale, _versionId, defaultLocale, translationRequired, dialectTranslationRequired, locales, renderSettings, projectId, devApiKey, runtimeUrl, runtimeTranslationEnabled, resetLocaleCookieName, localeCookieName, }: ClientProviderProps): React.JSX.Element;
150
+ declare function ClientProvider({ children, dictionary, initialTranslations, locale: _locale, _versionId, defaultLocale, translationRequired, dialectTranslationRequired, locales, renderSettings, projectId, devApiKey, runtimeUrl, runtimeTranslationEnabled, resetLocaleCookieName, localeCookieName, }: ClientProviderProps): React$1.JSX.Element;
152
151
 
153
152
  /**
154
153
  * The `<Branch>` component dynamically renders a specified branch of content or a fallback child component.
@@ -179,7 +178,7 @@ declare function Branch({ children, branch, ...branches }: {
179
178
  name?: string;
180
179
  branch?: string;
181
180
  [key: string]: any;
182
- }): react_jsx_runtime.JSX.Element;
181
+ }): React.JSX.Element;
183
182
  declare namespace Branch {
184
183
  var gtTransformation: string;
185
184
  }
@@ -216,7 +215,7 @@ declare function Plural({ children, n, locale, ...branches }: {
216
215
  n?: number;
217
216
  locale?: string;
218
217
  [key: string]: any;
219
- }): react_jsx_runtime.JSX.Element;
218
+ }): React.JSX.Element;
220
219
  declare namespace Plural {
221
220
  var gtTransformation: string;
222
221
  }
@@ -313,7 +312,7 @@ declare function T({ children, id, context, }: {
313
312
  id?: string;
314
313
  context?: string;
315
314
  [key: string]: any;
316
- }): React__default.JSX.Element | undefined;
315
+ }): React__default.JSX.Element | null;
317
316
  declare namespace T {
318
317
  var gtTransformation: string;
319
318
  }
@@ -441,6 +440,23 @@ declare function LocaleSelector({ locales: _locales, ...props }: {
441
440
  [key: string]: any;
442
441
  }): React__default.JSX.Element | null;
443
442
 
443
+ type GTConfig = {
444
+ projectId?: string;
445
+ devApiKey?: string;
446
+ locales?: string[];
447
+ defaultLocale?: string;
448
+ dictionary?: string;
449
+ runtimeUrl?: string;
450
+ cacheUrl?: string;
451
+ renderSettings?: {
452
+ method: RenderMethod;
453
+ timeout?: number;
454
+ };
455
+ _versionId?: string;
456
+ ssr?: boolean;
457
+ localeCookieName?: string;
458
+ };
459
+
444
460
  /**
445
461
  * Provides General Translation context to its children, which can then access `useGT`, `useLocale`, and `useDefaultLocale`.
446
462
  *
@@ -463,7 +479,7 @@ declare function LocaleSelector({ locales: _locales, ...props }: {
463
479
  *
464
480
  * @returns {JSX.Element} The provider component for General Translation context.
465
481
  */
466
- declare function GTProvider({ children, projectId: _projectId, devApiKey: _devApiKey, dictionary: _dictionary, locales, defaultLocale, locale: _locale, cacheUrl, runtimeUrl, renderSettings, loadDictionary, loadTranslations, fallback, ssr, localeCookieName, translations: _translations, _versionId, ...metadata }: {
482
+ declare function GTProvider({ children, config, projectId: _projectId, devApiKey: _devApiKey, dictionary: _dictionary, locales, defaultLocale, cacheUrl, runtimeUrl, renderSettings, ssr, localeCookieName, locale: _locale, loadDictionary, loadTranslations, fallback, translations: _translations, _versionId, ...metadata }: {
467
483
  children?: React__default.ReactNode;
468
484
  projectId?: string;
469
485
  devApiKey?: string;
@@ -477,12 +493,14 @@ declare function GTProvider({ children, projectId: _projectId, devApiKey: _devAp
477
493
  method: RenderMethod;
478
494
  timeout?: number;
479
495
  };
480
- translations?: TranslationsObject | null;
481
- loadDictionary?: CustomLoader;
482
- loadTranslations?: CustomLoader;
483
496
  _versionId?: string;
484
497
  ssr?: boolean;
485
498
  localeCookieName?: string;
499
+ translations?: TranslationsObject | null;
500
+ loadDictionary?: CustomLoader;
501
+ loadTranslations?: CustomLoader;
502
+ config?: GTConfig;
503
+ fallback?: React__default.ReactNode;
486
504
  [key: string]: any;
487
505
  }): React__default.JSX.Element;
488
506