/** * StorageTranslationService * * Loads translation strings from the filesystem (JSON files). * Separate from FileSystemTemplateService for Separation of Concerns: * - FileSystemTemplateService: Loads markdown templates for PDFs (invoices, receipts) * - StorageTranslationService: Loads translation strings for UI/messages (i18n) * * Translation Path Format: {locale}/{filename}.json * Example: en/storage.json, es/storage.json * * Directory structure: * ``` * translations/ * ├── en/ * │ ├── storage.json * │ └── ui.json * ├── es/ * │ ├── storage.json * │ └── ui.json * └── fr/ * ├── storage.json * └── ui.json * ``` */ import type { StorageTranslationService as StorageTranslationServiceInterface, StorageTranslationServiceConfig } from '@plyaz/types/storage'; /** * StorageTranslationService * * Loads translation strings from filesystem (JSON files) * Used for i18n of UI strings, labels, messages, etc. * * @example * ```typescript * const translationService = new StorageTranslationService({ * basePath: join(__dirname, '../translations'), * logger: myLogger * }); * * // Load English translations * const translations = await translationService.getTranslation('en/storage.json'); * const data = JSON.parse(translations); * console.log(data.upload.success); // "File uploaded successfully" * ``` */ export declare class StorageTranslationService implements StorageTranslationServiceInterface { private readonly basePath; private readonly logger?; constructor(config?: StorageTranslationServiceConfig); /** * Get translation content by path * * @param path - Translation path (locale/filename.json) * @returns Translation content (JSON string) * @throws StoragePackageError if translation file not found * * @example * ```typescript * const content = await service.getTranslation('en/storage.json'); * const translations = JSON.parse(content); * ``` */ getTranslation(path: string): Promise; /** * Check if translation file exists * * @param path - Translation path * @returns true if translation file exists * * @example * ```typescript * const exists = await service.hasTranslation('en/storage.json'); * ``` */ hasTranslation(path: string): Promise; /** * Get base path for translations */ getBasePath(): string; /** * Load and parse translation JSON * * Helper method to load and parse JSON in one call * * @param path - Translation path * @returns Parsed translation object * * @example * ```typescript * const translations = await service.loadTranslations('en/storage.json'); * console.log(translations.upload.success); * ``` */ loadTranslations(path: string): Promise>; }