-
-
Notifications
You must be signed in to change notification settings - Fork 1k
/
TransWithoutContext.d.ts
37 lines (34 loc) · 1.34 KB
/
TransWithoutContext.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import type { i18n, ParseKeys, Namespace, TypeOptions, TOptions, TFunction } from 'i18next';
import * as React from 'react';
type _DefaultNamespace = TypeOptions['defaultNS'];
type TransChild = React.ReactNode | Record<string, unknown>;
export type TransProps<
Key extends ParseKeys<Ns, TOpt, KPrefix>,
Ns extends Namespace = _DefaultNamespace,
KPrefix = undefined,
TContext extends string | undefined = undefined,
TOpt extends TOptions & { context?: TContext } = { context: TContext },
E = React.HTMLProps<HTMLDivElement>,
> = E & {
children?: TransChild | readonly TransChild[];
components?: readonly React.ReactElement[] | { readonly [tagName: string]: React.ReactElement };
count?: number;
context?: TContext;
defaults?: string;
i18n?: i18n;
i18nKey?: Key | Key[];
ns?: Ns;
parent?: string | React.ComponentType<any> | null; // used in React.createElement if not null
tOptions?: TOpt;
values?: {};
shouldUnescape?: boolean;
t?: TFunction<Ns, KPrefix>;
};
export function Trans<
Key extends ParseKeys<Ns, TOpt, KPrefix>,
Ns extends Namespace = _DefaultNamespace,
KPrefix = undefined,
TContext extends string | undefined = undefined,
TOpt extends TOptions & { context?: TContext } = { context: TContext },
E = React.HTMLProps<HTMLDivElement>,
>(props: TransProps<Key, Ns, KPrefix, TContext, TOpt, E>): React.ReactElement;