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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Config(
name):Config
Constructor creates an instance of a YAML serializable CEL environment configuration.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Config
Properties
Section titled “Properties”container
Section titled “container”container:
string=""
contextVariable?
Section titled “contextVariable?”
optionalcontextVariable?:ContextVariable
description
Section titled “description”description:
string=""
extensions
Section titled “extensions”extensions:
Extension[] =[]
features
Section titled “features”features:
Feature[] =[]
functions
Section titled “functions”functions:
Function[] =[]
imports
Section titled “imports”imports:
Import[] =[]
limits
Section titled “limits”limits:
Limit[] =[]
name:
string
stdlib?
Section titled “stdlib?”
optionalstdlib?:LibrarySubset
validators
Section titled “validators”validators:
Validator[] =[]
variables
Section titled “variables”variables:
Variable[] =[]
Methods
Section titled “Methods”addExtensions()
Section titled “addExtensions()”addExtensions(…
extensions):this
AddExtensions appends a set of extensions to the config.
Parameters
Section titled “Parameters”extensions
Section titled “extensions”…(Extension | undefined)[]
Returns
Section titled “Returns”this
addFeatures()
Section titled “addFeatures()”addFeatures(…
features):this
AddFeatures appends one or more features to the config.
Parameters
Section titled “Parameters”features
Section titled “features”…(Feature | undefined)[]
Returns
Section titled “Returns”this
addFunctionDecls()
Section titled “addFunctionDecls()”addFunctionDecls(…
funcs):this
AddFunctionDecls adds one or more functions to the config, converting them to serializable values first.
Parameters
Section titled “Parameters”…(FunctionDecl | undefined)[]
Returns
Section titled “Returns”this
addFunctions()
Section titled “addFunctions()”addFunctions(…
funcs):this
AddFunctions adds one or more functions to the config.
Parameters
Section titled “Parameters”…(Function | undefined)[]
Returns
Section titled “Returns”this
addImports()
Section titled “addImports()”addImports(…
imports):this
AddImports appends a set of imports to the config.
Parameters
Section titled “Parameters”imports
Section titled “imports”…(Import | undefined)[]
Returns
Section titled “Returns”this
addLimits()
Section titled “addLimits()”addLimits(…
limits):this
AddLimits appends one or more limits to the config.
Parameters
Section titled “Parameters”limits
Section titled “limits”…(Limit | undefined)[]
Returns
Section titled “Returns”this
addValidators()
Section titled “addValidators()”addValidators(…
validators):this
AddValidators appends one or more validators to the config.
Parameters
Section titled “Parameters”validators
Section titled “validators”…(Validator | undefined)[]
Returns
Section titled “Returns”this
addVariableDecls()
Section titled “addVariableDecls()”addVariableDecls(…
vars):this
AddVariableDecls adds one or more variables to the config, converting them to serializable values first.
Parameters
Section titled “Parameters”…(VariableDecl | undefined)[]
Returns
Section titled “Returns”this
addVariables()
Section titled “addVariables()”addVariables(…
vars):this
AddVariables adds one or more variables to the config.
Parameters
Section titled “Parameters”…(Variable | undefined)[]
Returns
Section titled “Returns”this
setContainer()
Section titled “setContainer()”setContainer(
container):this
SetContainer configures the container name for this configuration.
Parameters
Section titled “Parameters”container
Section titled “container”string
Returns
Section titled “Returns”this
setContextVariable()
Section titled “setContextVariable()”setContextVariable(
ctx?):this
SetContextVariable configures the ContextVariable for this configuration.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
setStdLib()
Section titled “setStdLib()”setStdLib(
subset?):this
SetStdLib configures the LibrarySubset for the standard library.
Parameters
Section titled “Parameters”subset?
Section titled “subset?”Returns
Section titled “Returns”this
validate()
Section titled “validate()”validate():
Error|undefined
Validate validates the whole configuration is well-formed.
Returns
Section titled “Returns”Error | undefined