import { ExpressionBuilder } from '@genesislcap/expression-builder'; import { ExpressionBuilderTypes, RuleExpression } from './types'; /** * Operator names for the server expression * Mapped to the RuleExpression names where possible * @internal **/ export declare const clientOperators: { EQUALS: "EQUALS"; NOT_EQUALS: "NOT_EQUALS"; IS_NULL: string; NOT_NULL: string; IS_NULL_OR_BLANK: string; NOT_NULL_OR_BLANK: string; CONTAINS: string; CONTAINS_WORDS_STARTING_WITH: string; CONTAINS_WORDS_STARTING_SPLIT_DELIMITER: string; GREATER_THAN: "GREATER_THAN"; GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL"; LESS_THAN: "LESS_THAN"; LESS_THAN_OR_EQUAL: "LESS_THAN_OR_EQUAL"; IS_BEFORE: string; IS_AFTER: string; ON_OR_BEFORE: string; ON_OR_AFTER: string; IS_CURRENT: "IS_CURRENT"; IS_PREVIOUS: "IS_PREVIOUS"; }; type Operators = keyof typeof clientOperators; /** * Converts a client operator name to a server operator name * * The opposite to `transformServerNameToOperatorName` * * @privateRemarks * Most names are the same, but this handles cases where date comparison operator names are different * on the display to their server name * * TODO: We could clean this up if we support labels/aliases on the client component * * @internal **/ export declare function transformOperatorNameToServerName(op: Operators): RuleExpression.Operation; /** * Converts a client `Rule` into the correct server `MethodExpression` * * @internal **/ export declare function ruleToRuleMethodExpression(rule: ExpressionBuilderTypes.Rule, operatorName: RuleExpression.Operation): RuleExpression.Expression['MethodExpression']; /** * Converts a client `Rule` into the correct server `Expression` * * @privateRemarks * The server doesn't have a concept for a partial expression so if the user doesn't fill out all values * (e.g. chooses a field but not an operator) that would be lost via this process * * @internal **/ export declare function ruleToRuleExpression(ruleInput: ExpressionBuilderTypes.Rule): RuleExpression.Expression[keyof RuleExpression.Expression] | null; /** * Converts a server operator name to a client operator name * * The opposite to `transformOperatorNameToServerName` * * @privateRemarks * Most names are the same, but this handles cases where date comparison operator names are different * on the display to their server name * * TODO: We could clean this up if we support labels/aliases on the client component * * @internal **/ export declare function transformServerNameToOperatorName(op: RuleExpression.Operation, rulePartialField: Pick): Operators; /** * Handles operator names which have a special client name, but serialised to a normal operator on the server * * @privateRemarks * e.g. `NOT_NULL` is a standard NOT_EQUAL BinaryExpression on the server, but a special UniraryOperation on the client * * @internal **/ export declare function rebuildOperator(rulePartialField: Pick, binExpr: RuleExpression.Expression['BinaryExpression']): Omit; /** * Converts a server BinaryExpression to a client BinaryOperator * * The opposite of `toBinaryExpression` * @internal **/ export declare function fromBinaryExpression(fields: ExpressionBuilderTypes.Field[], binExpr: RuleExpression.Expression['BinaryExpression']): ExpressionBuilderTypes.Rule; /** * Converts a server MethodExpression to a client BinaryOperator * * The opposite of `toMethodExpression` * * @internal **/ export declare function fromMethodExpression(fields: ExpressionBuilderTypes.Field[], methodExpr: RuleExpression.Expression['MethodExpression']): ExpressionBuilderTypes.Rule; /** * Converts recursively from a PREDICATE_EXPRESSION to client Groups and Rules * * @internal **/ export declare function ruleExpressionToGroup(fields: ExpressionBuilderTypes.Field[], expr: RuleExpression.Expression['PredicateExpression']): ExpressionBuilderTypes.Group; /** * We don't create the foundation version of the component in the same way as the other components, * they're composed from a base FAST component. * The reason for this is that we want to have ExpressionBuilder as an independent and open source * component, and due to this we don't want to release it as base components that someone needs to use * FAST to compose. * * @fires change - Fired when the rule expression changes; detail is the serialized expression */ export declare class FoundationRuleExpressionBuilder extends ExpressionBuilder { ruleConfig: ExpressionBuilderTypes.RuleConfig; ruleConfigChanged(_: ExpressionBuilderTypes.RuleConfig, newConfig: ExpressionBuilderTypes.RuleConfig): void; configChanged(oldConfig: ExpressionBuilderTypes.Config, newConfig: ExpressionBuilderTypes.Config): void; dispatchChangeEvent(group: ExpressionBuilderTypes.Group): void; } export {}; //# sourceMappingURL=rule-expression-builder.d.ts.map