import type { BaseRecord } from './BaseRecord'; import type { BaseRecordConstructor, Query, StorageService } from './StorageService'; import type { AgentContext } from '../agent'; import type { EventEmitter } from '../agent/EventEmitter'; export declare class Repository> { private storageService; private recordClass; private eventEmitter; constructor(recordClass: BaseRecordConstructor, storageService: StorageService, eventEmitter: EventEmitter); /** @inheritDoc {StorageService#save} */ save(agentContext: AgentContext, record: T): Promise; /** @inheritDoc {StorageService#update} */ update(agentContext: AgentContext, record: T): Promise; /** @inheritDoc {StorageService#delete} */ delete(agentContext: AgentContext, record: T): Promise; /** * Delete record by id. Throws {RecordNotFoundError} if no record is found * @param id the id of the record to delete * @returns */ deleteById(agentContext: AgentContext, id: string): Promise; /** @inheritDoc {StorageService#getById} */ getById(agentContext: AgentContext, id: string): Promise; /** * Find record by id. Returns null if no record is found * @param id the id of the record to retrieve * @returns */ findById(agentContext: AgentContext, id: string): Promise; /** @inheritDoc {StorageService#getAll} */ getAll(agentContext: AgentContext): Promise; /** @inheritDoc {StorageService#findByQuery} */ findByQuery(agentContext: AgentContext, query: Query): Promise; /** * Find a single record by query. Returns null if not found. * @param query the query * @returns the record, or null if not found * @throws {RecordDuplicateError} if multiple records are found for the given query */ findSingleByQuery(agentContext: AgentContext, query: Query): Promise; /** * Find a single record by query. Throws if not found * @param query the query * @returns the record * @throws {RecordDuplicateError} if multiple records are found for the given query * @throws {RecordNotFoundError} if no record is found for the given query */ getSingleByQuery(agentContext: AgentContext, query: Query): Promise; }