Skip to content

Commit

Permalink
Fix TFuncReturn to accept primitive value as default (#1217)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrodurek committed Dec 9, 2020
1 parent 9d339d3 commit 77c04c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ts4.1/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import i18next, {
Resource,
TOptions,
StringMap,
TFunctionResult,
} from 'i18next';
import * as React from 'react';

Expand Down Expand Up @@ -87,7 +88,7 @@ export type TFuncReturn<N, P, T = Resources> = N extends (keyof T)[]
? NormalizeMultiReturn<T, P>
: N extends keyof T
? NormalizeReturn<T[N], P>
: string;
: TFunctionResult;

export interface TFunction<N extends Namespace = DefaultNamespace> {
<K extends TFuncKey<N> | TemplateStringsArray, I extends object = StringMap>(
Expand Down

0 comments on commit 77c04c7

Please sign in to comment.