import { ComplexQueryExpression } from '../api/ComplexQueryLang.js'; import { ComplexQueryOptions, ASTNode, AST, Walker } from '../ComplexQuery.js'; import '@arcgis/core/geometry/Geometry'; /** * Options extended by a 'geometryField'. */ type ComplexQueryToSolrQLOptions = ComplexQueryOptions & { /** This option allows overwriting the name 'geometry' with a custom field name */ geometryField?: string; }; /** * Type of a transformer function. * * @param node Current ast node. * @param queryOptions The query options. * @param subResults Result of child transformers. * * @returns Transformed ast node. */ type Transformer = (node: ASTNode, queryOptions?: ComplexQueryToSolrQLOptions, subResults?: string[]) => string; /** * Type of a custom transformer function. * * @param this The custom this context. * @param node The current ast node. * @param queryOptions The used query options. * @param subResults Result of child transformers. * @returns Transformation result. */ type CustomTransformer = (this: { /** Allows access to default transformers */ _super: Record; /** A helper utility to escape string values */ _escape: (v: any, keepWildCardChars?: boolean) => string; /** A helper utility to convert a value into a string */ _valueToString: (v: any) => string; }, node: ASTNode, queryOptions?: ComplexQueryToSolrQLOptions, subResults?: string[]) => string; /** * Allows overload of transformers used to create solr filter expressions. * This allows customizing e.g. of $suggest operator. * @param customTransformers the custom transformer function. * @returns an object with customized toSolrQL and astToSolrQL functions. */ declare function overload(customTransformers: Record): { /** * Encodes query to solr filter, it is using the custom transformers. */ toSolrQL: (query?: ComplexQueryExpression, options?: ComplexQueryToSolrQLOptions) => string; /** * Encodes ast/walker to solr filter, it is using the custom transformers. */ astToSolrQL: (astOrWalker: AST | Walker) => string; }; /** * Transforms a complex query into a solr filter expression. * @param query complex query. * @param options transformation options. * @returns a solr filter expression. */ declare const toSolrQL: (query?: ComplexQueryExpression | undefined, options?: ComplexQueryToSolrQLOptions | undefined) => string; /** * Transforms AST or Walker of complex query into a solr filter expression. * @param astOrWalker AST or Walker to transform * @returns a solr filter expression. */ declare const astToSolrQL: (astOrWalker: Walker | AST) => string; declare const _operatorMapping: Record; export { _operatorMapping, astToSolrQL, overload, toSolrQL }; export type { ComplexQueryToSolrQLOptions, CustomTransformer, Transformer };