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 +4 -0
- package/index.d.ts +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
|