/** * A checked condition evaluated against the values a run holds. * * A condition that cannot be evaluated is a failure with a reason, never a * silent `false`: reading a node that failed, an optional field that is * absent, or `previous` on a first iteration would otherwise read as "not * yet", and a loop would spin to its cap on a question it never asked. * * `&&`, `||`, `all` and `exists` follow CEL's rule for errors: a side that * decides the answer wins over a side that errs, whichever comes first. So * `audit.ok && audit.output.approved` is `false` for a failed audit, and so is * `audit.output.approved && audit.ok`. Nothing here reads a clock or draws a * number, so the same values always give the same answer. */ import type { Condition } from "./compile.ts"; /** What a condition gave: its answer, or why it has none. */ export type Evaluated = { readonly ok: true; readonly value: boolean; } | { readonly ok: false; readonly message: string; }; /** * `condition` against `values`, keyed by the first word of an address as * `compileCondition` was given their types. * * Values are what a run holds, JSON-shaped: a field set to `undefined` is * absent. A value off its declared type is a failure too, rather than a guess. */ export declare function evaluateCondition(condition: Condition, values: Readonly>): Evaluated; //# sourceMappingURL=evaluate.d.ts.map