import { type ParsedContent, type DocumentSection } from "./utils/markdown-parser"; interface TranslationOptions { model?: string; maxTokens?: number; projectRoot?: string; } interface TranslationChunk extends DocumentSection { index?: number; } export declare class DocumentTranslator { private openai; private apiConfig; private translationCache; private projectRoot; constructor(options?: TranslationOptions); /** * Translate entire document */ translateDocument(filePath: string, targetLang: string): Promise; /** * Translate single text chunk */ translateChunk(chunk: TranslationChunk, targetLang: string, index: number): Promise; /** * Build system prompt */ buildSystemPrompt(targetLang: string): string; /** * Build translation prompt */ buildTranslationPrompt(content: string, targetLang: string): string; /** * Call translation API (using OpenAI SDK) with retry mechanism */ callTranslationAPI(prompt: string, targetLang: string, retryCount?: number): Promise; /** * Segment document content into translatable chunks - by heading strategy */ segmentContent(parsedContent: ParsedContent): TranslationChunk[]; /** * Merge small chunks to reduce API call count */ private mergeSmallChunks; /** * Batch translate all documents in directory */ translateDirectory(sourceDir: string, targetDir: string, targetLang: string): Promise; } export default DocumentTranslator;