/**
 * TypeScript type definitions for Lime Query DSL
 *
 * These types represent the structure of Lime Query as defined in:
 * - lime-core/lime_query/schema.py
 * - lime-core/lime_filter/schema.py
 */
import { Expression } from '@limetech/lime-web-components';
/**
 * Lime Query structure
 * @example
 * {
 *   "#description": "High-value deals with customer info",
 *   "limetype": "deal",
 *   "responseFormat": { "object": { "name": null } }
 * }
 */
export interface LimeQuery {
    /**
     * Optional human-readable description of the query's purpose.
     * Useful for documenting what data the query retrieves, particularly
     * when passing queries to AI agents for context.
     * This field is preserved but ignored by the backend.
     */
    '#description'?: string;
    limetype: string;
    responseFormat: ResponseFormat;
    filter?: Expression;
    orderBy?: OrderByItem[];
    limit?: number;
    offset?: number;
}
export interface ResponseFormat {
    object?: PropertySelection;
    aggregates?: AggregateDefinitions;
}
/**
 * Property selection for response format object
 * Examples:
 * - { "_id": null, "name": null }
 * - { "name": {}, "value": {} } // empty objects work like null
 * - { "name": null, "company": { "name": null, "www": null } }
 * - { "dealstatus": { "_alias": "status" } }
 * - { "company": { "_alias": "org", "name": null } } // alias with nested properties
 * - { "name": { "#description": "The customer's full name" } }
 * - { "company": { "_alias": "org", "#description": "Primary company", "name": null } }
 */
export type PropertySelection = {
    [propertyName: string]: null | PropertySelection | {
        _alias?: string;
        '#description'?: string;
        [key: string]: any;
    };
};
/**
 * Aggregate definitions grouped by operation sets
 * Example:
 * {
 *   "all": {
 *     "total_value": { "op": "SUM", "key": "value" },
 *     "count": { "op": "COUNT" }
 *   }
 * }
 */
export type AggregateDefinitions = {
    [groupName: string]: {
        [fieldName: string]: AggregateOperation;
    };
};
export type AggregateOperation = AggregateOperationWithoutKey | AggregateOperationWithKey;
export interface AggregateOperationWithoutKey {
    op: 'COUNT';
}
export interface AggregateOperationWithKey {
    op: 'GROUP' | 'SUM' | 'AVG' | 'MAX' | 'MIN';
    key: string;
}
/**
 * Order by specification
 * Example: { "company.name": "ASC" }
 */
export type OrderByItem = {
    [propertyPath: string]: 'ASC' | 'DESC';
};
//# sourceMappingURL=lime-query.types.d.ts.map