import { AndOrExpression, Expression, Operator } from '@limetech/lime-web-components';
/**
 * Result of updating a child expression in a group
 */
export interface UpdateChildExpressionResult {
    /**
     * Type of update that occurred:
     * - 'updated': Child was updated, group continues to exist
     * - 'removed': Last child was deleted, group should be removed
     * - 'unwrapped': One child remains, should unwrap to that child
     */
    type: 'updated' | 'removed' | 'unwrapped';
    /**
     * The resulting expression:
     * - For 'updated': The updated group
     * - For 'removed': undefined
     * - For 'unwrapped': The single remaining child
     */
    expression?: Expression;
}
/**
 * Get the subheading text for a filter group based on its operator and expression count
 *
 * @param operator - The group's operator (AND or OR)
 * @param expressionCount - Number of child expressions
 * @returns Subheading text, or empty string if 0 or 1 expressions
 */
export declare function getFilterGroupSubheading(operator: Operator.AND | Operator.OR, expressionCount: number): string;
/**
 * Create a new empty comparison expression
 *
 * @returns A new comparison expression with empty key and value
 */
export declare function createEmptyComparison(): Expression;
/**
 * Create a new nested group with the opposite operator from the parent
 *
 * @param parentOperator - The parent group's operator
 * @returns A new group with the opposite operator and one empty comparison
 */
export declare function createNestedGroup(parentOperator: Operator.AND | Operator.OR): AndOrExpression;
/**
 * Add a new expression to a group immutably
 *
 * @param group - The existing group
 * @param newExpression - The expression to add
 * @returns A new group with the expression added to the end
 */
export declare function addExpressionToGroup(group: AndOrExpression, newExpression: Expression): AndOrExpression;
/**
 * Toggle a group's operator between AND and OR
 *
 * @param group - The group to toggle
 * @returns A new group with the toggled operator
 */
export declare function toggleGroupOperator(group: AndOrExpression): AndOrExpression;
/**
 * Update a child expression in a group, handling deletion and unwrapping
 *
 * This function handles three scenarios:
 * 1. Update: Replace a child expression with a new one
 * 2. Delete: Remove a child (when updatedChild is undefined)
 *    - If last child is deleted, return 'removed' (group should be deleted)
 *    - If deletion leaves one child, return 'unwrapped' (unwrap to that child)
 *    - Otherwise, return 'updated' with the remaining children
 *
 * @param group - The group containing the child
 * @param childIndex - Index of the child to update
 * @param updatedChild - The new child expression, or undefined to delete
 * @returns Result object with type and resulting expression
 */
export declare function updateChildExpression(group: AndOrExpression, childIndex: number, updatedChild: Expression | undefined): UpdateChildExpressionResult;
//# sourceMappingURL=filter-group-logic.d.ts.map