import { type OpenmrsEncounter, type FormField, type FormPage, type FormSection } from '../types'; import { compile, type DefaultEvaluateReturnType, type Visit } from '@openmrs/esm-framework'; export interface FormNode { value: FormPage | FormSection | FormField; type: 'field' | 'page' | 'section'; } export interface ExpressionContext { mode: 'enter' | 'edit' | 'view' | 'embedded-view'; myValue?: any; patient: any; previousEncounter?: OpenmrsEncounter; visit?: Visit; } export type EvaluateReturnType = DefaultEvaluateReturnType | Record; export declare const astCache: Map; export declare function evaluateExpression(expression: string, node: FormNode, fields: Array, fieldValues: Record, context: ExpressionContext): any; export declare function evaluateAsyncExpression(expression: string, node: FormNode, fields: Array, fieldValues: Record, context: ExpressionContext): Promise; /** * Extracts all referenced fields in the expression and registers them as dependencies. * @param expression - The expression to track dependencies for. * @param fieldNode - The node representing the field. * @param allFields - The list of all fields in the form. */ export declare function trackFieldDependencies(expression: ReturnType, fieldNode: FormNode, allFields: FormField[]): void; //# sourceMappingURL=expression-runner.d.ts.map