import { Model } from "mongoose"; export declare class AbstractPersistenceService { model: Model; populateFields: string[]; /** * Creates a new instance of a persistence service. * @param _model the model. * @param _populateFields the fields to perform populate the base queries. */ constructor(model: Model, populateFields: string[]); /** * Retrieves a list of based in the query filter. * @param filter the filer. */ list(filter?: any): Promise; /** * Retrievers a single object. * @param id the object id. */ getById(id: any): Promise; /** * Retrievers a single object. * @param filter the query filter. */ getOne(filter?: any): Promise; /** * Saves and returns the saved instance of the ${Type}. * @param record the record. */ save(record: Type): Promise; /** * Updates and returns the saved instance of the ${Type}. * @param record the record. */ updateById(id: any, update: any): Promise; /** * Updates and returns the saved instance of the ${Type}. * @param filter the update filter. * @param record the record. */ updateBy(filter: any, update: any): Promise; /** * Removes a ${Type} from the database and returns its instance. * @param id the record id; */ remove(id: any): Promise; /** * Populate queries with all the model's fields required. * @param query the query * @private */ private populateQueryFields; }