import type { Dictionary, EntityMetadata, EntityName, EntityProperty, FilterDef, FilterQuery } from '../typings.js';
import { type QueryOrderMap } from '../enums.js';
import type { Platform } from '../platforms/Platform.js';
import type { MetadataStorage } from '../metadata/MetadataStorage.js';
import type { FilterOptions } from '../drivers/IDatabaseDriver.js';
/** @internal */
export declare class QueryHelper {
  static readonly SUPPORTED_OPERATORS: string[];
  /**
   * Finds the discriminator value (key) for a given entity class in a discriminator map.
   */
  static findDiscriminatorValue<T>(discriminatorMap: Dictionary<T>, targetClass: T): string | undefined;
  static processParams(params: unknown): any;
  static processObjectParams<T extends Dictionary>(params?: T): T;
  /**
   * converts `{ account: { $or: [ [Object], [Object] ] } }`
   * to `{ $or: [ { account: [Object] }, { account: [Object] } ] }`
   */
  static liftGroupOperators<T extends object>(
    where: Dictionary,
    meta: EntityMetadata<T>,
    metadata: MetadataStorage,
    key?: string,
  ): string | undefined;
  static inlinePrimaryKeyObjects<T extends object>(
    where: Dictionary,
    meta: EntityMetadata<T>,
    metadata: MetadataStorage,
    key?: string,
  ): boolean;
  static processWhere<T extends object>(options: ProcessWhereOptions<T>): FilterQuery<T>;
  static getActiveFilters<T>(
    meta: EntityMetadata<T>,
    options: FilterOptions | undefined,
    filters: Dictionary<FilterDef>,
  ): FilterDef[];
  static mergePropertyFilters(
    propFilters: FilterOptions | undefined,
    options: FilterOptions | undefined,
  ): FilterOptions | undefined;
  static isFilterActive<T>(
    meta: EntityMetadata<T>,
    filterName: string,
    filter: FilterDef,
    options: Dictionary<boolean | Dictionary>,
  ): boolean;
  static processCustomType<T extends object>(
    prop: EntityProperty<T>,
    cond: FilterQuery<T>,
    platform: Platform,
    key?: string,
    fromQuery?: boolean,
  ): FilterQuery<T>;
  private static isSupportedOperator;
  private static processJsonCondition;
  static findProperty<T>(fieldName: string, options: ProcessWhereOptions<T>): EntityProperty<T> | undefined;
  /**
   * Converts entity references for composite FK properties into flat arrays
   * of correctly-ordered join column values, before processParams flattens them
   * incorrectly due to shared FK columns.
   */
  private static convertCompositeEntityRefs;
  /**
   * Extracts values for a FK's join columns from an entity by traversing the FK chain.
   * Handles shared FK columns (e.g., tenant_id referenced by multiple FKs) correctly.
   */
  private static extractJoinColumnValues;
  /**
   * Extracts the value for a specific column from an entity by finding which PK property
   * owns that column and recursively traversing FK references.
   */
  private static extractColumnValue;
  /**
   * Merges multiple orderBy sources with key-level deduplication (first-seen key wins).
   * RawQueryFragment symbol keys are never deduped (each is unique).
   */
  static mergeOrderBy<T>(...sources: (QueryOrderMap<T> | QueryOrderMap<T>[] | undefined)[]): QueryOrderMap<T>[];
}
interface ProcessWhereOptions<T> {
  where: FilterQuery<T>;
  entityName: EntityName<T>;
  metadata: MetadataStorage;
  platform: Platform;
  aliased?: boolean;
  aliasMap?: Dictionary<EntityName>;
  convertCustomTypes?: boolean;
  root?: boolean;
  type?: 'where' | 'orderBy';
}
export {};
