import { ReactNode } from 'react'; export declare const LANGUAGE_PARAM = "/:lang"; export declare const LANGUAGE_PATTERN: URLPattern; /** * Update the language in the route if different from the current one. * @param newLanguage - The new language to update to. */ export declare const updateLanguageRoute: (newLanguage: string) => void; /** * Get the language from the current route. * @returns The language code from the route, if present. */ export declare const getLanguageRoute: () => string | undefined; type GetNewPathNameConfigType = { checkLanguage?: ((lang?: string) => boolean); fallbackLanguage: string; lang?: string; languages: string[]; url: URL; }; export type LanguageRouteProps = { /** * To custom check "lang" * Ex: When user tries to use languages the website doesn't support */ checkLanguage?: (lang?: string) => boolean; children: ReactNode; /** * Incase there is no language or the language is not accepted * @default first from languages */ fallbackLanguage?: string; /** * Languages allowed */ languages: string[]; }; /** * Get a new pathname based on language checks. * @param url - The URL to modify. * @param languages - Supported languages. * @param fallbackLanguage - Fallback language if the current one is not valid. * @param lang - Current language from the route. * @param checkLanguage - Custom function to validate the language. * @returns The new pathname. */ export declare function getNewPathName({ checkLanguage, fallbackLanguage, lang, languages, url }: GetNewPathNameConfigType): string; /** * Check if a language is supported. * @param lang - The language code to check. * @returns The language if supported, otherwise false. */ export declare function isLangSupported(lang: string): false | string; export {};