UNPKG

@bufbuild/cel

Version:

A CEL evaluator for ECMAScript

47 lines (46 loc) 1.14 kB
import type { Registry } from "@bufbuild/protobuf"; import { type CelFunc, type Dispatcher } from "./func.js"; import { Namespace } from "./namespace.js"; declare const privateSymbol: unique symbol; /** * CEL evaluation environment. * * The environment defines the functions and types that are available * during CEL expression evaluation. */ export interface CelEnv { [privateSymbol]: unknown; /** * Namespace of the environment. */ readonly namespace: Namespace | undefined; /** * The protobuf registry to use. */ readonly registry: Registry; /** * The dispatcher to use. */ readonly dispatcher: Dispatcher; } export interface CelEnvOptions { /** * Namespace of the environment. */ namespace?: string; /** * The protobuf registry to use. */ registry?: Registry; /** * Additional functions to add. * * All functions must be unique. This can be used to override any std function. */ funcs?: CelFunc[]; } /** * Creates a new CelEnv. */ export declare function celEnv(options?: CelEnvOptions): CelEnv; export {};