import { I18n } from '@i18n-micro/node'; import { I18nOptions } from '@i18n-micro/node'; import { I18nRoutingStrategy } from '@i18n-micro/vue'; import { LoadedTranslations } from '@i18n-micro/node'; import { loadRootTranslations } from '@i18n-micro/node'; import { loadTranslations } from '@i18n-micro/node'; import { Locale } from '@i18n-micro/types'; /** * Build VitePress `config.locales` from i18n-micro `Locale[]`. * Default locale becomes `root` (no URL prefix); others get `/{key}/`. */ export declare function buildVitePressLocales(locales: Locale[], defaultLocale: string, options?: BuildVitePressLocalesOptions): Record; export declare interface BuildVitePressLocalesOptions { /** * Map VitePress locale keys → i18n codes (`root` → default). * When a non-default code maps to a short VP key (`fr` → `fr-FR`), the URL * prefix / config key uses the VP key. */ localeKeyToCode?: Record; } /** * Node `createI18n` (`@i18n-micro/node`) + VitePress path methods from the router adapter. */ export declare function createI18n(options: CreateI18nOptions): NodeI18n; export declare interface CreateI18nOptions extends I18nOptions { /** Locales for path helpers (`localizePath`, …). Defaults to `[{ code: locale }]`. */ locales?: Locale[] | string[]; defaultLocale?: string; localeKeyToCode?: Record; base?: string; } export { I18nOptions } export { LoadedTranslations } export { loadRootTranslations } export { loadTranslations } export declare type NodeI18n = I18n & PathMethods; /** Path helpers exposed on `createI18n` instances (slice of the router adapter). */ declare type PathMethods = Pick; /** * Minimal VitePress `locales` entry used by the default theme language menu. */ export declare interface VitePressLocaleEntry { label: string; lang: string; link?: string; } declare interface VitePressRouterAdapter extends I18nRoutingStrategy { getLocaleFromPath: (path: string) => string; switchLocalePath: (path: string, newLocale: string) => string; localizePath: (path: string, locale: string) => string; removeLocaleFromPath: (path: string) => string; /** Page dictionary route name (`/fr/guide/demo` → `guide-demo`). */ routeNameFromPath: (path: string) => string; /** Resolve VitePress locale key (`root` / `fr`) to i18n code. */ codeFromLocaleKey: (localeKey: string) => string; /** Resolve i18n code to VitePress locale key. */ localeKeyFromCode: (code: string) => string; localeCodes: string[]; defaultLocale: string; /** Snapshot of mapping used when building the adapter (for `i18nRouting` serialization). */ localeKeyToCode: Record; /** URL path prefixes (VitePress locale keys except `root`). */ urlPrefixes: string[]; /** VitePress `site.base` used when constructing this adapter (may be undefined). */ base?: string; } export { }