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 +++++++++++++++++++ FrontEnd/src/sw.ts | 2 -- FrontEnd/src/vite-env.d.ts | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 FrontEnd/src/i18next.d.ts create mode 100644 FrontEnd/src/vite-env.d.ts (limited to 'FrontEnd/src') 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; + }; + } +} diff --git a/FrontEnd/src/sw.ts b/FrontEnd/src/sw.ts index 0130e345..a43ff9e5 100644 --- a/FrontEnd/src/sw.ts +++ b/FrontEnd/src/sw.ts @@ -1,5 +1,3 @@ -/// -/// /// import { precacheAndRoute, matchPrecache } from "workbox-precaching"; diff --git a/FrontEnd/src/vite-env.d.ts b/FrontEnd/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/FrontEnd/src/vite-env.d.ts @@ -0,0 +1 @@ +/// -- cgit v1.2.3