import { AggregateQuery, AggregateResponse } from '@ptc-org/nestjs-query-core'; import { Repository, SelectQueryBuilder } from 'typeorm'; declare enum AggregateFuncs { AVG = "AVG", SUM = "SUM", COUNT = "COUNT", MAX = "MAX", MIN = "MIN" } /** * @internal * Builds a WHERE clause from a Filter. */ export declare class AggregateBuilder { readonly repo: Repository; private readonly isPostgres; constructor(repo: Repository); static asyncConvertToAggregateResponse(responsePromise: Promise[]>): Promise[]>; static getAggregateSelects(query: AggregateQuery): string[]; private static getAggregateGroupBySelects; private static getAggregateFuncSelects; static getAggregateAlias(func: AggregateFuncs, field: keyof Entity): string; static getGroupByAlias(field: keyof Entity): string; static convertToAggregateResponse(rawAggregates: Record[]): AggregateResponse[]; /** * Builds a aggregate SELECT clause from a aggregate. * @param qb - the `typeorm` SelectQueryBuilder * @param aggregate - the aggregates to select. * @param alias - optional alias to use to qualify an identifier */ build>(qb: Qb, aggregate: AggregateQuery, alias?: string): Qb; private createAggSelect; private createGroupBySelect; private isAggregateQueryGroupByField; } export {};