ReadKeep/readeck/Domain/Protocols/POfflineCacheRepository.swift
Ilyas Hallak f5dab38038 Add offline cache infrastructure with clean architecture
Create separate cache repository layer:
- Add POfflineCacheRepository protocol for cache operations
- Add OfflineCacheRepository with CoreData and Kingfisher
- Add OfflineCacheSyncUseCase to coordinate sync workflow
- Update PBookmarksRepository to focus on API calls only
- Extend BookmarkEntityMapper with toDomain() conversion

UseCase coordinates between cache, API, and settings repositories
following dependency inversion principle.
2025-11-17 23:53:44 +01:00

25 lines
649 B
Swift

//
// POfflineCacheRepository.swift
// readeck
//
// Created by Claude on 17.11.25.
//
import Foundation
protocol POfflineCacheRepository {
// Cache operations
func cacheBookmarkWithMetadata(bookmark: Bookmark, html: String, saveImages: Bool) async throws
func hasCachedArticle(id: String) -> Bool
func getCachedArticle(id: String) -> String?
func getCachedBookmarks() async throws -> [Bookmark]
// Cache statistics
func getCachedArticlesCount() -> Int
func getCacheSize() -> String
// Cache management
func clearCache() async throws
func cleanupOldestCachedArticles(keepCount: Int) async throws
}