From c73e0727f0fb0d8a34084e1122d12f0f263ae629 Mon Sep 17 00:00:00 2001 From: iiTzArcur Date: Tue, 24 Dec 2024 20:41:30 +0100 Subject: [PATCH] i18n typecheck --- i18next.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 i18next.d.ts diff --git a/i18next.d.ts b/i18next.d.ts new file mode 100644 index 0000000..f43c7fd --- /dev/null +++ b/i18next.d.ts @@ -0,0 +1,18 @@ +// import the original type declarations +import "i18next"; +// import all namespaces (for the default language, only) +import common from "./src/locales/languages/en-US.json"; + +declare module "i18next" { + // Extend CustomTypeOptions + // eslint-disable-next-line @typescript-eslint/naming-convention + interface CustomTypeOptions { + // custom namespace type, if you changed it + defaultNS: "common"; + // custom resources type + resources: { + common: typeof common; + }; + // other + } +}