import type { EventEmitter } from '../agent/EventEmitter'; import type { BaseRecord } from './BaseRecord'; import type { BaseRecordConstructor, Query, StorageService } from './StorageService'; export declare class Repository> { private storageService; private recordClass; private eventEmitter; constructor(recordClass: BaseRecordConstructor, storageService: StorageService, eventEmitter: EventEmitter); /** @inheritDoc {StorageService#save} */ save(record: T): Promise; /** @inheritDoc {StorageService#update} */ update(record: T): Promise; /** @inheritDoc {StorageService#delete} */ delete(record: T): Promise; /** @inheritDoc {StorageService#getById} */ getById(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(id: string): Promise; /** @inheritDoc {StorageService#getAll} */ getAll(): Promise; /** @inheritDoc {StorageService#findByQuery} */ findByQuery(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(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(query: Query): Promise; }