Skip to content

TypeRegistry

TypeRegistry allows third-parties to add custom types to CEL.

Deprecated: use types.Registry

enumValue(enumName): Val

EnumValue returns the numeric value of the given enum value name.

string

Val

TypeProvider.enumValue


findFieldType(messageType, fieldName): FieldType | undefined

FindFieldType returns the field type for a checked type value.

string

string

FieldType | undefined

TypeProvider.findFieldType


findIdent(identName): Val | undefined

FindIdent takes a qualified identifier name and returns a Value if one exists.

string

Val | undefined

TypeProvider.findIdent


findType(typeName): Type | undefined

FindType looks up the Type given a qualified typeName. Returns false if not found.

string

Type | undefined

TypeProvider.findType


nativeToValue(value): Val

NativeToValue converts the input value to a CEL ref.Val.

unknown

Val

TypeAdapter.nativeToValue


registerDescriptor(fileDesc): void

RegisterDescriptor registers a protocol buffer file descriptor.

unknown

void


registerMessage(message): void

RegisterMessage registers a protocol buffer message and its dependencies.

unknown

void


registerType(…types): void

RegisterType registers a type value with the provider.

…RefType[]

void


value(typeName, fields): Val

Value creates a new type value from a qualified name and map of field name to value.

string

Record<string, Val>

Val

TypeProvider.value