/// <reference types="mongodb" />
import { Aggregate, Document, Model, DocumentQuery } from 'mongoose';
import { Page, PageResult } from './Page';
import { Pageable, Sort } from './Shared';
declare abstract class CRUDRepository<I, T extends Document> {
    protected model: Model<T>;
    private indexed;
    private indexedCallbacks;
    constructor(schemaModel: Model<T>);
    isIndexed(): Promise<boolean>;
    create(data: I): Promise<T>;
    save(entity: I | T): Promise<T>;
    count(query: any): Promise<number>;
    countAll(): Promise<number>;
    find(query: any, sorts?: Sort[]): Promise<T[]>;
    findPage(pageable: Pageable, query: any): Promise<Page<T>>;
    findOne(query: any): Promise<T | null>;
    findAll(sorts?: Sort[]): Promise<T[]>;
    findAllPage(pageable: Pageable): Promise<Page<T>>;
    findById(id: object | string | number): Promise<T | null>;
    findByIds(ids: object[] | string[] | number[], sorts?: Sort[], idFieldName?: string): Promise<T[]>;
    aggregate(...aggregations: object[]): Promise<any[]>;
    aggregatePage(pageable: Pageable, ...aggregations: object[]): Promise<PageResult<any>>;
    remove(entity: T): Promise<T>;
    removeAll(): Promise<{
        ok?: number | undefined;
        n?: number | undefined;
    }>;
    protected toMongooseSort(sorts: Sort[]): string;
    protected toPagination(pageable: Pageable): {
        limit: number;
        skip: number;
        sort: string;
    };
    protected createFind(query: any, sorts?: Sort[]): DocumentQuery<T[], T, {}>;
    protected createAggregate(...aggregations: any[]): Aggregate<any[]>;
}
export default CRUDRepository;
