UNPKG

wizard-ql

Version:

WizardQL is a natural-language-like query language for constructing data queries for resources that meet conditions.

16 lines (15 loc) 721 B
import type { ComparisonOperation, Expression, ComparisonTypeToTSType } from './spec'; export interface AggregationValue<O extends ComparisonOperation = ComparisonOperation> { /** The value being checked */ value: ComparisonTypeToTSType<O>; /** The operator being used */ operation: O; /** Is this an exclusionary operator? (Ex: NOT, NOTIN) */ exclusionary: boolean; } /** * Summarize a parsed expression by aggregating its queries by field * @param expressions The expression or expressions to aggregate * @returns The aggregation as a map, mapping field name to queries */ export declare function summarize(expressions: Expression | Expression[]): Map<string, AggregationValue[]>;