@bleedingdev/modern-js-plugin-i18n 3.2.0-ultramodern.0 → 3.2.0-ultramodern.10

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.
@@ -22,7 +22,7 @@ interface I18nextServices {
22
22
  }
23
23
  export declare class SdkBackend {
24
24
  static type: string;
25
- type: "backend";
25
+ type: 'backend';
26
26
  sdk?: I18nSdkLoader;
27
27
  private allResourcesCache;
28
28
  private backendId;
@@ -1,4 +1,7 @@
1
1
  import type { BaseBackendOptions } from '../../shared/type';
2
+ type ReactI18nextModule = typeof import('react-i18next');
3
+ type InitReactI18next = ReactI18nextModule['initReactI18next'];
4
+ type I18nextProviderComponent = ReactI18nextModule['I18nextProvider'];
2
5
  export interface I18nResourceStore {
3
6
  data?: {
4
7
  [language: string]: {
@@ -88,6 +91,6 @@ export type I18nInitOptions = {
88
91
  export declare function isI18nInstance(obj: any): obj is I18nInstance;
89
92
  export declare function getI18nextInstanceForProvider(instance: I18nInstance | any): any;
90
93
  export declare function getI18nInstance(userInstance?: I18nInstance | any): Promise<I18nInstance>;
91
- export declare function getInitReactI18next(): Promise<import("i18next").ThirdPartyModule | null>;
92
- export declare function getI18nextProvider(): Promise<import("react").FunctionComponent<import("react-i18next").I18nextProviderProps> | null>;
94
+ export declare function getInitReactI18next(): Promise<InitReactI18next | null>;
95
+ export declare function getI18nextProvider(): Promise<I18nextProviderComponent | null>;
93
96
  export {};
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.2.0-ultramodern.0",
20
+ "version": "3.2.0-ultramodern.10",
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
@@ -87,15 +87,15 @@
87
87
  "i18next-fs-backend": "^2.6.5",
88
88
  "i18next-http-backend": "^4.0.0",
89
89
  "i18next-http-middleware": "^3.9.6",
90
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.0",
91
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.0",
92
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.0",
93
- "@modern-js/server-runtime": "npm:@bleedingdev/modern-js-server-runtime@3.2.0-ultramodern.0",
94
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.0",
95
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.0"
90
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.10",
91
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.2.0-ultramodern.10",
92
+ "@modern-js/server-runtime": "npm:@bleedingdev/modern-js-server-runtime@3.2.0-ultramodern.10",
93
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.10",
94
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.10",
95
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.10"
96
96
  },
97
97
  "peerDependencies": {
98
- "@modern-js/runtime": "3.2.0-ultramodern.0",
98
+ "@modern-js/runtime": "3.2.0-ultramodern.10",
99
99
  "i18next": ">=25.7.4",
100
100
  "react": "^19.2.6",
101
101
  "react-dom": "^19.2.6",
@@ -120,8 +120,8 @@
120
120
  "react-dom": "^19.2.6",
121
121
  "react-i18next": "17.0.8",
122
122
  "ts-jest": "^29.4.9",
123
- "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.0",
124
- "@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.2.0-ultramodern.0"
123
+ "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.10",
124
+ "@modern-js/runtime": "npm:@bleedingdev/modern-js-runtime@3.2.0-ultramodern.10"
125
125
  },
126
126
  "sideEffects": false,
127
127
  "publishConfig": {
@@ -1,5 +1,9 @@
1
1
  import type { BaseBackendOptions } from '../../shared/type';
2
2
 
3
+ type ReactI18nextModule = typeof import('react-i18next');
4
+ type InitReactI18next = ReactI18nextModule['initReactI18next'];
5
+ type I18nextProviderComponent = ReactI18nextModule['I18nextProvider'];
6
+
3
7
  export interface I18nResourceStore {
4
8
  data?: {
5
9
  [language: string]: {
@@ -167,7 +171,7 @@ async function createI18nextInstance(): Promise<I18nInstance | null> {
167
171
  }
168
172
  }
169
173
 
170
- async function tryImportReactI18next() {
174
+ async function tryImportReactI18next(): Promise<ReactI18nextModule | null> {
171
175
  try {
172
176
  const reactI18next = await import('react-i18next');
173
177
  return reactI18next;
@@ -210,7 +214,7 @@ export async function getI18nInstance(
210
214
  throw new Error('No i18n instance found');
211
215
  }
212
216
 
213
- export async function getInitReactI18next() {
217
+ export async function getInitReactI18next(): Promise<InitReactI18next | null> {
214
218
  const reactI18nextModule = await tryImportReactI18next();
215
219
  if (reactI18nextModule) {
216
220
  return reactI18nextModule.initReactI18next;
@@ -218,7 +222,7 @@ export async function getInitReactI18next() {
218
222
  return null;
219
223
  }
220
224
 
221
- export async function getI18nextProvider() {
225
+ export async function getI18nextProvider(): Promise<I18nextProviderComponent | null> {
222
226
  const reactI18nextModule = await tryImportReactI18next();
223
227
  if (reactI18nextModule) {
224
228
  return reactI18nextModule.I18nextProvider;