UNPKG

@bufbuild/cel

Version:

A CEL evaluator for ECMAScript

13 lines (12 loc) 707 B
import { type CheckedExpr } from "@bufbuild/cel-spec/cel/expr/checked_pb.js"; import { type Expr, type ParsedExpr } from "@bufbuild/cel-spec/cel/expr/syntax_pb.js"; import { type CelResult } from "./error.js"; import type { CelEnv } from "./env.js"; import type { CelInput } from "./type.js"; /** * Creates an execution plan for a CEL expression and returns a reusable evaluation function. * * Planning analyzes the expression structure once, independent of runtime variable values. * The returned function can be called multiple times with different variable bindings. */ export declare function plan(env: CelEnv, expr: Expr | ParsedExpr | CheckedExpr): (ctx?: Record<string, CelInput>) => CelResult;