/** * A condition's tree, parsed with CEL's grammar and precedence. * * The subset is CEL's own grammar with productions removed, never one of ours * added, so every expression this accepts parses the same way in a real CEL * library: `!a == b` is `(!a) == b`, and relations sit below `&&`. */ /** Where a node of the tree sits in the source, so a message can quote exactly that part. */ export type Span = { readonly start: number; readonly end: number; }; /** The operators that take two sides. */ export type BinaryOperator = "&&" | "||" | "==" | "!=" | "<" | "<=" | ">" | ">=" | "in"; /** One node of a condition's tree. */ export type Expr = Span & ({ readonly kind: "literal"; readonly value: boolean | number | string; } | { readonly kind: "list"; readonly items: readonly Expr[]; } | { readonly kind: "name"; readonly name: string; } | { readonly kind: "select"; readonly target: Expr; readonly field: string; } | { readonly kind: "not"; readonly operand: Expr; } | { readonly kind: "binary"; readonly op: BinaryOperator; readonly left: Expr; readonly right: Expr; } | { readonly kind: "size"; readonly arg: Expr; } | { readonly kind: "has"; readonly arg: Expr & { readonly kind: "select"; }; } | { readonly kind: "macro"; readonly macro: "all" | "exists"; readonly target: Expr; readonly variable: string; readonly body: Expr; }); /** The tree of `source`. Throws `SyntaxFault`, which the module's door turns into a problem. */ export declare function parse(source: string): Expr; //# sourceMappingURL=parse.d.ts.map