interface IQueryParseOptions { defaultTop?: number; defaultSkip?: number; expandDepth?: number; selectDepth?: number; maxTop?: number; maxSkip?: number; } interface IRawSearchParams { select: string; filter: string; orderBy: string; expand: string; skip: number; top: number; apply: string; count: string; compute: string; } interface IParsedQuery { select?: SelectField[]; table: string; filter?: FilterClause | FilterCondition; orderBy?: OrderByClause[]; skip?: number; top?: number; expand?: ExpandClause[]; count?: boolean; as?: string; } interface SelectField { field: string; table: string; alias?: string; } interface OrderByClause { field: string; table: string; direction: 'asc' | 'desc'; } interface ExpandClause { table: string; select?: SelectField[]; filter?: FilterClause | FilterCondition; orderBy?: OrderByClause[]; skip?: number; top?: number; expand?: ExpandClause[]; as?: string; } interface FilterClause { logicalOperator: 'and' | 'or' | 'not'; conditions: (FilterCondition | FilterClause)[]; } interface FilterCondition { leftExpression: FilterExpression; operator: ComparisonOperator; rightExpression: FilterExpression; } interface FilterExpression { type: 'field' | 'literal' | 'function' | 'arithmetic'; field?: FieldReference; value?: any; function?: FilterFunction; arithmetic?: ArithmeticExpression; } interface FieldReference { name: string; table?: string; navigationPath?: string[]; } interface FilterFunction { name: FunctionName; args: FilterExpression[]; } interface ArithmeticExpression { operator: ArithmeticOperator; left: FilterExpression; right: FilterExpression; } type FunctionName = 'tolower' | 'toupper' | 'trim' | 'concat' | 'substring' | 'indexof' | 'length' | 'contains' | 'startswith' | 'endswith' | 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'now' | 'date' | 'time' | 'round' | 'floor' | 'ceiling' | 'cast' | 'any' | 'all' | 'count'; type ComparisonOperator = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'in' | 'has'; type ArithmeticOperator = 'add' | 'sub' | 'mul' | 'div' | 'mod'; export { ArithmeticExpression, ArithmeticOperator, ComparisonOperator, ExpandClause, FieldReference, FilterClause, FilterCondition, FilterExpression, FilterFunction, FunctionName, IParsedQuery, IQueryParseOptions, IRawSearchParams, OrderByClause, SelectField, };