import type { ObjectLiteral } from "../common/ObjectLiteral";
import type { EntityManager } from "../entity-manager/EntityManager";
import type { Repository } from "./Repository";
import type { TreeRepository } from "./TreeRepository";
import type { ObjectType } from "../common/ObjectType";
import type { SelectQueryBuilder } from "../query-builder/SelectQueryBuilder";
/**
 * Provides abstract class for custom repositories that do not inherit from original orm Repository.
 * Contains all most-necessary methods to simplify code in the custom repository.
 * All methods are protected thus not exposed and it allows to create encapsulated custom repository.
 * @deprecated use Repository.extend function to create a custom repository
 */
export declare class AbstractRepository<Entity extends ObjectLiteral> {
    /**
     * Gets entity manager that allows to perform repository operations with any entity.
     */
    protected manager: EntityManager;
    /**
     * Gets the original ORM repository for the entity that is managed by this repository.
     * If current repository does not manage any entity, then exception will be thrown.
     */
    protected get repository(): Repository<Entity>;
    /**
     * Gets the original ORM tree repository for the entity that is managed by this repository.
     * If current repository does not manage any entity, then exception will be thrown.
     */
    protected get treeRepository(): TreeRepository<Entity>;
    /**
     * Creates a new query builder for the repository's entity that can be used to build a SQL query.
     * If current repository does not manage any entity, then exception will be thrown.
     * @param alias
     */
    protected createQueryBuilder(alias: string): SelectQueryBuilder<Entity>;
    /**
     * Creates a new query builder for the given entity that can be used to build a SQL query.
     * @param entity
     * @param alias
     */
    protected createQueryBuilderFor<T extends ObjectLiteral>(entity: ObjectType<T>, alias: string): SelectQueryBuilder<T>;
    /**
     * Gets the original ORM repository for the given entity class.
     * @param entity
     */
    protected getRepositoryFor<T extends ObjectLiteral>(entity: ObjectType<T>): Repository<T>;
    /**
     * Gets the original ORM tree repository for the given entity class.
     * @param entity
     */
    protected getTreeRepositoryFor<T extends ObjectLiteral>(entity: ObjectType<T>): TreeRepository<T>;
    /**
     * Gets custom repository's managed entity.
     * If given custom repository does not manage any entity then undefined will be returned.
     * @param customRepository
     */
    private getCustomRepositoryTarget;
}
