import * as sqlite3 from 'sqlite3'; import { Dimension } from '../core/multi-db-manager'; /** * Base repository interface for all dimension repositories. * Provides common CRUD operations. */ export interface BaseRepository { /** * Gets the dimension this repository handles. */ getDimension(): Dimension; /** * Creates a new entity. * * @param entity The entity to create * @returns Promise that resolves to the created entity */ create(entity: T): Promise; /** * Gets an entity by ID. * * @param id The entity ID * @param pluginId The plugin ID * @returns Promise that resolves to the entity, or null if not found */ getById(id: string, pluginId: string): Promise; /** * Updates an existing entity. * * @param entity The entity to update * @returns Promise that resolves to the updated entity */ update(entity: T): Promise; /** * Deletes an entity by ID (soft delete if supported). * * @param id The entity ID * @param pluginId The plugin ID * @returns Promise that resolves when the entity is deleted */ delete(id: string, pluginId: string): Promise; /** * Gets all entities for a plugin. * * @param pluginId The plugin ID * @returns Promise that resolves to an array of entities */ getAll(pluginId: string): Promise; /** * Checks if an entity exists. * * @param id The entity ID * @param pluginId The plugin ID * @returns Promise that resolves to true if the entity exists */ exists(id: string, pluginId: string): Promise; } /** * Base implementation helper for repositories. * Provides common database access patterns. */ export declare abstract class BaseRepositoryImpl implements BaseRepository { protected db: sqlite3.Database; protected dimension: Dimension; constructor(db: sqlite3.Database, dimension: Dimension); getDimension(): Dimension; /** * Executes a query and returns a single row. */ protected queryOne(sql: string, params?: any[]): Promise; /** * Executes a query and returns multiple rows. */ protected queryAll(sql: string, params?: any[]): Promise; /** * Executes an INSERT, UPDATE, or DELETE statement. */ protected execute(sql: string, params?: any[]): Promise; abstract create(entity: T): Promise; abstract getById(id: string, pluginId: string): Promise; abstract update(entity: T): Promise; abstract delete(id: string, pluginId: string): Promise; abstract getAll(pluginId: string): Promise; abstract exists(id: string, pluginId: string): Promise; } //# sourceMappingURL=base-repository.d.ts.map