import type { Plugin } from 'vite'; import type { POHeaders } from './util/util.js'; import { PROJECT_NAME } from './util/util.js'; import { namespacesFrom, parsePoFile } from './lib/po2json.js'; export { PROJECT_NAME, parsePoFile, namespacesFrom }; /** * Configuration options for the Vite plugin "vite-plugin-po2json". */ export interface GettextPluginOptions { poFiles: string; /** * Path of the extracted POT file, relative to the build `outDir`. The file is * written to disk next to the bundle, not emitted into it, so it never shows * up in the Vite manifest. A path outside `outDir` (`../`, absolute) keeps it * out of the build output entirely. */ outFile?: string; defaultDictionary?: string; defaultLanguage?: string; headers?: POHeaders; includeFuzzy?: boolean; /** * What to do about gettext calls without a translator comment (`// #. …` * directly above the line of the call, `` in Vue templates): * `'warn'` reports them as a build warning, `'error'` fails the build. * Checks the modules the POT file is extracted from, except those in * `node_modules`. */ missingComments?: 'off' | 'warn' | 'error'; } /** * Type shape of the Vite plugin "vite-plugin-po2json". * * An intersection rather than `interface … extends Plugin`: depending on the * vite version, `Plugin` either declares its own `meta` (which a property * override would clash with) or has no `meta` at all. */ export type GettextPlugin = Plugin & { /** The resolved configuration options passed to the plugin. */ meta: Required; }; /** * Type shape of internal module metadata used by the gettext plugin. */ export interface GettextPluginModuleMeta { gettext?: { dictionary: boolean; }; } export default function gettextPlugin(options: GettextPluginOptions): [GettextPlugin, Plugin]; //# sourceMappingURL=index.d.ts.map