Skip to content

Commit

Permalink
Fix automatically inferrance (i18next#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrodurek committed Dec 9, 2020
1 parent 77c04c7 commit 766103d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ts4.1/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,23 @@ export type TFuncReturn<N, P, T = Resources> = N extends (keyof T)[]
: TFunctionResult;

export interface TFunction<N extends Namespace = DefaultNamespace> {
<K extends TFuncKey<N> | TemplateStringsArray, I extends object = StringMap>(
<
K extends TFuncKey<N> | TemplateStringsArray,
R extends TFuncReturn<N, K>,
I extends object = StringMap
>(
key: K | K[],
options?: TOptions<I> | string,
): TFuncReturn<N, K>;
<K extends TFuncKey<N> | TemplateStringsArray, I extends object = StringMap>(
): R;
<
K extends TFuncKey<N> | TemplateStringsArray,
R extends TFuncReturn<N, K>,
I extends object = StringMap
>(
key: K | K[],
defaultValue?: string,
options?: TOptions<I> | string,
): TFuncReturn<N, K>;
): R;
}

export interface TransProps<
Expand Down

0 comments on commit 766103d

Please sign in to comment.