UNPKG

next-i18next

Version:

The easiest way to translate your NextJs apps.

59 lines (58 loc) 2.57 kB
import { appWithTranslation, globalI18n } from "./appWithTranslation.cjs"; import { FallbackNs, I18nContext, Trans, Translation, UseTranslationOptions, UseTranslationResponse, WithTranslation as WithTranslation$1, useTranslation, withTranslation } from "react-i18next"; import { FlatNamespace, InitOptions, KeyPrefix, TFunction as TFunction$1, TypeOptions, i18n } from "i18next"; //#region src/pagesRouter/types.d.ts /** * Inlined from `import('next').NextConfig.i18n` v13.0.6. As we support * multiple nextjs versions it's safer to inline and keep it up-to-date. */ type NextJsI18NConfig = { defaultLocale: string; domains?: { defaultLocale: string; domain: string; http?: true; locales?: string[]; }[]; localeDetection?: false; locales: string[]; }; type DefaultNamespace = TypeOptions['defaultNS']; type UserConfig = { i18n: NextJsI18NConfig; localeExtension?: string; localePath?: string | ((locale: string, namespace: string, missing: boolean) => string) | null; localeStructure?: string; onPreInitI18next?: (i18n: I18n) => void; reloadOnPrerender?: boolean; serializeConfig?: boolean; use?: any[]; } & InitOptions; type InternalConfig = Omit<UserConfig, 'i18n'> & NextJsI18NConfig & { errorStackTraceLimit: number; preload: string[]; supportedLngs: string[]; }; type $Tuple<T> = readonly [T?, ...T[]]; type UseTranslation<Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined, KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined> = (ns?: Ns, options?: UseTranslationOptions<KPrefix>) => UseTranslationResponse<FallbackNs<Ns>, KPrefix>; type AppWithTranslation = typeof appWithTranslation; type TFunction = TFunction$1; type I18n = i18n; type WithTranslationHocType = typeof withTranslation; type WithTranslation<Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined, KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined> = WithTranslation$1<Ns, KPrefix>; type InitPromise = Promise<TFunction>; type CreateClientReturn = { i18n: I18n; initPromise: InitPromise; }; type SSRConfig = { _nextI18Next?: { initialI18nStore: any; initialLocale: string; ns: string[]; userConfig: UserConfig | null; }; }; //#endregion export { AppWithTranslation, CreateClientReturn, DefaultNamespace, I18n, I18nContext, InitPromise, InternalConfig, SSRConfig, TFunction, Trans, Translation, UseTranslation, UserConfig, WithTranslation, WithTranslationHocType, appWithTranslation, globalI18n as i18n, useTranslation, withTranslation }; //# sourceMappingURL=types.d.cts.map