import { Params } from '../../../results-driver/src/types';
import { DataSet } from '../DataSet/types';
import { Query, RecursiveHavingFilter } from '../Query/types';
import { QueryAttributes } from '../QueryAttributes/types';
import { QueryEngineConfig } from '../QueryEngineConfig/types';
import { VariableList } from '../Variables/types';
export declare const addAndFilters: (filter: QueryAttributes['filter'], filterToAddToAll: QueryAttributes.Filter[][]) => QueryAttributes['filter'];
export declare const convertArrayFilterStructureToQueryFilter: (arrayFilterStructure: QueryAttributes.Filter[][], variables: VariableList) => Query['filter'];
export declare const combineQueryFilters: (filter: Query['filter'], filterToAddToAll: Query['filter']) => Query['filter'];
/**
 * Iterates through a query filter and, for each custom metric field, builds a custom metric.
 */
export declare function buildQueryCustomMetrics(filter: Query['filter'], dataSet: DataSet, queryEngineConfig: QueryEngineConfig, params: Params): Query['filter'];
export declare function getFieldFromFilter(filter: Query['filter']): {
    type: "number";
    value: number;
    as?: string | undefined;
} | {
    type: "string";
    value: string;
    as?: string | undefined;
} | {
    type: "boolean";
    value: boolean | null;
    as?: string | undefined;
} | {
    type: "field";
    value: string;
    function: string;
    as?: string | undefined;
} | {
    type: "switchField";
    value: {
        cases: import("@vizzly/sqlbuilder-public/dist/Query/types").QueryNameSpace.Cases<string>[];
    };
    as?: string | undefined;
} | {
    type: "subquery";
    value: import("@vizzly/sqlbuilder-public").SubQuery<string, string, import("../CustomField/types").MathOperator, import("@vizzly/sqlbuilder-public").RecursiveFilter>;
    as?: string | undefined;
} | {
    type: "function";
    function: string;
    value: import("@vizzly/sqlbuilder-public/dist/Query/types").QueryNameSpace.FieldDefinition<string, string, import("../CustomField/types").MathOperator, import("@vizzly/sqlbuilder-public").RecursiveFilter>;
    as?: string | undefined;
} | null;
export declare const takeUsedFields: (filter: QueryAttributes['filter']) => string[];
export declare const isAvailable: (filter?: QueryAttributes.Filter[][] | undefined) => boolean | undefined;
export declare const isAdditionalFilter: (value: any) => boolean;
/** Returns true if a filter targets an aggregate function (sum, count, etc.) */
export declare const isAggregateFilter: (filter: QueryAttributes.Filter) => boolean;
/** Split an array of filters into WHERE (row-level) and HAVING (aggregate-level) filters. */
export declare const splitFiltersByAggregate: (filters: QueryAttributes.Filter[][]) => {
    whereFilters: QueryAttributes.Filter[][];
    havingFilters: QueryAttributes.Filter[][];
};
/** Returns true if a filter set contains OR groups (outer array length > 1). */
export declare const hasOrFilters: (filters: QueryAttributes.Filter[][]) => boolean;
/** Returns true if any filter in the set targets an aggregate function. */
export declare const hasAggregateFilters: (filters: QueryAttributes.Filter[][]) => boolean;
/** Returns true if any non-aggregate filter exists in the set. */
export declare const hasNonAggregateFilters: (filters: QueryAttributes.Filter[][]) => boolean;
/**
 * Returns true when OR groups mix aggregated and non-aggregated filters.
 * This is invalid because aggregated filters become HAVING clauses and
 * non-aggregated filters become WHERE clauses — they cannot be OR'd together.
 */
export declare const hasMixedAggregateOrFilters: (filters: QueryAttributes.Filter[][]) => boolean;
/** Removes filters that target an aggregate function, keeping only non-aggregated filters. */
export declare const removeAggregateFilters: (filters: QueryAttributes.Filter[][]) => QueryAttributes.Filter[][];
/** Collapses OR groups into a single AND group (keeps only the first OR group). */
export declare const collapseOrFilters: (filters: QueryAttributes.Filter[][]) => QueryAttributes.Filter[][];
export declare const convertArrayFilterStructureToQueryHaving: (arrayFilterStructure: QueryAttributes.Filter[][], variables: VariableList) => RecursiveHavingFilter | undefined;
