@@ -216,188 +216,3 @@ export function Translation<
216216 Ns extends FlatNamespace | $Tuple < FlatNamespace > | undefined = undefined ,
217217 KPrefix extends KeyPrefix < FallbackNs < Ns > > = undefined ,
218218> ( props : TranslationProps < Ns , KPrefix > ) : any ;
219-
220- // import type { $Subtract, $Tuple } from './helpers.js';
221- // import type {
222- // ReactOptions,
223- // i18n,
224- // Resource,
225- // FlatNamespace,
226- // Namespace,
227- // TypeOptions,
228- // TFunction,
229- // KeyPrefix,
230- // } from 'i18next';
231- // import * as React from 'react';
232- // import { Trans, TransProps, ErrorCode, ErrorArgs } from './TransWithoutContext.js';
233- // export { initReactI18next } from './initReactI18next.js';
234-
235- // export const TransWithoutContext: typeof Trans;
236- // export { Trans, TransProps, ErrorArgs, ErrorCode };
237-
238- // export function setDefaults(options: ReactOptions): void;
239- // export function getDefaults(): ReactOptions;
240- // export function setI18n(instance: i18n): void;
241- // export function getI18n(): i18n;
242- // export function composeInitialProps(ForComponent: any): (ctx: unknown) => Promise<any>;
243- // export function getInitialProps(): {
244- // initialI18nStore: {
245- // [ns: string]: {};
246- // };
247- // initialLanguage: string;
248- // };
249-
250- // export interface ReportNamespaces {
251- // addUsedNamespaces(namespaces: Namespace): void;
252- // getUsedNamespaces(): string[];
253- // }
254-
255- // declare module 'i18next' {
256- // // interface i18n {
257- // // reportNamespaces?: ReportNamespaces;
258- // // }
259- // interface CustomInstanceExtensions {
260- // reportNamespaces?: ReportNamespaces;
261- // }
262- // }
263-
264- // type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
265- // ? Record<string, unknown>
266- // : never;
267-
268- // type ReactI18NextChildren = React.ReactNode | ObjectOrNever;
269-
270- // declare module 'react' {
271- // namespace JSX {
272- // interface IntrinsicAttributes {
273- // i18nIsDynamicList?: boolean;
274- // }
275- // }
276-
277- // interface HTMLAttributes<T> {
278- // // This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop
279- // // expects a single child of type 'ReactI18NextChildren', but multiple children were provided":
280- // // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a1e9f91ed0143adede394adb3f540e650455f71/types/react/index.d.ts#L268
281- // children?: ReactI18NextChildren | Iterable<ReactI18NextChildren>;
282- // }
283- // }
284-
285- // type _DefaultNamespace = TypeOptions['defaultNS'];
286-
287- // export function useSSR(initialI18nStore: Resource, initialLanguage: string): void;
288-
289- // export interface UseTranslationOptions<KPrefix> {
290- // i18n?: i18n;
291- // useSuspense?: boolean;
292- // keyPrefix?: KPrefix;
293- // bindI18n?: string | false;
294- // nsMode?: 'fallback' | 'default';
295- // lng?: string;
296- // // other of these options might also work: https://github.com/i18next/i18next/blob/master/index.d.ts#L127
297- // }
298-
299- // export type UseTranslationResponse<Ns extends Namespace, KPrefix> = [
300- // t: TFunction<Ns, KPrefix>,
301- // i18n: i18n,
302- // ready: boolean,
303- // ] & {
304- // t: TFunction<Ns, KPrefix>;
305- // i18n: i18n;
306- // ready: boolean;
307- // };
308-
309- // // Workaround to make code completion to work when suggesting namespaces.
310- // // This is a typescript limitation when using generics with default values,
311- // // it'll be addressed in this issue: https://github.com/microsoft/TypeScript/issues/52516
312- // export type FallbackNs<Ns> = Ns extends undefined
313- // ? _DefaultNamespace
314- // : Ns extends Namespace
315- // ? Ns
316- // : _DefaultNamespace;
317-
318- // export function useTranslation<
319- // const Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined,
320- // const KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined,
321- // >(
322- // ns?: Ns,
323- // options?: UseTranslationOptions<KPrefix>,
324- // ): UseTranslationResponse<FallbackNs<Ns>, KPrefix>;
325-
326- // // Need to see usage to improve this
327- // export function withSSR(): <Props>(WrappedComponent: React.ComponentType<Props>) => {
328- // ({
329- // initialI18nStore,
330- // initialLanguage,
331- // ...rest
332- // }: {
333- // initialI18nStore: Resource;
334- // initialLanguage: string;
335- // } & Props): React.FunctionComponentElement<Props>;
336- // getInitialProps: (ctx: unknown) => Promise<any>;
337- // };
338-
339- // export interface WithTranslation<
340- // Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined,
341- // KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined,
342- // > {
343- // t: TFunction<FallbackNs<Ns>, KPrefix>;
344- // i18n: i18n;
345- // tReady: boolean;
346- // }
347-
348- // export interface WithTranslationProps {
349- // i18n?: i18n;
350- // useSuspense?: boolean;
351- // }
352-
353- // export function withTranslation<
354- // Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined,
355- // KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined,
356- // >(
357- // ns?: Ns,
358- // options?: {
359- // withRef?: boolean;
360- // keyPrefix?: KPrefix;
361- // },
362- // ): <
363- // C extends React.ComponentType<React.ComponentProps<any> & WithTranslationProps>,
364- // ResolvedProps = React.JSX.LibraryManagedAttributes<
365- // C,
366- // $Subtract<React.ComponentProps<C>, WithTranslationProps>
367- // >,
368- // >(
369- // component: C,
370- // ) => React.ComponentType<Omit<ResolvedProps, keyof WithTranslation<Ns>> & WithTranslationProps>;
371-
372- // export interface I18nextProviderProps {
373- // children?: React.ReactNode;
374- // i18n: i18n;
375- // defaultNS?: string | string[];
376- // }
377-
378- // export const I18nextProvider: React.FunctionComponent<I18nextProviderProps>;
379- // export const I18nContext: React.Context<{ i18n: i18n }>;
380-
381- // export interface TranslationProps<
382- // Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined,
383- // KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined,
384- // > {
385- // children: (
386- // t: TFunction<FallbackNs<Ns>, KPrefix>,
387- // options: {
388- // i18n: i18n;
389- // lng: string;
390- // },
391- // ready: boolean,
392- // ) => React.ReactNode;
393- // ns?: Ns;
394- // i18n?: i18n;
395- // useSuspense?: boolean;
396- // keyPrefix?: KPrefix;
397- // nsMode?: 'fallback' | 'default';
398- // }
399-
400- // export function Translation<
401- // Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined,
402- // KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined,
403- // >(props: TranslationProps<Ns, KPrefix>): any;
0 commit comments