import { EventEmitter, OnInit } from '@angular/core'; import { FormArray, FormBuilder, FormGroup } from '@angular/forms'; import * as i0 from "@angular/core"; export interface QueryField { key: string; label: string; type: string; options?: { label: string; value: any; }[]; operators?: string[]; defaultOperator?: string; } export interface QueryOperator { value: string; label: string; types?: string[]; } export interface QueryConfig { fields: QueryField[]; operators: QueryOperator[]; defaultCondition?: 'and' | 'or'; } export interface QueryRule { field: string; operator: string; value: any; condition?: 'and' | 'or'; } export interface QueryGroup { condition: 'and' | 'or'; rules: (QueryRule | QueryGroup)[]; } export declare class QueryBuilderComponent implements OnInit { private fb; config: QueryConfig; queryChange: EventEmitter; form: FormGroup; model: QueryGroup; constructor(fb: FormBuilder); ngOnInit(): void; get rulesArray(): FormArray; initializeForm(): void; addRule(): void; removeRule(index: number): void; getFieldByKey(key: string): QueryField | undefined; getOperatorsForType(type: string): QueryOperator[]; getOperatorsForField(fieldKey: string): QueryOperator[]; getFieldType(fieldKey: string): string; isOperatorBetween(index: number): boolean; getFieldOptions(fieldKey: string): { label: string; value: any; }[]; onFieldChange(index: number, fieldKey: string): void; onOperatorChange(index: number, operator: string, fieldKey: string): void; /** * Gets the minimum allowed date for the end date picker based on the selected start date * @param index The index of the rule row * @returns The minimum date for the end date picker (the start date or today if no start date) */ getMinEndDate(index: number): Date | null; /** * Handles changes to the start date * @param index The index of the rule row * @param event The date change event */ onStartDateChange(index: number, event: any): void; updateFormControlsForOperator(index: number, operator: string, fieldType: string): void; transformFormToModel(formValue: any): QueryGroup; /** * Gets the condition for a specific row * @param index The index of the row * @returns The condition (and/or) for the row */ getRowCondition(index: number): 'and' | 'or'; /** * Sets the condition for a specific row * @param index The index of the row * @param condition The condition to set (and/or) */ setRowCondition(index: number, condition: 'and' | 'or'): void; toggleCondition(): void; getConditionLabel(): string; resetQuery(): void; applyQuery(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }