@memory-bank/mcp
Version:
Memory-enabled Co-Pilot (MCP) server for managing project documentation and context
94 lines • 3.03 kB
TypeScript
import { II18nRepository } from '../../domain/i18n/II18nRepository.js';
import { Language } from '../../domain/i18n/Language.js';
import { Translation, TranslationKey } from '../../domain/i18n/Translation.js';
/**
* File-based implementation of I18n Repository
*/
export declare class FileI18nRepository implements II18nRepository {
private readonly componentLogger;
private readonly basePath;
private translationCache;
private cacheDirty;
/**
* Constructor
*
* @param basePath Base path for storing translation files
*/
constructor(basePath: string);
/**
* Initialize the repository
*
* @returns Promise resolving when initialization is complete
*/
initialize(): Promise<void>;
/**
* Gets a translation for a specific key and language
*
* @param key Translation key
* @param language Language to get translation for
* @returns Promise resolving to Translation or null if not found
*/
getTranslation(key: TranslationKey, language: Language): Promise<Translation | null>;
/**
* Gets translations for a key in all supported languages
*
* @param key Translation key
* @returns Promise resolving to array of Translation objects
*/
getTranslationsForKey(key: TranslationKey): Promise<Translation[]>;
/**
* Gets all translations for a specific language
*
* @param language Language to get translations for
* @returns Promise resolving to array of Translation objects
*/
getTranslationsForLanguage(language: Language): Promise<Translation[]>;
/**
* Saves a translation (creates or updates)
*
* @param translation Translation to save
* @returns Promise resolving to boolean indicating success
*/
saveTranslation(translation: Translation): Promise<boolean>;
/**
* Checks if a translation exists for a specific key and language
*
* @param key Translation key
* @param language Language to check
* @returns Promise resolving to boolean indicating if translation exists
*/
hasTranslation(key: TranslationKey, language: Language): Promise<boolean>;
/**
* Gets a list of all translation keys
*
* @returns Promise resolving to array of translation keys
*/
getAllKeys(): Promise<TranslationKey[]>;
/**
* Gets a list of all supported languages
*
* @returns Promise resolving to array of Language objects
*/
getSupportedLanguages(): Promise<Language[]>;
/**
* Loads all translations into cache
*
* @private
*/
private loadAllTranslations;
/**
* Loads translations for a specific language
*
* @param langCode Language code
* @private
*/
private loadTranslationsForLanguage;
/**
* Saves translations for a specific language
*
* @param language Language
* @private
*/
private saveTranslationsForLanguage;
}
//# sourceMappingURL=FileI18nRepository.d.ts.map