import { ExpressionBuilderTypes, RuleExpression } from './types'; export declare const intTypes: ExpressionBuilderTypes.Field['type'][]; export declare const floatTypes: ExpressionBuilderTypes.Field['type'][]; export declare const numberTypes: ExpressionBuilderTypes.Field['type'][]; export declare const dateTypes: ExpressionBuilderTypes.Field['type'][]; export declare const stringTypes: ExpressionBuilderTypes.Field['type'][]; export declare const booleanTypes: ExpressionBuilderTypes.Field['type'][]; /** * TODO: it's likely that some of the other functions can be moved into the helpers * too, but we want to avoid premature optimisation. Especially as the other * functions may need refactoring due to the way they currently call non-shared * functions */ /** * Convert from Expression builder to Genesis */ export type ValueExpression = RuleExpression.BooleanValue | RuleExpression.NumericValue | RuleExpression.StringValue; /** * Converts a client field type to a server expression type * * @internal **/ export declare function mapFieldTypeToRuleExpressionType(rule: ExpressionBuilderTypes.Rule): ValueExpression['TYPE']; /** * Converts a client BinaryOperator to a server BinaryExpression * * The opposite of `fromBinaryExpression` * @internal **/ export declare function toBinaryExpression(rule: ExpressionBuilderTypes.Rule, OPERATION: RuleExpression.Operation, TYPE: ValueExpression['TYPE']): RuleExpression.Expression['BinaryExpression'] | null; /** * Converts a client BinaryOperator to a server BinaryExpression * * The opposite of `fromBinaryExpression` * * @privateRemarks * Used in specific cases where a server operation doesn't map nicely to a client one, * such as IS_NULL being a client UniraryOperation but a server BinaryExpression * @internal **/ export declare function toSetValueBinaryExpression(rule: ExpressionBuilderTypes.Rule, OPERATION: RuleExpression.Operation, RIGHT: RuleExpression.Expression['BinaryExpression']['RIGHT']): RuleExpression.Expression['BinaryExpression'] | null; /** * Converts a client BinaryOperator to a server MethodExpression * * The opposite of `fromMethodExpression` * * @internal **/ export declare function toMethodExpression(rule: ExpressionBuilderTypes.Rule, METHOD: RuleExpression.MethodCall, restParams?: RuleExpression.Expression['MethodExpression']['PARAMETERS']): RuleExpression.Expression['MethodExpression'] | null; /** * Converts a client field value to a server field value * * The opposite to `rebuildRuleValue` * * @privateRemarks * `string` (+`enum`) and `boolean` types are left as they are * `number` types are converted to string due to the limitation of BigDecimal values from the server * `date` and `datetime-local` converted to epoch time as the server works with numbers * * @internal **/ export declare function transformRuleValue(rule: ExpressionBuilderTypes.Rule): ExpressionBuilderTypes.Rule; /** * Converts a client `Group` into the correct server `Expression` * * @internal **/ export declare function groupToRuleExpression(group: ExpressionBuilderTypes.Group, ruleToRuleExpression: (ruleInput: ExpressionBuilderTypes.Rule) => RuleExpression.Expression[keyof RuleExpression.Expression] | null): RuleExpression.Expression['PredicateExpression']; /** * Convert from Genesis to Expression builder */ /** * Converts a server field value to a client field value * * The opposite to `transformRuleValue` * * @privateRemarks * `string` (+`enum`) and `boolean` types are left as they are * `date` and `datetime-local` are converted to the string format required for input type=[date|datetime-local] * `number` types are parsed as ints or floats as required * * @internal **/ export declare function rebuildRuleValue(rule: Omit, rhs: RuleExpression.Expression['BinaryExpression']['RIGHT']): ExpressionBuilderTypes.Rule; //# sourceMappingURL=expressions-shared-helpers.d.ts.map