gt-react 9.2.29-alpha.13 → 9.2.29-alpha.2
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.cjs.min.cjs +3 -3
- package/dist/client.d.ts +16 -19
- package/dist/client.esm.min.mjs +3 -3
- package/dist/hooks/useGTClass.d.ts +1 -1
- package/dist/hooks/useGTClass.d.ts.map +1 -1
- package/dist/index.cjs.min.cjs +3 -3
- package/dist/index.esm.min.mjs +3 -3
- package/dist/provider/ClientProvider.d.ts.map +1 -1
- package/dist/provider/GTProvider.d.ts.map +1 -1
- package/dist/provider/hooks/useCreateInternalUseGTFunction.d.ts +2 -2
- package/dist/provider/hooks/useCreateInternalUseGTFunction.d.ts.map +1 -1
- package/dist/provider/hooks/useCreateInternalUseTranslationsFunction.d.ts +2 -2
- package/dist/provider/hooks/useCreateInternalUseTranslationsFunction.d.ts.map +1 -1
- package/dist/provider/hooks/useRuntimeTranslation.d.ts +2 -3
- package/dist/provider/hooks/useRuntimeTranslation.d.ts.map +1 -1
- package/dist/types/context.d.ts +3 -4
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/runtime.d.ts +3 -5
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/variables/Currency.d.ts +2 -2
- package/dist/variables/Currency.d.ts.map +1 -1
- package/dist/variables/DateTime.d.ts +2 -2
- package/dist/variables/DateTime.d.ts.map +1 -1
- package/dist/variables/Num.d.ts +2 -2
- package/dist/variables/Num.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/client.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import * as React$1 from 'react';
|
2
2
|
import React__default from 'react';
|
3
|
+
import * as GT from 'generaltranslation';
|
4
|
+
import GT__default from 'generaltranslation';
|
3
5
|
import * as generaltranslation_types from 'generaltranslation/types';
|
4
|
-
import {
|
5
|
-
import * as generaltranslation from 'generaltranslation';
|
6
|
-
import { GT } from 'generaltranslation';
|
6
|
+
import { CustomMapping } from 'generaltranslation/types';
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
8
8
|
|
9
9
|
type Entry = string;
|
@@ -69,17 +69,16 @@ type RenderVariable = ({ variableType, variableValue, variableOptions, locales,
|
|
69
69
|
locales: string[];
|
70
70
|
}) => React__default.JSX.Element;
|
71
71
|
|
72
|
-
type
|
73
|
-
source:
|
72
|
+
type TranslateContentCallback = (params: {
|
73
|
+
source: any;
|
74
74
|
targetLocale: string;
|
75
75
|
metadata: {
|
76
76
|
hash: string;
|
77
77
|
context?: string;
|
78
78
|
} & Record<string, any>;
|
79
79
|
}) => Promise<TranslationSuccess | TranslationLoading | TranslationError>;
|
80
|
-
type TranslateI18nextCallback = TranslateIcuCallback;
|
81
80
|
type TranslateChildrenCallback = (params: {
|
82
|
-
source:
|
81
|
+
source: any;
|
83
82
|
targetLocale: string;
|
84
83
|
metadata: {
|
85
84
|
hash: string;
|
@@ -88,9 +87,8 @@ type TranslateChildrenCallback = (params: {
|
|
88
87
|
}) => Promise<TranslationSuccess | TranslationLoading | TranslationError>;
|
89
88
|
|
90
89
|
type GTContextType = {
|
91
|
-
gt:
|
92
|
-
|
93
|
-
registerIcuForTranslation: TranslateIcuCallback;
|
90
|
+
gt: GT__default;
|
91
|
+
registerContentForTranslation: TranslateContentCallback;
|
94
92
|
registerJsxForTranslation: TranslateChildrenCallback;
|
95
93
|
_internalUseGTFunction: (string: string, options?: InlineTranslationOptions) => string;
|
96
94
|
_internalUseTranslationsFunction: (id: string, options?: DictionaryTranslationOptions) => string;
|
@@ -125,8 +123,7 @@ declare function useRuntimeTranslation({ projectId, devApiKey, locale, versionId
|
|
125
123
|
setTranslations: React$1.Dispatch<React$1.SetStateAction<any>>;
|
126
124
|
[key: string]: any;
|
127
125
|
}): {
|
128
|
-
|
129
|
-
registerIcuForTranslation: TranslateIcuCallback;
|
126
|
+
registerContentForTranslation: TranslateContentCallback;
|
130
127
|
registerJsxForTranslation: TranslateChildrenCallback;
|
131
128
|
runtimeTranslationEnabled: boolean;
|
132
129
|
};
|
@@ -388,12 +385,12 @@ declare namespace T {
|
|
388
385
|
* @returns {JSX.Element} The formatted currency component.
|
389
386
|
*/
|
390
387
|
declare function Currency({ children, currency, locales, options, }: {
|
391
|
-
children: number | string
|
388
|
+
children: number | string;
|
392
389
|
currency?: string;
|
393
390
|
name?: string;
|
394
391
|
locales?: string[];
|
395
392
|
options?: Intl.NumberFormatOptions;
|
396
|
-
}): React__default.JSX.Element
|
393
|
+
}): React__default.JSX.Element;
|
397
394
|
declare namespace Currency {
|
398
395
|
var gtTransformation: string;
|
399
396
|
}
|
@@ -416,11 +413,11 @@ declare namespace Currency {
|
|
416
413
|
* @returns {JSX.Element} The formatted date or time component.
|
417
414
|
*/
|
418
415
|
declare function DateTime({ children, locales, options, }: {
|
419
|
-
children: Date
|
416
|
+
children: Date;
|
420
417
|
locales?: string[];
|
421
418
|
name?: string;
|
422
419
|
options?: Intl.DateTimeFormatOptions;
|
423
|
-
}): React__default.JSX.Element
|
420
|
+
}): React__default.JSX.Element;
|
424
421
|
declare namespace DateTime {
|
425
422
|
var gtTransformation: string;
|
426
423
|
}
|
@@ -445,11 +442,11 @@ declare namespace DateTime {
|
|
445
442
|
* @returns {JSX.Element} The formatted number component.
|
446
443
|
*/
|
447
444
|
declare function Num({ children, locales, options, }: {
|
448
|
-
children: number | string
|
445
|
+
children: number | string;
|
449
446
|
locales?: string[];
|
450
447
|
options?: Intl.NumberFormatOptions;
|
451
448
|
name?: string;
|
452
|
-
}): React__default.JSX.Element
|
449
|
+
}): React__default.JSX.Element;
|
453
450
|
declare namespace Num {
|
454
451
|
var gtTransformation: string;
|
455
452
|
}
|
@@ -565,7 +562,7 @@ declare function useLocaleSelector(locales?: string[]): {
|
|
565
562
|
* const gt = useGTClass();
|
566
563
|
* console.log(gt.getLocaleProperties('en-US'));
|
567
564
|
*/
|
568
|
-
declare function useGTClass():
|
565
|
+
declare function useGTClass(): GT.default;
|
569
566
|
/**
|
570
567
|
* Returns the locale properties for the given locale.
|
571
568
|
*
|