Skip to content

Config

Config represents a serializable form of the CEL environment configuration.

Note: custom validations, feature flags, and performance tuning parameters are not (yet) considered part of the core CEL environment configuration and should be managed separately until a common convention for such settings is developed.

new Config(name): Config

Constructor creates an instance of a YAML serializable CEL environment configuration.

string

Config

container: string = ""


optional contextVariable?: ContextVariable


description: string = ""


extensions: Extension[] = []


features: Feature[] = []


functions: Function[] = []


imports: Import[] = []


limits: Limit[] = []


name: string


optional stdlib?: LibrarySubset


validators: Validator[] = []


variables: Variable[] = []

addExtensions(…extensions): this

AddExtensions appends a set of extensions to the config.

…(Extension | undefined)[]

this


addFeatures(…features): this

AddFeatures appends one or more features to the config.

…(Feature | undefined)[]

this


addFunctionDecls(…funcs): this

AddFunctionDecls adds one or more functions to the config, converting them to serializable values first.

…(FunctionDecl | undefined)[]

this


addFunctions(…funcs): this

AddFunctions adds one or more functions to the config.

…(Function | undefined)[]

this


addImports(…imports): this

AddImports appends a set of imports to the config.

…(Import | undefined)[]

this


addLimits(…limits): this

AddLimits appends one or more limits to the config.

…(Limit | undefined)[]

this


addValidators(…validators): this

AddValidators appends one or more validators to the config.

…(Validator | undefined)[]

this


addVariableDecls(…vars): this

AddVariableDecls adds one or more variables to the config, converting them to serializable values first.

…(VariableDecl | undefined)[]

this


addVariables(…vars): this

AddVariables adds one or more variables to the config.

…(Variable | undefined)[]

this


setContainer(container): this

SetContainer configures the container name for this configuration.

string

this


setContextVariable(ctx?): this

SetContextVariable configures the ContextVariable for this configuration.

ContextVariable

this


setStdLib(subset?): this

SetStdLib configures the LibrarySubset for the standard library.

LibrarySubset

this


validate(): Error | undefined

Validate validates the whole configuration is well-formed.

Error | undefined