File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -215,9 +215,13 @@ export type Callback = (error: any, t: TFunction) => void;
215215 *
216216 * Note: this shape intentionally does not include a type-guard overload so it
217217 * remains easy to assign arrow functions to. The type guard narrowing to
218- * {@link SelectorKey} is declared directly on `i18n.exists` instead.
219- * Users who want narrowing on a custom wrapper can type it as
220- * `typeof i18next.exists`.
218+ * {@link SelectorKey} is declared directly on `i18n.exists` instead. If you
219+ * need narrowing in your own code, call `i18next.exists` directly or forward
220+ * the function by reference (e.g. `const exists: typeof i18next.exists =
221+ * i18next.exists`). Wrapping it in an arrow function will lose the narrowing —
222+ * there is currently no way to keep type-guard narrowing through an
223+ * arrow-function wrapper, which is why `ExistsFunction` deliberately omits the
224+ * predicate overload.
221225 */
222226export interface ExistsFunction <
223227 TKeys extends string = string ,
You can’t perform that action at this time.
0 commit comments