/** * Condition evaluation utilities for decorator steps. * Extracted from DecoratorClass to be shared across all steps. */ import type { DependsOnCondition } from '@sap/ux-specification-types'; import type { DecoratorContext } from './interfaces'; /** * Result of evaluating a single condition. */ export type EvaluateConditionResult = { passed: boolean; value: unknown; key: string; }; /** * Result of evaluating a condition with context for messages. */ export type ConditionEvaluationResult = { passed: boolean; context: string; }; /** * Evaluates decorator conditions against runtime context. * Supports single conditions, AND conditions, and OR conditions with nesting. */ export declare class ConditionEvaluator { private readonly context; /** * Creates a new ConditionEvaluator with the given decorator context. * * @param context - The decorator context containing app, page, and custom runtime data */ constructor(context: DecoratorContext); /** * Gets property value from the decorator context using a property path. * Supports JSONPath syntax for complex paths. * * @param propertyPath - JSONPath-style path to resolve (e.g. 'page.isALP', 'custom.type') * @returns The key/value pair at the resolved path, or undefined if not found */ getPropertyKeyValue(propertyPath: string): { key: string; value: unknown; } | undefined; /** * Resolves PathNode values in message params to their actual values. * * @param params - Optional map of parameter names to values (may contain PathNodes) * @returns Resolved params with PathNodes replaced by their runtime values */ resolveMessageParams(params?: Record): Record | undefined; /** * Evaluates a condition and returns whether it passed and context for messages. * * @param conditionInfo - The condition to evaluate (single, AND, or OR) * @returns Whether the condition passed and a context string for message interpolation */ evaluate(conditionInfo: DependsOnCondition): ConditionEvaluationResult; /** * Evaluates a single dependency condition. * * @param condition - A single condition with path, optional expectedValue, and optional negate * @returns The evaluation result with passed flag, resolved value, and key */ private evaluateSingleCondition; /** * Gets the context message from evaluation results. * * @param results - Array of evaluation results to summarize * @returns A comma-separated string of failed condition key/value pairs */ private getContextForMessage; /** * Evaluates an AND condition item which can be a single condition or nested OR group. * * @param conditionItem - A single condition or an OR group nested inside AND * @returns Whether the item passed and the individual evaluation results */ private evaluateAndConditionItem; /** * Evaluates OR conditions (at least one must match). * * @param orConditions - Array of OR condition items (single conditions or AND groups) * @returns Whether any condition passed and all individual evaluation results */ private evaluateOrConditions; /** * Evaluates AND conditions (all must match). * * @param andConditions - Array of AND condition items (single conditions or OR groups) * @returns Whether all conditions passed and all individual evaluation results */ private evaluateAndConditions; } //# sourceMappingURL=condition-evaluator.d.ts.map