🧑‍💻 Update i18next types (#1453)

This commit is contained in:
Luke Vella 2024-12-01 23:51:49 +00:00 committed by GitHub
parent ca207a913e
commit 40df1ff9da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 17 additions and 30 deletions

View file

@ -2,14 +2,12 @@ import "i18next";
import type emails from "./locales/en/emails.json";
interface I18nNamespaces {
emails: typeof emails;
}
declare module "i18next" {
interface CustomTypeOptions {
defaultNS: "emails";
resources: I18nNamespaces;
resources: {
emails: typeof emails;
};
returnNull: false;
}
}

View file

@ -9,7 +9,7 @@ export type EmailContext = {
domain: string;
supportEmail: string;
i18n: I18nInstance;
t: TFunction;
t: TFunction<"emails", undefined, "emails">;
};
export type TemplateName = keyof EmailTemplates;

View file

@ -1,10 +1,5 @@
{
"extends": "@rallly/tsconfig/next.json",
"compilerOptions": {
"strict": true,
"strictNullChecks": true,
"resolveJsonModule": true
},
"files": ["i18next.d.ts"],
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", ".react-email"]