lexica-dialog-repository
Version:
17 lines (16 loc) • 987 B
TypeScript
import { SoftDelete } from 'lexica-dialog-model/dist/Shared';
import { Document, DocumentQuery, Aggregate } from 'mongoose';
import { Page } from './Page';
import { Pageable, Sort } from './Shared';
import CRUDRepository from './CRUDRepository';
declare abstract class SoftDeleteRepository<I extends SoftDelete, T extends Document & SoftDelete> extends CRUDRepository<I, T> {
findPage(pageable: Pageable, query: any): Promise<Page<T>>;
findOne(query: any): Promise<T | null>;
findById(id: object | string | number): Promise<T | null>;
findByIds(ids: object[] | string[] | number[], sorts?: Sort[], idFieldName?: string): Promise<T[]>;
remove(entity: T, deletedBy?: string, deletedAt?: Date): Promise<T>;
removeAll(deletedBy?: string, deletedAt?: Date): Promise<any>;
protected createFind(query: any, sorts?: Sort[]): DocumentQuery<T[], T, {}>;
protected createAggregate(...aggregations: object[]): Aggregate<any[]>;
}
export default SoftDeleteRepository;