gt-react 9.2.27 → 9.2.29-alpha.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 +6 -0
- package/dist/branches/plurals/Plural.d.ts +4 -4
- package/dist/branches/plurals/Plural.d.ts.map +1 -1
- package/dist/client.cjs.min.cjs +3 -3
- package/dist/client.d.ts +22 -21
- package/dist/client.esm.min.mjs +3 -3
- package/dist/dictionaries/loadDictionaryHelper.d.ts.map +1 -1
- 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/hooks/useCreateInternalUseGTFunction.d.ts.map +1 -1
- package/dist/provider/hooks/useCreateInternalUseTranslationsFunction.d.ts.map +1 -1
- package/dist/provider/hooks/useErrorChecks.d.ts.map +1 -1
- package/dist/provider/hooks/useRuntimeTranslation.d.ts.map +1 -1
- package/dist/types/context.d.ts +1 -1
- package/dist/types/context.d.ts.map +1 -1
- package/dist/ui/LocaleSelector.d.ts.map +1 -1
- package/dist/variables/Currency.d.ts +6 -6
- package/dist/variables/Currency.d.ts.map +1 -1
- package/dist/variables/DateTime.d.ts +4 -4
- package/dist/variables/DateTime.d.ts.map +1 -1
- package/dist/variables/Num.d.ts +4 -3
- package/dist/variables/Num.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/client.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React$1 from 'react';
|
2
2
|
import React__default from 'react';
|
3
|
-
import * as
|
4
|
-
import
|
3
|
+
import * as GT from 'generaltranslation';
|
4
|
+
import GT__default from 'generaltranslation';
|
5
5
|
import * as generaltranslation_types from 'generaltranslation/types';
|
6
6
|
import { CustomMapping } from 'generaltranslation/types';
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
@@ -87,7 +87,7 @@ type TranslateChildrenCallback = (params: {
|
|
87
87
|
}) => Promise<TranslationSuccess | TranslationLoading | TranslationError>;
|
88
88
|
|
89
89
|
type GTContextType = {
|
90
|
-
gt:
|
90
|
+
gt: GT__default;
|
91
91
|
registerContentForTranslation: TranslateContentCallback;
|
92
92
|
registerJsxForTranslation: TranslateChildrenCallback;
|
93
93
|
_internalUseGTFunction: (string: string, options?: InlineTranslationOptions) => string;
|
@@ -252,7 +252,7 @@ declare namespace Branch {
|
|
252
252
|
*
|
253
253
|
* @param {any} [children] - Fallback content to render if no matching plural branch is found.
|
254
254
|
* @param {number} [n] - The number used to determine the plural form. This is required for pluralization to work.
|
255
|
-
* @param {string} [
|
255
|
+
* @param {string} [locales] - Optional parameter, the locale to use for pluralization format. If not provided and wrapped
|
256
256
|
* in <GTProvider> will automatically populate this value as user's current locale. If not provided and not wrapped in
|
257
257
|
* <GTProvider>, will use the library default locale (en-US).
|
258
258
|
* @param {...{[key: string]: any}} [branches] - A spread object containing possible plural branches, typically including `one` for singular
|
@@ -260,10 +260,10 @@ declare namespace Branch {
|
|
260
260
|
* @returns {React.JSX.Element} The rendered content corresponding to the plural form of `n`, or the fallback content.
|
261
261
|
* @throws {Error} If `n` is not provided or not a valid number.
|
262
262
|
*/
|
263
|
-
declare function Plural({ children, n,
|
264
|
-
children?:
|
263
|
+
declare function Plural({ children, n, locales, ...branches }: {
|
264
|
+
children?: React.ReactNode;
|
265
265
|
n?: number;
|
266
|
-
|
266
|
+
locales?: string;
|
267
267
|
[key: string]: any;
|
268
268
|
}): React.JSX.Element;
|
269
269
|
declare namespace Plural {
|
@@ -378,14 +378,14 @@ declare namespace T {
|
|
378
378
|
* </Currency>
|
379
379
|
* ```
|
380
380
|
*
|
381
|
-
* @param {
|
382
|
-
* @param {string} [currency] - The currency type (e.g., USD, EUR, etc.).
|
383
|
-
* @param {string[]} [locales] - Optional locales to use for currency formatting. If
|
384
|
-
* @param {Intl.NumberFormatOptions} [options] - Optional formatting options to customize how the currency is displayed.
|
381
|
+
* @param {number | string} children - Content to render inside the currency component.
|
382
|
+
* @param {string} [currency="USD"] - The currency type (e.g., USD, EUR, etc.).
|
383
|
+
* @param {string[]} [locales] - Optional locales to use for currency formatting. If wrapped in a `<GTProvider>`, the user's locale is used.
|
384
|
+
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options to customize how the currency is displayed.
|
385
385
|
* @returns {JSX.Element} The formatted currency component.
|
386
386
|
*/
|
387
|
-
declare function Currency({ children, currency,
|
388
|
-
children
|
387
|
+
declare function Currency({ children, currency, locales, options, }: {
|
388
|
+
children: number | string;
|
389
389
|
currency?: string;
|
390
390
|
name?: string;
|
391
391
|
locales?: string[];
|
@@ -407,13 +407,13 @@ declare namespace Currency {
|
|
407
407
|
* </DateTime>
|
408
408
|
* ```
|
409
409
|
*
|
410
|
-
* @param {
|
411
|
-
* @param {string[]} [locales] - Optional locales to use for date formatting. If
|
410
|
+
* @param {Date} children - Content to render inside the date component.
|
411
|
+
* @param {string[]} [locales] - Optional locales to use for date formatting. If wrapped in a `<GTProvider>`, the user's locale is used.
|
412
412
|
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options for the date, following `Intl.DateTimeFormatOptions` specifications.
|
413
413
|
* @returns {JSX.Element} The formatted date or time component.
|
414
414
|
*/
|
415
|
-
declare function DateTime({ children, locales,
|
416
|
-
children
|
415
|
+
declare function DateTime({ children, locales, options, }: {
|
416
|
+
children: Date;
|
417
417
|
locales?: string[];
|
418
418
|
name?: string;
|
419
419
|
options?: Intl.DateTimeFormatOptions;
|
@@ -436,12 +436,13 @@ declare namespace DateTime {
|
|
436
436
|
* </Num>
|
437
437
|
* ```
|
438
438
|
*
|
439
|
-
* @param {
|
439
|
+
* @param {number | string} children - Content to render inside the number component.
|
440
|
+
* @param {string[]} [locales] - Optional locales to use for number formatting. If wrapped in a `<GTProvider>`, the user's locale is used.
|
440
441
|
* @param {Intl.NumberFormatOptions} [options={}] - Optional formatting options for the number, following `Intl.NumberFormatOptions` specifications.
|
441
442
|
* @returns {JSX.Element} The formatted number component.
|
442
443
|
*/
|
443
|
-
declare function Num({ children,
|
444
|
-
children
|
444
|
+
declare function Num({ children, locales, options, }: {
|
445
|
+
children: number | string;
|
445
446
|
locales?: string[];
|
446
447
|
options?: Intl.NumberFormatOptions;
|
447
448
|
name?: string;
|
@@ -561,7 +562,7 @@ declare function useLocaleSelector(locales?: string[]): {
|
|
561
562
|
* const gt = useGTClass();
|
562
563
|
* console.log(gt.getLocaleProperties('en-US'));
|
563
564
|
*/
|
564
|
-
declare function useGTClass():
|
565
|
+
declare function useGTClass(): GT.default;
|
565
566
|
/**
|
566
567
|
* Returns the locale properties for the given locale.
|
567
568
|
*
|