From eb3a5d2ad96119815ca3f1e402b95e18b130e633 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 28 Aug 2017 07:51:50 -0700 Subject: [PATCH] i18next: Fix compile errors (#19205) --- types/i18next/i18next-tests.ts | 24 ++++++++++++------------ types/i18next/index.d.ts | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/types/i18next/i18next-tests.ts b/types/i18next/i18next-tests.ts index afdd59d538..1a425084e8 100644 --- a/types/i18next/i18next-tests.ts +++ b/types/i18next/i18next-tests.ts @@ -435,21 +435,21 @@ interface CustomOptions { myVar: string; } -i18next.t("friend"); -i18next.t(["friend", "tree"]); -i18next.t("friend", { myVar: "someValue" }); -i18next.t(["friend", "tree"], { myVar: "someValue" }); -i18next.t("friend", { myVar: "someValue" }); -i18next.t(["friend", "tree"], { myVar: "someValue" }); +i18next.t("friend"); +i18next.t(["friend", "tree"]); +i18next.t("friend", { myVar: "someValue" }); +i18next.t(["friend", "tree"], { myVar: "someValue" }); +i18next.t("friend", { myVar: "someValue" }); +i18next.t(["friend", "tree"], { myVar: "someValue" }); const t1: i18next.TranslationFunction = (key: string, options: i18next.TranslationOptions) => ""; const t2: i18next.TranslationFunction<{ value: string }> = (key: string, options: i18next.TranslationOptions) => ({ value: "asd" }); const t3: i18next.TranslationFunction = (key: string | string[], options: i18next.TranslationOptions) => ""; const t4: i18next.TranslationFunction = (key: KeyList | KeyList[], options: i18next.TranslationOptions) => ""; -i18next.exists("friend"); -i18next.exists(["friend", "tree"]); -i18next.exists("friend", { myVar: "someValue" }); -i18next.exists(["friend", "tree"], { myVar: "someValue" }); -i18next.exists("friend", { myVar: "someValue" }); -i18next.exists(["friend", "tree"], { myVar: "someValue" }); +i18next.exists("friend"); +i18next.exists(["friend", "tree"]); +i18next.exists("friend", { myVar: "someValue" }); +i18next.exists(["friend", "tree"], { myVar: "someValue" }); +i18next.exists("friend", { myVar: "someValue" }); +i18next.exists(["friend", "tree"], { myVar: "someValue" }); diff --git a/types/i18next/index.d.ts b/types/i18next/index.d.ts index 5ddad0b6e1..c510d824eb 100644 --- a/types/i18next/index.d.ts +++ b/types/i18next/index.d.ts @@ -396,8 +396,7 @@ declare namespace i18next { type Callback = (error: any, t: TranslationFunction) => void; type TranslationFunction = - - (key: TMethodKeys | TMethodKeys[], options?: TranslationOptions) => TMethodResult; + (key: TKeys | TKeys[], options?: TranslationOptions) => TResult; interface Resource { [language: string]: ResourceLanguage;