import { IObjectManager } from './IObjectManager'; import { SessionContext } from '../SessionContext'; import { ParentDirectoryDTO } from '../../../common/entities/DirectoryDTO'; /** * Base class for managers that handle projection-aware caching. * Provides common functionality for managers that need to cache data * per user projection (like AlbumManager and PersonManager). */ export declare abstract class ProjectionAwareManager implements IObjectManager { protected cache: Record; /** * Get all entities for the given session. Subclasses should implement * the actual loading logic in loadEntities(). */ getAll(session: SessionContext): Promise; invalidateCache(changedDir?: ParentDirectoryDTO): Promise; /** * Default implementation of onNewDataVersion that invalidates cache. * Subclasses can override for more specific behavior. */ onNewDataVersion(changedDir?: ParentDirectoryDTO): Promise; /** * Reset the entire memory cache */ protected resetMemoryCache(): void; /** * Abstract method that subclasses must implement to load entities * from the database with proper projection awareness */ protected abstract loadEntities(session: SessionContext): Promise; /** * Abstract method that subclasses must implement to invalidate * projection-aware cache entries in the database */ protected abstract invalidateDBCache(changedDir?: ParentDirectoryDTO): Promise; /** * Get cached entities for the given session projection */ private getCachedEntities; /** * Set cached entities for the given session projection */ private setCachedEntities; }