@ttoss/react-i18n 1.23.5 → 1.24.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.
Files changed (2) hide show
  1. package/dist/index.d.mts +30 -0
  2. package/package.json +6 -6
@@ -0,0 +1,30 @@
1
+ import * as react_intl from 'react-intl';
2
+ export { FormattedMessage, IntlShape, MessageDescriptor, defineMessage, defineMessages } from 'react-intl';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import * as React from 'react';
5
+
6
+ type MessagesType = any;
7
+ type LoadLocaleData = (locale: string) => Promise<MessagesType>;
8
+ type I18nProviderProps = {
9
+ locale?: string;
10
+ loadLocaleData?: LoadLocaleData;
11
+ children?: React.ReactNode;
12
+ onError?: (err: Error) => void;
13
+ };
14
+ /**
15
+ * `DEFAULT_LOCALE` must be `en` because is the default of the other modules.
16
+ */
17
+ declare const DEFAULT_LOCALE = "en";
18
+ declare const I18nProvider: ({ children, locale: initialLocale, loadLocaleData, ...intlConfig }: I18nProviderProps) => react_jsx_runtime.JSX.Element;
19
+
20
+ declare const useI18n: () => {
21
+ intl: react_intl.IntlShape;
22
+ locale?: string | undefined;
23
+ loadLocaleData?: LoadLocaleData | undefined;
24
+ children?: React.ReactNode;
25
+ onError?: ((err: Error) => void) | undefined;
26
+ defaultLocale: string;
27
+ setLocale: (language: string) => void;
28
+ };
29
+
30
+ export { DEFAULT_LOCALE, I18nProvider, I18nProviderProps, LoadLocaleData, useI18n };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/react-i18n",
3
- "version": "1.23.5",
3
+ "version": "1.24.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -29,11 +29,11 @@
29
29
  "devDependencies": {
30
30
  "@formatjs/cli": "^6.0.4",
31
31
  "@types/react": "^18.2.12",
32
- "jest": "^29.5.0",
33
- "tsup": "^7.0.0",
34
- "@ttoss/config": "^1.30.4",
35
- "@ttoss/i18n-cli": "^0.6.3",
36
- "@ttoss/test-utils": "^1.23.5"
32
+ "jest": "^29.6.2",
33
+ "tsup": "^7.1.0",
34
+ "@ttoss/config": "^1.30.6",
35
+ "@ttoss/i18n-cli": "^0.6.5",
36
+ "@ttoss/test-utils": "^1.23.7"
37
37
  },
38
38
  "keywords": [
39
39
  "React",