import { MemoryRepositoryConfig, NetworkRepositoryConfig, StorageRepositoryConfig } from '../config'; import type { TranslationData } from '../types/translation-data.types.js'; /** * Simplified repository interface for translation storage * Pure data access layer - no business logic * * Methods throw errors for type-safe exception handling: * - TranslationNotFoundError (404): Translation doesn't exist * - TranslationLockedError (423): Translation exists but not ready * - ServerError (5xx): Server-side error * - NetworkError: Network timeout, DNS failure, CORS, etc. */ export interface IAsyncRepository { readonly type: 'storage' | 'network'; readonly name: string; readonly config: Config; /** * Get translation value by key * @throws {TranslationNotFoundError} When translation doesn't exist (404) * @throws {TranslationLockedError} When translation is locked/not ready (423) * @throws {ServerError} When server returns 5xx error * @throws {NetworkError} When network request fails * @returns Translation value (never null - throws on error) */ get(key: string): Promise; set(key: string, value: string): Promise; remove(key: string): Promise; clear(): Promise; /** * Get entire namespace * @throws {TranslationNotFoundError} When namespace doesn't exist (404) * @throws {TranslationLockedError} When namespace is locked/not ready (423) * @throws {ServerError} When server returns 5xx error * @throws {NetworkError} When network request fails * @returns Translation data (never null - throws on error) */ getNamespace(locale: string, namespace: string): Promise; setNamespace(locale: string, namespace: string, translations: TranslationData): Promise; getConfig(): Config; } export interface ISyncRepository { readonly type: 'memory'; readonly name: string; readonly config: Config; get(key: string): string | null; set(key: string, value: string): void; remove(key: string): void; clear(): void; getNamespace(locale: string, namespace: string): TranslationData | null; setNamespace(locale: string, namespace: string, translations: TranslationData): void; getConfig(): Config; } export interface IStatsProvider { getEntries?(): Record; } //# sourceMappingURL=repository.interface.d.ts.map