/** * Simplified API handler - no automatic namespace loading * Namespace loading is now explicit via builder configuration */ import { EventEmitter } from '../base/event-emitter.js'; import { PreloadNamespaces } from '../config'; import { IAsyncHandler } from '../interfaces/handler.interface.js'; import { IAsyncRepository } from '../interfaces/repository.interface.js'; import type { NamespaceResult, TranslationRequest, TranslationResult } from '../types/translation.types.js'; /** * Simple API handler - only loads individual keys * Namespace loading is handled explicitly by builder */ export declare class NetworkHandler implements IAsyncHandler { repository: IAsyncRepository; readonly name: string; readonly priority: number; readonly version = "1.0.0"; readonly type: "network"; readonly enabled: boolean; private bus; private retryCount; private retryDelay; constructor(eventEmitter: EventEmitter, repository: IAsyncRepository); initialize(): Promise; getSourceType(): 'memory' | 'storage' | 'network' | 'fallback'; /** * ✅ Lookup translation with full error handling * Strategy: Key first, namespace as fallback * Returns TranslationResult with status, source, duration, styles, and optional error */ lookup(request: TranslationRequest): Promise; /** * Strategy 2: Namespace fallback when individual key not found */ private lookupFromNamespace; /** * ✅ Load entire namespace (used for preloading) * Returns NamespaceResult with status and error information */ loadNamespace(locale: string, namespace: string): Promise; /** * ✅ Namespace lookup with retry logic * Throws custom errors (TranslationNotFoundError, TranslationLockedError, etc.) */ private loadNamespaceWithRetry; /** * Simple save implementation (API usually doesn't save) */ save(request: TranslationRequest, result: TranslationResult): Promise; /** * ✅ Lookup with retry logic for individual keys * Throws custom errors (TranslationNotFoundError, TranslationLockedError, etc.) */ private lookupWithRetry; /** * ✅ Lookup ContentUnit with retry logic for individual keys * Returns full ContentUnit with text and styles * Throws custom errors (TranslationNotFoundError, TranslationLockedError, etc.) */ private lookupContentUnitWithRetry; /** * Delay utility for retries */ private delay; private calculateBackoff; /** * Generic retry wrapper for repository operations * Handles retryable errors with exponential backoff */ private withRetry; /** * Handle translation not found (after namespace fallback also failed) */ private handleTranslationNotFound; /** * Handle TranslationLockedError for translation lookups */ private handleTranslationLocked; /** * Helper to create consistent TranslationResult objects */ private createTranslationResult; /** * Helper to create consistent NamespaceResult objects */ private createNamespaceResult; getPreload(): Array; /** * The host this handler talks to. Exposed so a failure can NAME it: "the * server is unreachable" is not actionable, and a default pointing at a dead * host is exactly the case where the reader needs to be told which host. */ getBaseUrl(): string; } //# sourceMappingURL=network-handler.d.ts.map