import { type ReactNode } from 'react'; /** * Language code — any string is allowed so consumers can extend with their own * locales (e.g. `'fr'`, `'de'`, `'ja'`). The library ships with built-in * support for `'pt-BR'`, `'en'`, and `'es'`, but those are recommendations not * restrictions. */ export type Language = string; /** * Descriptor for a single language available in the picker. */ export interface LanguageDefinition { /** ISO/BCP-47 code stored in localStorage and passed to i18n.changeLanguage() */ code: Language; /** Full display label shown in the LanguageSelector dropdown */ label: string; /** Short label shown in `variant="minimal"` (e.g. "PT", "EN") */ shortLabel?: string; /** Optional translation JSON. When provided, it is registered with i18next * on mount so dynamically added locales are loaded automatically. * Use a plain object matching your `pt-BR.json` shape. */ resources?: Record; } interface LanguageContextType { /** Currently active language code */ language: Language; /** Change the active language (persists + updates i18n + invalidates queries) */ setLanguage: (language: Language) => void; /** All languages registered for this app */ availableLanguages: LanguageDefinition[]; /** True when only a single language is configured — UI can hide selectors */ isMonolingual: boolean; } /** * Default language set when no `availableLanguages` prop is provided. * These are the locales the library ships with out-of-the-box. */ export declare const DEFAULT_LANGUAGES: LanguageDefinition[]; export interface LanguageProviderProps { children: ReactNode; /** * List of languages available to this app. The first item is the default * when no saved preference exists. Pass a single-item array to lock the * app to one language (the LanguageSelector will hide itself automatically). * Defaults to `DEFAULT_LANGUAGES` (pt-BR, en, es) when omitted. * * @example * ```tsx * // Monolingual English app * * ``` * * @example * ```tsx * // Add French alongside the built-in languages * import fr from './locales/fr.json'; * * * ``` */ availableLanguages?: LanguageDefinition[]; /** * Override the default language. Falls back to the first item in * `availableLanguages` when omitted. */ defaultLanguage?: Language; } export declare function LanguageProvider({ children, availableLanguages, defaultLanguage, }: LanguageProviderProps): import("react/jsx-runtime").JSX.Element; export declare function useLanguage(): LanguageContextType; export {};