import type { ObjectLiteral } from "../../common/ObjectLiteral";
import type { Driver } from "../../driver/Driver";
import type { EntityMetadata } from "../../metadata/EntityMetadata";
import type { QueryRunner } from "../../query-runner/QueryRunner";
import type { Alias } from "../Alias";
import type { QueryExpressionMap } from "../QueryExpressionMap";
import type { RelationIdLoadResult } from "../relation-id/RelationIdLoadResult";
/**
 * Transforms raw sql results returned from the database into entity object.
 * Entity is constructed based on its entity metadata.
 */
export declare class RawSqlResultsToEntityTransformer {
    protected expressionMap: QueryExpressionMap;
    protected driver: Driver;
    protected rawRelationIdResults: RelationIdLoadResult[];
    protected queryRunner?: QueryRunner | undefined;
    /**
     * Contains a hashmap for every rawRelationIdResults given.
     * In the hashmap you will find the idMaps of a result under the hash of this.hashEntityIds for the result.
     */
    private relationIdMaps;
    private pojo;
    private selections;
    private aliasCache;
    private columnsCache;
    constructor(expressionMap: QueryExpressionMap, driver: Driver, rawRelationIdResults: RelationIdLoadResult[], queryRunner?: QueryRunner | undefined);
    /**
     * Since db returns a duplicated rows of the data where accuracies of the same object can be duplicated
     * we need to group our result and we must have some unique id (primary key in our case)
     * @param rawResults
     * @param alias
     */
    transform(rawResults: any[], alias: Alias): any[];
    /**
     * Build an alias from a name and column name.
     * @param aliasName
     * @param columnName
     */
    protected buildAlias(aliasName: string, columnName: string): string;
    /**
     * Groups given raw results by ids of given alias.
     * @param rawResults
     * @param alias
     */
    protected group(rawResults: any[], alias: Alias): Map<string, any[]>;
    /**
     * Transforms set of data results into single entity.
     * @param rawResults
     * @param alias
     */
    protected transformRawResultsGroup(rawResults: any[], alias: Alias): ObjectLiteral | undefined;
    protected transformColumns(rawResults: any[], alias: Alias, entity: ObjectLiteral, metadata: EntityMetadata): boolean;
    /**
     * Transforms joined entities in the given raw results by a given alias and stores to the given (parent) entity
     * @param rawResults
     * @param entity
     * @param alias
     * @param metadata
     */
    protected transformJoins(rawResults: any[], entity: ObjectLiteral, alias: Alias, metadata: EntityMetadata): boolean;
    protected transformRelationIds(rawSqlResults: any[], alias: Alias, entity: ObjectLiteral, metadata: EntityMetadata): boolean;
    private getColumnsToProcess;
    private createValueMapFromJoinColumns;
    private extractEntityPrimaryIds;
    /** Prepare data to run #transformRelationIds, as a lot of result independent data is needed in every call */
    private prepareDataForTransformRelationIds;
    /**
     * Use a simple JSON.stringify to create a simple hash of the primary ids of an entity.
     * As this.extractEntityPrimaryIds always creates the primary id object in the same order, if the same relation is
     * given, a simple JSON.stringify should be enough to get a unique hash per entity!
     * @param relation
     * @param data
     */
    private hashEntityIds;
}
