import { Facetable } from '../services'; export declare type AstIdentifier = { type: 'IDENTIFIER'; value: string; }; export declare type AstFieldPath = { type: 'FIELD_PATH'; value: string[]; }; export declare type AstGroupExpression = { type: 'GROUP_EXPRESSION'; value: FilterAst; }; export declare type AstAllFilter = { type: 'ALL_FILTER'; target: AstIdentifier | AstFieldPath; expression: FilterAst; }; export declare type AstAnyFilter = { type: 'ANY_FILTER'; target: AstIdentifier | AstFieldPath; expression?: FilterAst; }; export declare type AstLambda = { type: 'LAMBDA'; params: [AstIdentifier]; expression: FilterAst; }; export declare type AstAndExpression = { type: 'AND_EXPRESSION'; left: FilterAst; right: FilterAst; }; export declare type AstOrExpression = { type: 'OR_EXPRESSION'; left: FilterAst; right: FilterAst; }; export declare type AstNotExpression = { type: 'NOT_EXPRESSION'; value: FilterAst; }; export declare type AstComparison = { type: 'COMPARISON'; left: FilterAst; op: 'gt' | 'lt' | 'ge' | 'le' | 'eq' | 'ne'; right: FilterAst; }; export declare type AstStringLiteral = { type: 'STRING'; value: string; }; export declare type AstDateTimeOffsetLiteral = { type: 'DATETIMEOFFSET'; value: Date; }; export declare type AstIntegerLiteral = { type: 'INTEGER'; value: number; }; export declare type AstFloatLiteral = { type: 'FLOAT'; value: number; }; export declare type AstNotANumberLiteral = { type: 'NOT_A_NUMBER'; value: number; }; export declare type AstNegativeInfinityLiteral = { type: 'NEGATIVE_INFINITY'; value: number; }; export declare type AstPositiveInfinityLiteral = { type: 'POSITIVE_INFINITY'; value: number; }; export declare type AstBooleanLiteral = { type: 'BOOLEAN'; value: boolean; }; export declare type AstNullLiteral = { type: 'NULL'; value: null; }; export declare type AstGeoPointLiteral = { type: 'GEO_POINT'; lon: number; lat: number; }; export declare type AstGeoPolygonLiteral = { type: 'GEO_POLYGON'; points: { lon: number; lat: number; }[]; }; export declare type AstFnGeoDistance = { type: 'FN_GEO_DISTANCE'; from: AstIdentifier | AstGeoPointLiteral; to: AstIdentifier | AstGeoPointLiteral; }; export declare type AstFnGeoIntersects = { type: 'FN_GEO_INTERSECTS'; point: AstIdentifier; polygon: AstGeoPolygonLiteral; }; export declare type AstFnSearchIn = { type: 'FN_SEARCH_IN'; variable: FilterAst; valueList: AstStringLiteral; } | { type: 'FN_SEARCH_IN'; variable: FilterAst; valueList: AstStringLiteral; delimiter: AstStringLiteral; }; export declare type AstFnSearchIsMatch = { type: 'FN_SEARCH_ISMATCH'; search: AstStringLiteral; } | { type: 'FN_SEARCH_ISMATCH'; search: AstStringLiteral; searchFields: AstStringLiteral; } | { type: 'FN_SEARCH_ISMATCH'; search: AstStringLiteral; searchFields: AstStringLiteral; queryType: 'full' | 'simple'; searchMode: 'any' | 'all'; }; export declare type AstFnSearchIsMatchScoring = { type: 'FN_SEARCH_ISMATCHSCORING'; search: AstStringLiteral; } | { type: 'FN_SEARCH_ISMATCHSCORING'; search: AstStringLiteral; searchFields: AstStringLiteral; } | { type: 'FN_SEARCH_ISMATCHSCORING'; search: AstStringLiteral; searchFields: AstStringLiteral; queryType: 'full' | 'simple'; searchMode: 'any' | 'all'; }; export declare type FilterAst = AstIdentifier | AstFieldPath | AstGroupExpression | AstAllFilter | AstAnyFilter | AstLambda | AstAndExpression | AstOrExpression | AstNotExpression | AstComparison | AstStringLiteral | AstDateTimeOffsetLiteral | AstIntegerLiteral | AstFloatLiteral | AstNotANumberLiteral | AstNegativeInfinityLiteral | AstPositiveInfinityLiteral | AstBooleanLiteral | AstNullLiteral | AstGeoPointLiteral | AstGeoPolygonLiteral | AstFnGeoDistance | AstFnGeoIntersects | AstFnSearchIn | AstFnSearchIsMatch | AstFnSearchIsMatchScoring; export declare type AstList = { type: 'LIST'; value: T[]; }; export declare type AstFnSearchScore = { type: 'FN_SEARCH_SCORE'; }; export declare type AstOrder = { type: 'ORDER'; target: AstIdentifier | AstFieldPath | AstFnSearchScore; direction: 'asc' | 'desc'; }; export declare type OrderByAst = AstList; export declare type AstWildcard = { type: 'WILDCARD'; }; export declare type SelectAst = AstWildcard | AstList; export declare function toPaths(ast: SelectAst): string[]; export declare type FacetParamsAst = { count: number; sort?: (left: [string, number], right: [string, number]) => -1 | 0 | 1; values?: string; interval?: string; timeoffset?: string; }; export declare type FacetResult = { params: FacetParamsAst; results: Record; }; export declare type FacetResults = Record; export declare type FacetActions = { canApply: (schema: Facetable[]) => string[]; apply: (accumulator: FacetResults, input: T) => FacetResults; }; export declare type FacetAst = { field: string; params: FacetParamsAst; }; export declare type AstQuote = { type: 'QUOTE'; value: string; }; export declare type AstWord = { type: 'WORD'; value: string; }; export declare type AstPhrase = AstQuote | AstWord; export declare type AstPartial = { type: 'PARTIAL'; value: AstPhrase; }; export declare type AstClause = AstPartial | AstPhrase; export declare type AstLogicalExpression = { type: 'EXPRESSION'; left: AstExpression; op: 'not' | 'and' | 'or'; right: AstExpression; }; export declare type AstExpression = AstLogicalExpression | AstClause; export declare type AstEmpty = { type: 'EMPTY'; }; export declare type SimpleAst = AstExpression | AstEmpty;