import { BaseProcessor, ProcessorOptions, ExtractStringsResult, TranslatedString, SourceString } from '../core/baseProcessor'; import { AACTree } from '../core/treeStructure'; import { ValidationResult } from '../validation/validationTypes'; import { type ButtonForTranslation, type LLMLTranslationResult } from '../utilities/translation/translationProcessor'; import { ProcessorInput } from '../utils/io'; declare class ObfProcessor extends BaseProcessor { readonly capabilities: { wordList: "none"; preservesAssetsOnSave: boolean; newCellCreation: "allowed"; }; private zipFile?; private imageCache; constructor(options?: ProcessorOptions); /** * Extract an image from the ZIP file as a Buffer */ private extractImageAsBuffer; /** * Extract an image from the ZIP file and convert to data URL */ private extractImageAsDataUrl; private getMimeTypeFromFilename; private getPageFilename; private processBoard; extractTexts(filePathOrBuffer: ProcessorInput): Promise; loadIntoTree(filePathOrBuffer: ProcessorInput): Promise; private buildGridMetadata; /** * Apply mutations to a buttons array for OBF export * Returns a modified copy of the buttons array with mutations applied * * Note: addButton mutations are NOT applied because the button is already * in the buttons array (added by page.addButton()). We only apply * removeButton and updateButton mutations. */ private applyMutationsToButtons; private createObfBoardFromPage; processTexts(filePathOrBuffer: ProcessorInput, translations: Map, outputPath: string): Promise; saveFromTree(tree: AACTree, outputPath: string, embedData?: boolean): Promise; /** * Save a modified tree while preserving all original files (images, sounds, assets) * This method only updates the .obf files for pages in the tree, keeping everything else intact. * * @param originalPath - Path to the original OBF/OBZ file * @param tree - Modified AACTree with pages to save * @param outputPath - Path where the modified file should be saved */ saveModifiedTree(originalPath: string, tree: AACTree, outputPath: string): Promise; /** * Extract strings with metadata for aac-tools-platform compatibility * Uses the generic implementation from BaseProcessor */ extractStringsWithMetadata(filePath: string): Promise; /** * Generate translated download for aac-tools-platform compatibility * Uses the generic implementation from BaseProcessor */ generateTranslatedDownload(filePath: string, translatedStrings: TranslatedString[], sourceStrings: SourceString[]): Promise; /** * Validate OBF/OBZ file format * @param filePath - Path to the file to validate * @returns Promise with validation result */ validate(filePath: string): Promise; /** * Extract symbol information from an OBF/OBZ file for LLM-based translation. * Returns a structured format showing which buttons have symbols and their context. * * This method uses shared translation utilities that work across all AAC formats. * * @param filePathOrBuffer - Path to OBF/OBZ file or buffer * @returns Promise resolving to symbol information for LLM processing */ extractSymbolsForLLM(filePathOrBuffer: ProcessorInput): Promise; /** * Apply LLM translations with symbol information. * The LLM should provide translations with symbol attachments in the correct positions. * * This method uses shared translation utilities that work across all AAC formats. * * @param filePathOrBuffer - Path to OBF/OBZ file or buffer * @param llmTranslations - Array of LLM translations with symbol info * @param outputPath - Where to save the translated OBF/OBZ file * @param options - Translation options (e.g., allowPartial for testing) * @returns Promise resolving to a buffer of the translated OBF/OBZ file */ processLLMTranslations(filePathOrBuffer: ProcessorInput, llmTranslations: LLMLTranslationResult[], outputPath: string, options?: { allowPartial?: boolean; }): Promise; private getObfValidator; } export { ObfProcessor };