forked from i18next/next-i18next
-
Notifications
You must be signed in to change notification settings - Fork 3
/
types.d.ts
54 lines (47 loc) · 1.33 KB
/
types.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import * as React from 'react';
import {
TransProps,
Namespace,
NamespaceExtractor,
WithNamespacesOptions,
WithNamespaces,
Subtract
} from 'react-i18next';
import { LinkProps } from 'next-server/link';
import { SingletonRouter } from 'next-server/router';
import i18next from 'i18next';
export type InitConfig = {
browserLanguageDetection?: boolean;
serverLanguageDetection?: boolean;
strictMode?: boolean;
defaultLanguage: string;
ignoreRoutes?: string[];
localePath?: string;
localeStructure?: string;
otherLanguages: string[];
localeSubpaths?: "none" | "foreign" | "all";
use?: any[];
customDetectors?: any[];
} & i18next.InitOptions;
export type Config = {
fallbackLng: boolean;
allLanguages: string[];
whitelist: string[];
preload: string[];
} & InitConfig;
declare class NextI18Next {
Trans: React.ComponentClass<TransProps>;
Link: React.ComponentClass<LinkProps>;
Router: SingletonRouter;
i18n: i18next.i18n;
config: Config;
constructor(config: InitConfig);
withNamespaces(
namespace: Namespace | NamespaceExtractor,
options?: WithNamespacesOptions,
): <P>(
component: React.ComponentType<P>,
) => React.ComponentType<Subtract<P, WithNamespaces>>;
appWithTranslation<P extends object>(Component: React.ComponentType<P> | React.ElementType<P>): any;
}
export default NextI18Next;