Skip to content

Db

Db maps from file / message / enum name to file description.

new Db(revFileDescriptorMapValue?, filesValue?, extensionsValue?, jsonFieldNamesValue?): Db

Map<string, FileDescription> = ...

FileDescription[] = []

extensionMap = ...

boolean = false

Db

copy(): Db

Copy creates a copy of the current database with its own internal descriptor mapping.

Db


describeEnum(enumName): [EnumValueDescription | undefined, boolean]

DescribeEnum takes a qualified enum name and returns an EnumDescription if it exists in the Db.

string

[EnumValueDescription | undefined, boolean]


describeType(typeName): [TypeDescription | undefined, boolean]

DescribeType returns a TypeDescription for the typeName if it exists in the Db.

string

[TypeDescription | undefined, boolean]


fileDescriptions(): FileDescription[]

FileDescriptions returns the set of file descriptions associated with this db.

FileDescription[]


jsonFieldNames(): boolean

JSONFieldNames indicates whether the database is configured for proto field accesses by JSON names.

boolean


protobufRegistry(): Registry

protobufRegistry returns the public Protobuf-ES registry for the registered files.

Registry


registerDescriptor(fileDesc): FileDescription

RegisterDescriptor produces a FileDescription from a file descriptor and registers it into the Db.

DescFile

FileDescription


registerMessage(message, schema?): FileDescription

RegisterMessage registers the message and all other definitions within the message file into the Db.

The schema argument is required when the type is not already present in the Db because Buf message instances do not carry a public descriptor handle that can be recovered from the value alone.

Message

DescMessage

FileDescription


revFileDescriptorMap(): Map<string, FileDescription>

revFileDescriptorMap returns the reverse descriptor index for the Db.

Map<string, FileDescription>


setJSONFieldNames(enabled): void

setJSONFieldNames updates the Db JSON field-name mode.

boolean

void