/** * Evaluation of Optimizely Forms dependency rules: the conditions under which an * element or a step is shown or hidden, and where a step jumps to. * * Pure functions over a rule set and the form's current values. * * @module */ export type DependencyCondition = { DependsOnField: string | null; ComparisonOperator: string | null; ComparisonValue: string | null; }; export type DependencyRule = { TargetElement: string | null; SatisfiedAction: string | null; ConditionCombination: string | null; AfterStep?: string | null; JumpToStep?: string | null; TargetStep?: string | null; Conditions: DependencyCondition[] | null; }; /** One identifier, or every identifier an element is known by. */ export type ElementId = string | string[]; export declare function evaluateCondition(condition: DependencyCondition, values: Map): boolean; /** A rule with no conditions is always satisfied. */ export declare function isRuleSatisfied(rule: DependencyRule, values: Map): boolean; /** Decides whether an element is visible under the current values. Untargeted elements are. */ export declare const isElementVisible: (rules: DependencyRule[], values: Map, elementId: ElementId) => boolean; /** Decides whether a step is visible under the current values. Untargeted steps are. */ export declare const isStepVisible: (rules: DependencyRule[], values: Map, stepId: ElementId) => boolean; /** The key of the step a satisfied rule jumps to after `stepId`, or `null` to carry on in order. */ export declare const getJumpTarget: (rules: DependencyRule[], values: Map, stepId: ElementId) => string | null;