i18next 21.3.1 → 21.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 21.3.2
2
+
3
+ - formatter typescript declarations [1679](https://github.com/i18next/i18next/pull/1679)
4
+
1
5
  ## 21.3.1
2
6
 
3
7
  - get rid of internal isDummy check to prevent react-native issue [1675](https://github.com/i18next/i18next/issues/1675)
package/index.d.ts CHANGED
@@ -750,6 +750,12 @@ export class ResourceStore {
750
750
  off(event: 'added' | 'removed', callback?: (lng: string, ns: string) => void): void;
751
751
  }
752
752
 
753
+ export interface Formatter {
754
+ init(services: Services, i18nextOptions: InitOptions): void;
755
+ add(name: string, fc: (value: any, lng: string | undefined, options: any) => string): void;
756
+ format: FormatFunction;
757
+ }
758
+
753
759
  export interface Services {
754
760
  backendConnector: any;
755
761
  i18nFormat: any;
@@ -759,6 +765,7 @@ export interface Services {
759
765
  logger: any;
760
766
  pluralResolver: any;
761
767
  resourceStore: ResourceStore;
768
+ formatter?: Formatter;
762
769
  }
763
770
 
764
771
  export type ModuleType =
@@ -767,6 +774,7 @@ export type ModuleType =
767
774
  | 'languageDetector'
768
775
  | 'postProcessor'
769
776
  | 'i18nFormat'
777
+ | 'formatter'
770
778
  | '3rdParty';
771
779
 
772
780
  export interface Module {
@@ -860,6 +868,10 @@ export interface I18nFormatModule extends Module {
860
868
  type: 'i18nFormat';
861
869
  }
862
870
 
871
+ export interface FormatterModule extends Module, Formatter {
872
+ type: 'formatter';
873
+ }
874
+
863
875
  export interface ThirdPartyModule extends Module {
864
876
  type: '3rdParty';
865
877
  init(i18next: i18n): void;
@@ -870,6 +882,7 @@ export interface Modules {
870
882
  logger?: LoggerModule;
871
883
  languageDetector?: LanguageDetectorModule | LanguageDetectorAsyncModule;
872
884
  i18nFormat?: I18nFormatModule;
885
+ formatter?: FormatterModule;
873
886
  external: ThirdPartyModule[];
874
887
  }
875
888
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18next",
3
- "version": "21.3.1",
3
+ "version": "21.3.2",
4
4
  "description": "i18next internationalization framework",
5
5
  "main": "./dist/cjs/i18next.js",
6
6
  "module": "./dist/esm/i18next.js",