import { L as Except, P as ExpressionNode, R as Merge, T as DefaultRuleGroupTypeIC, j as DefaultRuleGroupType } from "./index-CX9mehdL.js"; import { t as ParserCommonOptions } from "./import-6ExjhifL.js"; //#region ../../node_modules/type-fest/source/override-properties.d.ts /** Override existing properties of the given type. Similar to `Merge`, but enforces that the original type has the properties you want to override. This is useful when you want to override existing properties with a different type and make sure that these properties really exist in the original. @example ``` import type {OverrideProperties} from 'type-fest'; type Foo = { a: string; b: string; }; type Bar = OverrideProperties; //=> {a: string; b: number} // @ts-expect-error type Baz = OverrideProperties; // Error, type '{ c: number; }' does not satisfy the constraint '{ c: never; }' // @ts-expect-error type Fizz = OverrideProperties; // Error, type '{ b: number; c: number; }' does not satisfy the constraint '{ b: number; c: never; }' ``` @category Object */ type OverrideProperties> & { [Key in keyof TOverride]: Key extends keyof TOriginal ? TOverride[Key] : never; }> = Merge; //#endregion //#region src/utils/parseJSONata/types.d.ts interface JSONataExprNode { type: string; value?: any; position?: number; arguments?: JSONataExprNode[]; name?: string; procedure?: JSONataExprNode; steps?: JSONataExprNode[]; expressions?: JSONataExprNode[]; stages?: JSONataExprNode[]; lhs?: JSONataExprNode; rhs?: JSONataExprNode; } interface JSONataPath extends JSONataExprNode { type: "path"; steps: [JSONataExprNode, ...JSONataExprNode[]]; } interface JSONataName extends JSONataExprNode { type: "name"; value: string; } interface JSONataIdentifier extends JSONataPath { steps: [JSONataName, ...JSONataName[]]; } interface JSONataBlock extends JSONataExprNode { type: "block"; expressions: [JSONataExprNode]; } interface JSONataString extends JSONataExprNode { type: "string"; value: string; } interface JSONataNumber extends JSONataExprNode { type: "number"; value: number; } interface JSONataBoolean extends JSONataExprNode { type: "value"; value: boolean; } interface JSONataNull extends JSONataExprNode { type: "value"; value: null; } interface JSONataRegex extends JSONataExprNode { type: "regex"; value: RegExp; } interface JSONataBinaryNode extends JSONataExprNode { type: "binary"; lhs: JSONataExprNode; rhs: JSONataExprNode; } interface JSONataAnd extends JSONataBinaryNode { value: "and"; } interface JSONataOr extends JSONataBinaryNode { value: "or"; } interface JSONataEqual extends JSONataBinaryNode { value: "="; } interface JSONataNotEqual extends JSONataBinaryNode { value: "!="; } interface JSONataGreaterThan extends JSONataBinaryNode { value: ">"; } interface JSONataGreaterThanOrEqual extends JSONataBinaryNode { value: ">="; } interface JSONataLessThan extends JSONataBinaryNode { value: "<"; } interface JSONataLessThanOrEqual extends JSONataBinaryNode { value: "<="; } interface JSONataIn extends JSONataBinaryNode { value: "in"; lhs: JSONataPath; rhs: JSONataList; } interface JSONataNot extends JSONataExprNode { type: "function"; value: "("; arguments: [JSONataExprNode]; procedure: OverrideProperties; } interface JSONataContains extends JSONataExprNode { type: "function"; value: "("; arguments: [JSONataPath, JSONataString | JSONataRegex]; procedure: OverrideProperties; } interface JSONataToMillis extends JSONataExprNode { type: "function"; value: "("; arguments: [JSONataString, ...JSONataString[]]; procedure: OverrideProperties; } interface JSONataList extends JSONataExprNode { type: "unary"; value: "["; expressions: JSONataExprNode[]; } /** * A JSONata operand subtree that {@link parseJSONata!ParseJSONataOptions.getExpression} may * receive — an arithmetic infix node (`+ - * / %`) or a function-call node * (`$abs`/`$min`/`$max`/`$uppercase`/`$lowercase`, etc.). */ type JSONataExpressionOperand = JSONataExprNode; /** Context passed to {@link parseJSONata!ParseJSONataOptions.getExpression}. */ interface ParseJSONataExpressionContext { /** Returns `true` if the field is configured (or if no `fields` were supplied). */ fieldExists: (fieldName: string) => boolean; } //#endregion //#region src/utils/parseJSONata/parseJSONata.d.ts /** * Options object for {@link parseJSONata}. * * Note: `listsAsArrays` is ignored by `parseJSONata`; lists are _always_ arrays. */ interface ParseJSONataOptions extends ParserCommonOptions { /** * Handler that converts a JSONata arithmetic/function operand subtree into an * {@link ExpressionNode}. Return `null` to reject (the rule is dropped). Supplied by * `@react-querybuilder/expr` (`expressionParserJSONata`). When omitted, expression * operands are ignored (rule dropped). */ getExpression?: (node: JSONataExpressionOperand, ctx: ParseJSONataExpressionContext) => ExpressionNode | null; } /** * Converts a JSONata string expression into a query suitable for the * {@link index!QueryBuilder QueryBuilder} component's `query` or `defaultQuery` props * ({@link index!DefaultRuleGroupType DefaultRuleGroupType}). */ declare function parseJSONata(jsonataInput: string): DefaultRuleGroupType; /** * Converts a JSONata string expression into a query suitable for the * {@link index!QueryBuilder QueryBuilder} component's `query` or `defaultQuery` props * ({@link index!DefaultRuleGroupType DefaultRuleGroupType}). */ declare function parseJSONata(jsonataInput: string, options: Except & { independentCombinators?: false; }): DefaultRuleGroupType; /** * Converts a JSONata string expression into a query suitable for the * {@link index!QueryBuilder QueryBuilder} component's `query` or `defaultQuery` props * ({@link index!DefaultRuleGroupTypeIC DefaultRuleGroupTypeIC}). */ declare function parseJSONata(jsonataInput: string, options: Except & { independentCombinators: true; }): DefaultRuleGroupTypeIC; //#endregion //#region src/utils/parseJSONata/utils.d.ts type Any = any; declare const isJSONataIdentifier: (expr: Any) => expr is JSONataIdentifier; declare const isJSONataString: (expr: Any) => expr is JSONataString; declare const isJSONataNumber: (expr: Any) => expr is JSONataNumber; declare const isJSONataBoolean: (expr: Any) => expr is JSONataBoolean; declare const isJSONataNull: (expr: Any) => expr is JSONataNull; declare const isJSONataList: (expr: Any) => expr is JSONataList; /** * A JSONata comparison operand that is a candidate expression subtree: an arithmetic infix node * (`+ - * / %`) or a function-call node (excluding the `not`/`contains` predicates handled * elsewhere). The expr-supplied `getExpression` handler decides whether it maps to a known * function. */ declare const isJSONataExpressionOperand: (expr: Any) => expr is JSONataExprNode; declare const getValidValue: (expr: Any) => Any; declare const getFieldFromPath: (path: JSONataPath) => string; //#endregion export { JSONataAnd, JSONataBinaryNode, JSONataBlock, JSONataBoolean, JSONataContains, JSONataEqual, JSONataExprNode, JSONataExpressionOperand, JSONataGreaterThan, JSONataGreaterThanOrEqual, JSONataIdentifier, JSONataIn, JSONataLessThan, JSONataLessThanOrEqual, JSONataList, JSONataName, JSONataNot, JSONataNotEqual, JSONataNull, JSONataNumber, JSONataOr, JSONataPath, JSONataRegex, JSONataString, JSONataToMillis, ParseJSONataExpressionContext, ParseJSONataOptions, getFieldFromPath, getValidValue, isJSONataBoolean, isJSONataExpressionOperand, isJSONataIdentifier, isJSONataList, isJSONataNull, isJSONataNumber, isJSONataString, parseJSONata }; //# sourceMappingURL=parseJSONata.d.ts.map