import { DOMAINS, MODULES } from '../DomainInfo'; import { SearchFilterValueType } from './Search'; export declare type TSearchAggregationTypes = 'MATCH' | 'LOOKUP' | 'ADDFIELD'; export interface ISearchAggregationBase { type: TSearchAggregationTypes; } export interface ISearchAggregationMatch extends ISearchAggregationBase { type: 'MATCH'; query: ISearchAggregationFilter[]; } export interface ISearchAggregationVariableTrue { value: string; variable: true; } export interface ISearchAggregationVariableFalse { variable?: false; } export declare type SearchAggregationValueType = SearchFilterValueType & (ISearchAggregationVariableTrue | ISearchAggregationVariableFalse); export interface ISearchAggregationFilter { /** * The name of the field from the associated data structure */ field_name: string; /** * An object that determines how the data structure's field will be filtered */ field_value: SearchAggregationValueType; } export interface ISearchAggregationLookup extends ISearchAggregationBase { type: 'LOOKUP'; query: ISearchAggregationFilter[]; domain: DOMAINS; module: MODULES; name: string; let?: string[]; } export declare type AggrigationAddFieldOperationTypes = 'FROM_VALUE'; export declare type AggrigationAddFieldOperationFromValue = { type: 'FROM_VALUE'; key: string; }; export declare type AggrigationAddFieldOperation = { type: AggrigationAddFieldOperationTypes; } & AggrigationAddFieldOperationFromValue; export interface ISearchAggregationAddField extends ISearchAggregationBase { type: 'ADDFIELD'; name: string; operation: AggrigationAddFieldOperation; pickFirst?: boolean; } export declare type SearchAggregation = ISearchAggregationBase & (ISearchAggregationMatch | ISearchAggregationLookup | ISearchAggregationAddField); export interface ISearchAggregationDTO { search: SearchAggregation[]; }