gt-react 9.2.28 → 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/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 generaltranslation from 'generaltranslation';
4
- import { GT } from 'generaltranslation';
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: GT;
90
+ gt: GT__default;
91
91
  registerContentForTranslation: TranslateContentCallback;
92
92
  registerJsxForTranslation: TranslateChildrenCallback;
93
93
  _internalUseGTFunction: (string: string, options?: InlineTranslationOptions) => string;
@@ -378,14 +378,14 @@ declare namespace T {
378
378
  * </Currency>
379
379
  * ```
380
380
  *
381
- * @param {any} [children] - Optional content to render inside the currency component.
382
- * @param {string} [currency] - The currency type (e.g., USD, EUR, etc.).
383
- * @param {string[]} [locales] - Optional locales to use for currency formatting. If not provided, the library default locale (en-US) is used. 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.
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, name, locales, options, }: {
388
- children?: any;
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 {any} [children] - Optional content (typically a date) to render inside the component.
411
- * @param {string[]} [locales] - Optional locales to use for date formatting. If not provided, the library default locale (en-US) is used. If wrapped in a `<GTProvider>`, the user's locale is used.
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, name, options, }: {
416
- children?: any;
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 {any} [children] - Optional content (typically a number) to render inside the component.
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, name, locales, options, }: {
444
- children?: any;
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(): generaltranslation.GT;
565
+ declare function useGTClass(): GT.default;
565
566
  /**
566
567
  * Returns the locale properties for the given locale.
567
568
  *