/** * Simplified memory cache handler */ import { EventEmitter } from '../base/event-emitter.js'; import { IAsyncHandler } from '../interfaces/handler.interface.js'; import { IAsyncRepository, IStatsProvider } from '../interfaces/repository.interface.js'; import type { TranslationData } from '../types/translation-data.types.js'; import type { TranslationContext, TranslationRequest, TranslationResult } from '../types/translation.types.js'; /** * Async storage cache handler (IndexedDB, localStorage, etc.) */ export declare class AsyncHandler implements IAsyncHandler { readonly name: string; readonly version = "1.0.0"; readonly priority: number; readonly type: "storage"; readonly enabled: boolean; private ttlMap; private ttl; private repository; private bus; constructor(eventEmitter: EventEmitter, repository: IAsyncRepository & IStatsProvider); getSourceType(): 'memory' | 'storage' | 'network' | 'fallback'; /** * Simple lookup implementation * Returns ContentUnit with both text and styles */ lookup(request: TranslationRequest): Promise; /** * Simple save implementation * Stores ContentUnit (text + styles) as JSON */ save(request: TranslationRequest, result: TranslationResult): Promise; /** * Namespace saving implementation */ saveNamespace(translations: TranslationData, context: TranslationContext): Promise; /** * ✅ Strategy 1: Direct cache lookup using unified pattern * Returns parsed ContentUnit (text + styles) or null */ private tryDirectLookup; /** * ✅ Strategy 2: Namespace lookup using unified pattern * Returns parsed ContentUnit (text + styles) or null */ private tryNamespaceLookup; /** * Helper to create consistent TranslationResult objects * Now includes styles from ContentUnit */ private createResult; /** * Check TTL and expire if needed (async version) * Returns true if expired, false if still valid */ private checkAndExpireTTL; /** * Set value in repository and update TTL (async version) */ private setWithTTL; /** * Refresh TTL on access */ private refreshTTL; /** * Get TTL information for debugging */ getTTLInfo(): Record; destroy(): Promise; getEntries(): Record | undefined; } //# sourceMappingURL=async-storage-handler.d.ts.map