import { LinguiConfigNormalized } from '@lingui/conf'; import { R as RedirectBehavior } from '../shared/lingui-react-router.DBElLmau.cjs'; /** * Full configuration for the Lingui React Router plugin. */ type LinguiRouterPluginConfigFull = { /** * One or more root-level path prefixes that should NOT be treated as locales. * For example, ["api"]. */ exclude: string[]; /** * Whether to detect locale from the Accept-Language header. * Defaults to true. */ detectLocale: boolean; /** * Redirect behavior for detected locales. * * - "auto": Redirect to a detected locale only if it's not the default locale. * - "always": Always redirect to a detected locale, even if it's the default locale. * - "never": Never redirect to a detected locale. */ redirect: RedirectBehavior; /** * Mapping of locale codes to fallback locale codes, used for locale detection and redirection. * * For example, `{ "fr-CA": "fr", "es-MX": "es" }`, * where in lingui config are `["fr", "es"]` only. * * It's also possible to map to a different locale, e.g. `{ "de": "en" }`. */ localeMapping: Record; /** * Whether to enable default locale mapping according to CLDR data. * * When set to false, only identity mappings and custom localeMapping entries will be included, * without automatic CLDR fallbacks. * * For example, mapping "en-GB" to "en", "pt-BR" to "pt", etc. * Defaults to true. */ defaultLocaleMapping: boolean; /** * Name of the URL parameter used to specify the locale. * Defaults to "locale", e.g. `"/:locale?/*"`. */ localeParamName: string; /** * Explicit Lingui configuration to use. When not set, * the plugin will load the Lingui config itself. * * Set this only if you want to override the Lingui config loaded by the plugin. */ linguiConfig: Readonly; /** * Default locale to use when no locale can be detected. Must be included in `locales`. * * By default, the first locale from `locales` is used. */ defaultLocale: string; /** * Override locales list defined in Lingui config. * * Normally, you should not need to set this. */ locales: string[]; /** * Overrides the pseudo-locale defined in Lingui config. * * Normally, you should not need to set this. */ pseudoLocale?: string; /** * Whether to optimize client-side locale bundles by replacing `Object.assign` calls * with direct catalog objects in generated code. This reduces runtime overhead and * bundle size by inlining catalog data instead of merging at runtime. * * This affects only client-side generated catalog files. Defaults to true. */ optimizeLocaleBundles: boolean; }; /** * Configuration passed from the consumer to wire up catalog loading and path exclusions. */ type LinguiRouterPluginConfig = Partial; /** * Convenience function to define the Lingui React Router plugin configuration. * * This function is not needed when passing config to the `linguiRouterPlugin` function directly. * * @param config - Partial configuration for the Lingui React Router plugin. * @returns The provided configuration object. * @example * ```ts * import { defineLinguiRouterConfig } from "lingui-react-router/plugin" * * export default defineLinguiRouterConfig({ * exclude: ["api"], * redirect: "auto", * }) * ``` */ declare function defineLinguiRouterConfig(config: LinguiRouterPluginConfig): LinguiRouterPluginConfig; declare module "vite" { interface ResolvedConfig { /** Lingui Router plugin configuration */ linguiRouterConfig: Readonly; } } /** * Vite plugin for Lingui React Router that handles internationalization with automatic * code splitting by locale and optimized asset loading. * * This plugin creates virtual modules for locale manifests and message catalogs, * enabling efficient client-side loading and SSR support. * * @param pluginConfig - Configuration options for the plugin * @returns Vite plugin object with hooks for build and dev server integration */ declare function linguiRouterPlugin(pluginConfig?: LinguiRouterPluginConfig): any; export { defineLinguiRouterConfig, linguiRouterPlugin }; export type { LinguiRouterPluginConfig };