/** * 浏览器适配器实现 - localStorage + 降级功能 * * 支持框架逻辑中的"纯静态网站"场景 * 使用 localStorage 作为 .ui18n 目录的浏览器等价物 * 安全限制:不支持大模型API密钥直接存储 */ import { StorageAdapter, SecurityAdapter, PerformanceAdapter, NetworkAdapter, UI18nAdapters, PerformanceReport, MemoryUsage, SystemInfo, RequestOptions, TranslationResult } from './types'; /** * 浏览器存储适配器 - localStorage模拟.ui18n目录 */ export declare class BrowserStorageAdapter implements StorageAdapter { private readonly STORAGE_PREFIX; private readonly LOCALES_KEY; private readonly CONFIG_KEY; ensureUI18nDirectory(basePath?: string): Promise; readTranslationFile(language: string, basePath?: string): Promise | null>; writeTranslationFile(language: string, data: Record, basePath?: string): Promise; listAvailableLanguages(basePath?: string): Promise; readConfig(basePath?: string): Promise | null>; writeConfig(config: Record, basePath?: string): Promise; private updateAvailableLanguagesList; private cleanupOldTranslations; } /** * 浏览器安全适配器 - 受限的安全功能 */ export declare class BrowserSecurityAdapter implements SecurityAdapter { storeApiKey(key: string, provider: string): Promise; getApiKey(provider: string): Promise; encryptData(data: string): Promise; decryptData(encryptedData: string): Promise; generateChecksum(data: string): Promise; verifyChecksum(data: string, checksum: string): Promise; private simpleHash; } /** * 浏览器性能适配器 - Performance API */ export declare class BrowserPerformanceAdapter implements PerformanceAdapter { private sessions; startProfiling(sessionId: string): Promise; endProfiling(sessionId: string): Promise; recordMetric(name: string, value: number, tags?: Record): Promise; getMemoryUsage(): Promise; getSystemInfo(): Promise; private generateBrowserRecommendations; } /** * 浏览器网络适配器 - Fetch API */ export declare class BrowserNetworkAdapter implements NetworkAdapter { request(options: RequestOptions): Promise; translateWithAI(text: string, fromLang: string, toLang: string, apiKey: string): Promise; checkNetworkHealth(): Promise; private callUI18nCloudAPI; } /** * 浏览器适配器工厂 */ export declare function createBrowserAdapters(): UI18nAdapters; //# sourceMappingURL=browser.d.ts.map