/** * Build-tool-agnostic CLI for message extraction. * * Thin glue around {@link extractFromSource} and {@link mergeCatalog}: it reads * source files, extracts translatable messages, merges them into an existing * catalog (preserving translations), and writes JSON. It is dependency-free and * meant to be wired into an existing build or run ad-hoc — not to become a build * tool of its own. * * Node's `fs`/`path` are imported lazily so the extract barrel stays * environment-neutral; only the CLI functions touch the filesystem. * * @module bquery/i18n */ import { type MergeResult } from './merge'; /** Minimal console-shaped sink so the CLI is testable without globals. */ export type CliIO = { log: (msg: string) => void; error: (msg: string) => void; }; /** * Expands glob patterns to a sorted, de-duplicated list of files. Plain paths * (already expanded by the shell, or with no magic characters) pass through. */ export declare const expandGlobs: (patterns: string[]) => Promise; /** Options controlling an extraction run. */ export type ExtractRunOptions = { /** Output catalog path. When omitted, the catalog is returned, not written. */ out?: string; /** Drop keys no longer present in source (default: keep them). */ prune?: boolean; }; /** Result of {@link extractFiles}. */ export type ExtractFilesResult = MergeResult & { /** Number of source files scanned. */ files: number; /** Number of distinct keys extracted from the scanned sources (added + kept). */ total: number; }; /** * Extracts messages from `files`, merges into the catalog at `options.out` * (when given), and writes the result. * * @example * ```ts * import { extractFiles } from '@bquery/bquery/i18n/extract'; * * await extractFiles(['src/cart.ts'], { out: 'locales/en.json' }); * ``` */ export declare const extractFiles: (files: string[], options?: ExtractRunOptions) => Promise; /** * Parses argv and runs an extraction. Returns a process exit code * (`0` success, `1` usage error / failure). * * Usage: `bquery-i18n extract [options] ` */ export declare const runExtractCli: (argv: string[], io?: CliIO) => Promise; //# sourceMappingURL=cli.d.ts.map