Skip to content

TypeDescription

TypeDescription is a collection of type metadata relevant to expression checking and evaluation.

  • description

new TypeDescription(typeNameValue, descValue, fieldMapValue, jsonFieldMapValue, extensionsValue, reflectTypeValue, zeroMsgValue, jsonFieldNamesValue): TypeDescription

string

DescMessage

Map<string, FieldDescription>

Map<string, FieldDescription>

extensionMap

unknown

Message | undefined

boolean

TypeDescription

copy(extensions): TypeDescription

Copy copies the type description with updated references to the Db.

extensionMap

TypeDescription


descriptor(): DescMessage

Descriptor returns the Buf message descriptor.

DescMessage


fieldByName(name): [FieldDescription | undefined, boolean]

FieldByName returns the FieldDescription if declared within the type.

string

[FieldDescription | undefined, boolean]


fieldMap(): Map<string, FieldDescription>

FieldMap returns a string field name to FieldDescription map.

Map<string, FieldDescription>


maybeUnwrap(msg): [unknown, boolean, Error | undefined]

MaybeUnwrap accepts a proto message as input and unwraps it to a primitive CEL type if possible.

Message

[unknown, boolean, Error | undefined]


message(): Message

Message returns a mutable proto message.

Message


name(): string

Name returns the fully-qualified name of the type.

string


reflectType(): unknown

ReflectType returns the reflected runtime type token for this type.

unknown


zero(): Message | undefined

Zero returns the zero message value for this type.

Message | undefined

description.zero