From 83f4fc8ab07a7f4cd3bba8042d600d7a4543bcaf Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 23 Oct 2022 23:53:15 +0800 Subject: It's been a long time not developing this. Still need some time to get it work again. --- FrontEnd/src/i18next.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 FrontEnd/src/i18next.d.ts (limited to 'FrontEnd/src/i18next.d.ts') diff --git a/FrontEnd/src/i18next.d.ts b/FrontEnd/src/i18next.d.ts new file mode 100644 index 00000000..761b22f3 --- /dev/null +++ b/FrontEnd/src/i18next.d.ts @@ -0,0 +1,19 @@ +// import the original type declarations +import "react-i18next"; +// import all namespaces (for the default language, only) +import admin from "./locales/en/admin.json"; +import translation from "./locales/en/translation.json"; + +// react-i18next versions higher than 11.11.0 +declare module "i18next" { + // and extend them! + interface CustomTypeOptions { + // custom namespace type if you changed it + defaultNS: "translation"; + // custom resources type + resources: { + admin: typeof admin; + translation: typeof translation; + }; + } +} -- cgit v1.2.3