/** * React higher-order component (HoC) that wraps the given component * in LinguiJs's `I18nProvider` component. * * The required language catalog, supported languages, and default language * must be provided by the consumer of this HoC. It will then detect * the best language to use based on the incoming request, load * the catalog for that language, and supply it to the `I18nProvider`. * * Additionally, this HoC adds the matched language to the * initial props provided by `getInitialProps`. * * See also: * - https://reactjs.org/docs/higher-order-components.html */ import { NextComponentType } from 'next'; import { AppInitialProps } from 'next/app'; import * as React from 'react'; import { Catalog } from '@lingui/core'; export interface AppWithLinguiInitialProps extends AppInitialProps { language: string; catalog: Catalog; wrappedAppInitialProps: TWrappedAppInitialProps; } /** * @param getCatalog A function that should provide language Catalog * @param languages The set of supported languages for translation * @param defaultLanguage The default language */ declare const appWithLingui: (getCatalog: (language: string) => Promise, languages?: string[], defaultLanguage?: string) => (WrappedApp: NextComponentType & TWrappedAppParams, TWrappedAppInitialProps, AppInitialProps & { Component: NextComponentType; router: import("next/router").Router; } & TWrappedAppParams & TWrappedAppInitialProps>) => React.ComponentClass; router: import("next/router").Router; } & TWrappedAppParams & AppWithLinguiInitialProps, any> & { getInitialProps?(context: import("next/dist/next-server/lib/utils").AppContextType & TWrappedAppParams): AppWithLinguiInitialProps | Promise>; }; export default appWithLingui; /** * Return the list of languages which the current user's browser prefers, * as a list of BCP 47 language tags. * * `navigator.languages` is preferred if available, otherwise falling back to the older * `navigator.language` API, or the IE-specific `navigator.browserLanguage` / * `navigator.userLanguage` APIs. */ export declare const getBrowserPreferredLanguages: () => string[];