/** * Plugin configuration options */ interface PluginOptions { /** Route where editor is served (default: '/_translations') */ route?: string; /** Path to .po files directory */ localesDir?: string; /** Enable in production mode (premium) */ production?: boolean; /** License key for premium features */ licenseKey?: string; /** AI configuration (premium) */ ai?: { provider: 'openai' | 'anthropic' | 'google'; apiKey?: string; }; /** Restart the dev server when a .po file is updated (default: false) */ restartOnPoChange?: boolean; /** Trigger a full page reload when a .po file is updated (default: true) */ reloadOnPoChange?: boolean; } /** * Represents a single translation entry */ interface Translation { msgid: string; msgstr: string; context?: string; comments?: { reference?: string; translator?: string; extracted?: string; flag?: string; }; fuzzy?: boolean; } /** * Represents a language with its translations */ interface Language { code: string; name: string; path: string; translations: Translation[]; progress: { total: number; translated: number; fuzzy: number; }; } /** * Language stats for the overview */ interface LanguageStats { code: string; name: string; total: number; translated: number; fuzzy: number; untranslated: number; progress: number; } /** * vite-plugin-lingo - Visual translation editor for .po files * * @example * ```ts * // vite.config.ts (default setup) * import { defineConfig } from 'vite'; * import lingo from 'vite-plugin-lingo'; * * export default defineConfig({ * plugins: [ * lingo({ * route: '/_translations', * localesDir: './locales' * }) * ] * }); * ``` * * @example * ```ts * // vite.config.ts (SvelteKit convention) * import { defineConfig } from 'vite'; * import lingo from 'vite-plugin-lingo'; * * export default defineConfig({ * plugins: [ * lingo({ * route: '/_translations', * localesDir: './src/locales' // Common in SvelteKit * }) * ] * }); * ``` */ declare function lingoPlugin(options?: PluginOptions): any; export { type Language, type LanguageStats, type PluginOptions, type Translation, lingoPlugin as default, lingoPlugin };