import { CommonFieldComparisonBetweenType, FilterComparisonOperators } from '@ptc-org/nestjs-query-core'; import { EntityMetadata, ObjectLiteral, Repository } from 'typeorm'; /** * @internal */ type CmpSQLType = { sql: string; params: ObjectLiteral; }; /** * @internal */ export type EntityComparisonField = Entity[F] | Entity[F][] | CommonFieldComparisonBetweenType | true | false | null; /** * @internal * Builder to create SQL Comparisons. (=, !=, \>, etc...) */ export declare class SQLComparisonBuilder { readonly comparisonMap: Record; readonly repo?: Repository; readonly entityMetadata: EntityMetadata | undefined; static DEFAULT_COMPARISON_MAP: Record; /** * @param comparisonMap - the comparison operators this builder understands. * @param repo - repository of the entity this builder builds comparisons for. * @param entityMetadata - metadata of the entity this builder builds comparisons for, used to * expand virtual columns into their queries. Defaults to the metadata of `repo`, and can be * supplied on its own when there is no repository for the entity, as is the case for a relation. */ constructor(comparisonMap?: Record, repo?: Repository, entityMetadata?: EntityMetadata | undefined); /** * Creates a builder for an entity that has no repository to hand, such as a relation reached * through a filter. * * @param entityMetadata - metadata of the entity the builder builds comparisons for. */ static forEntityMetadata(entityMetadata: EntityMetadata): SQLComparisonBuilder; private get paramName(); /** * Creates a valid SQL fragment with parameters. * * @param field - the property in Entity to create the comparison for. * @param cmp - the FilterComparisonOperator (eq, neq, gt, etc...) * @param val - the value to compare to * @param alias - alias for the field. */ build(field: F, cmp: FilterComparisonOperators, val: EntityComparisonField, alias?: string): CmpSQLType; private createComparisonSQL; private isComparisonSQL; private isNotComparisonSQL; private inComparisonSQL; private notInComparisonSQL; private checkNonEmptyArray; private betweenComparisonSQL; private notBetweenComparisonSQL; private isBetweenVal; private getCol; } export {};