diff --git a/ts4.1/index.d.ts b/ts4.1/index.d.ts index 46603fc9..2a56f8f0 100644 --- a/ts4.1/index.d.ts +++ b/ts4.1/index.d.ts @@ -203,8 +203,8 @@ export interface TFunction< ): TFuncReturn; } +type I18nKeyType = TFuncKey extends infer A ? A : never; export interface TransProps< - K extends TFuncKey extends infer A ? A : never, N extends Namespace = DefaultNamespace, E extends Element = HTMLDivElement > extends React.HTMLProps { @@ -213,18 +213,17 @@ export interface TransProps< count?: number; defaults?: string; i18n?: i18n; - i18nKey?: K | K[]; + i18nKey?: I18nKeyType | I18nKeyType[]; ns?: N; parent?: string | React.ComponentType | null; // used in React.createElement if not null tOptions?: {}; values?: {}; t?: TFunction; } -export function Trans< - K extends TFuncKey extends infer A ? A : never, - N extends Namespace = DefaultNamespace, - E extends Element = HTMLDivElement ->(props: TransProps): React.ReactElement; + +export function Trans( + props: TransProps, +): React.ReactElement; export function useSSR(initialI18nStore: Resource, initialLanguage: string): void;