/** Parse once; evaluate many times against row contexts. */ export declare function compileExpr(src: string): (ctx: Record) => boolean; export type QVal = string | number | boolean | null | undefined; export type QueryFn = (ctx: Record) => boolean; /** * E28 t1/t7 — the query as DATA, so more than one backend can consume it. The * predicate below and the SQL compiler in src/graph/query-sql.ts are two * readings of ONE parse: a second walker over the same source would have to * re-derive which idents are fields and which are literals (a bareword right of * a comparison is a LITERAL), and would drift the first time the grammar grew * an operator. */ export type QNode = { k: 'not'; x: QNode; } | { k: 'and' | 'or'; l: QNode; r: QNode; } | { k: 'truthy'; field: string; } | { k: 'cmp'; field: string; op: '==' | '!='; value: QVal; } | { k: 'in'; field: string; values: string[]; } | { k: 'contains' | 'startswith'; field: string; value: string; } /** E38 t3 (ruling P11) — membership in the cell's comma-split, trimmed * token set: `blocks has 7e1f…` is true when one token IS the value * (never a substring — `abc` must not match `abcd`). Case-folded, because * the promised operands are addresses and vocabulary words: uuid hex is * case-insensitive by RFC, and label/person values fold everywhere else * (facets, lanes, the enum check). */ | { k: 'has'; field: string; value: string; }; /** Parse once. `fields` collects every FIELD position, never a literal. */ export declare function parseQuery(src: string, fields?: Set): QNode; /** The predicate backend — the reference semantics every other backend is * differentially tested against. */ export declare function evalQ(n: QNode, c: Record): boolean; export declare function compileQuery(src: string, fields?: Set): QueryFn;