import type { PolypotSecrets } from "../config/secrets.js"; import { type OpenAIClientFactory, type OpenAITranslateBatchResult, translateOpenAIBatch } from "../providers/openai/translate.js"; import { type ExistingPoMergeSource } from "./merge-policy.js"; import { type PotDocument } from "./pot.js"; import type { TranslationLanguageStatus, TranslationRunResult } from "./results.js"; import { type LocaleFormat } from "./workload.js"; export type TranslationProgressEvent = { readonly language: string; readonly phase: "language-queued"; } | { readonly language: string; readonly outputFile: string; readonly phase: "language-started"; readonly plannedStrings: number; } | { readonly batch: number; readonly language: string; readonly phase: "batch-started"; readonly totalBatches: number; } | { readonly batch: number; readonly failedStrings: number; readonly language: string; readonly phase: "batch-failed"; readonly totalStrings: number; } | { readonly batch: number; readonly language: string; readonly phase: "batch-completed"; readonly processedStrings: number; readonly totalStrings: number; } | { readonly batch: number; readonly language: string; readonly phase: "batch-saved"; } | { readonly issues: number; readonly language: string; readonly phase: "validation-issues"; } | { readonly language: string; readonly phase: "language-completed"; readonly status: TranslationLanguageStatus; }; export interface ExecuteTranslateOptions { readonly abortOnFailure: boolean; readonly batchSize: number; readonly dictionaryPath: string; readonly document?: PotDocument; readonly dryRun: boolean; readonly forceTranslate: boolean; readonly inputPoPath?: string; readonly jobs: number; readonly localeFormat: LocaleFormat; readonly maxRetries: number; readonly maxStringsPerJob?: number; readonly maxTokens?: number; readonly maxTotalStrings?: number; readonly mergeSources?: ReadonlyMap; readonly model: string; readonly outputDir: string; readonly poFilePrefix?: string; readonly potFilePath: string; readonly promptFilePath?: string; readonly provider?: string; readonly retryDelay: number; readonly saveDebugInfo?: boolean; readonly secrets: PolypotSecrets; readonly skipLanguageOnFailure: boolean; readonly sourceLanguage: string; readonly targetLanguages: readonly string[]; readonly temperature: number; readonly timeout: number; readonly useDictionary: boolean; readonly onProgress?: (event: TranslationProgressEvent) => void; } export type TranslateBatchFunction = (options: Parameters[0], createClient?: OpenAIClientFactory) => Promise; export declare function executeTranslate(options: ExecuteTranslateOptions, translateBatch?: TranslateBatchFunction): Promise;