Db
Db maps from file / message / enum name to file description.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Db(
revFileDescriptorMapValue?,filesValue?,extensionsValue?,jsonFieldNamesValue?):Db
Parameters
Section titled “Parameters”revFileDescriptorMapValue?
Section titled “revFileDescriptorMapValue?”Map<string, FileDescription> = ...
filesValue?
Section titled “filesValue?”FileDescription[] = []
extensionsValue?
Section titled “extensionsValue?”extensionMap = ...
jsonFieldNamesValue?
Section titled “jsonFieldNamesValue?”boolean = false
Returns
Section titled “Returns”Db
Methods
Section titled “Methods”copy()
Section titled “copy()”copy():
Db
Copy creates a copy of the current database with its own internal descriptor mapping.
Returns
Section titled “Returns”Db
describeEnum()
Section titled “describeEnum()”describeEnum(
enumName): [EnumValueDescription|undefined,boolean]
DescribeEnum takes a qualified enum name and returns an EnumDescription if it exists in the Db.
Parameters
Section titled “Parameters”enumName
Section titled “enumName”string
Returns
Section titled “Returns”[EnumValueDescription | undefined, boolean]
describeType()
Section titled “describeType()”describeType(
typeName): [TypeDescription|undefined,boolean]
DescribeType returns a TypeDescription for the typeName if it exists in the Db.
Parameters
Section titled “Parameters”typeName
Section titled “typeName”string
Returns
Section titled “Returns”[TypeDescription | undefined, boolean]
fileDescriptions()
Section titled “fileDescriptions()”fileDescriptions():
FileDescription[]
FileDescriptions returns the set of file descriptions associated with this db.
Returns
Section titled “Returns”jsonFieldNames()
Section titled “jsonFieldNames()”jsonFieldNames():
boolean
JSONFieldNames indicates whether the database is configured for proto field accesses by JSON names.
Returns
Section titled “Returns”boolean
protobufRegistry()
Section titled “protobufRegistry()”protobufRegistry():
Registry
protobufRegistry returns the public Protobuf-ES registry for the registered files.
Returns
Section titled “Returns”Registry
registerDescriptor()
Section titled “registerDescriptor()”registerDescriptor(
fileDesc):FileDescription
RegisterDescriptor produces a FileDescription from a file descriptor and registers it into the Db.
Parameters
Section titled “Parameters”fileDesc
Section titled “fileDesc”DescFile
Returns
Section titled “Returns”registerMessage()
Section titled “registerMessage()”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.
Parameters
Section titled “Parameters”message
Section titled “message”Message
schema?
Section titled “schema?”DescMessage
Returns
Section titled “Returns”revFileDescriptorMap()
Section titled “revFileDescriptorMap()”revFileDescriptorMap():
Map<string,FileDescription>
revFileDescriptorMap returns the reverse descriptor index for the Db.
Returns
Section titled “Returns”Map<string, FileDescription>
setJSONFieldNames()
Section titled “setJSONFieldNames()”setJSONFieldNames(
enabled):void
setJSONFieldNames updates the Db JSON field-name mode.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”boolean
Returns
Section titled “Returns”void