Class: DescriptorProto
Describes a message type.
Properties
enumType
enumType:
$Properties[]
DescriptorProto enumType.
extension
extension:
$Properties[]
DescriptorProto extension.
extensionRange
extensionRange:
$Properties[]
DescriptorProto extensionRange.
field
field:
$Properties[]
DescriptorProto field.
name
name:
string
DescriptorProto name.
nestedType
nestedType:
$Properties[]
DescriptorProto nestedType.
oneofDecl
oneofDecl:
$Properties[]
DescriptorProto oneofDecl.
options?
optionaloptions?:$Properties|null
DescriptorProto options.
reservedName
reservedName:
string[]
Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once.
reservedRange
reservedRange:
$Properties[]
DescriptorProto reservedRange.
Methods
toJSON()
toJSON():
object
Converts this DescriptorProto to JSON.
Returns
object
JSON object
create()
Call Signature
staticcreate(properties?):DescriptorProto&$Shape
Creates a new DescriptorProto instance using the specified properties.
Parameters
properties?
Properties to set
Returns
DescriptorProto & $Shape
DescriptorProto instance
Call Signature
staticcreate(properties?):DescriptorProto
Creates a new DescriptorProto instance using the specified properties.
Parameters
properties?
Properties to set
Returns
DescriptorProto
DescriptorProto instance
decode()
staticdecode(reader,length?):DescriptorProto&$Shape
Decodes a DescriptorProto message from the specified reader or buffer.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
length?
number
Message length if known beforehand
Returns
DescriptorProto & $Shape
DescriptorProto
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited()
staticdecodeDelimited(reader):DescriptorProto&$Shape
Decodes a DescriptorProto message from the specified reader or buffer, length delimited.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
Returns
DescriptorProto & $Shape
DescriptorProto
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode()
staticencode(message,writer?):Writer
Encodes the specified DescriptorProto message. Does not implicitly google.protobuf.DescriptorProto.verify|verify messages.
Parameters
message
DescriptorProto message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
encodeDelimited()
staticencodeDelimited(message,writer?):Writer
Encodes the specified DescriptorProto message, length delimited. Does not implicitly google.protobuf.DescriptorProto.verify|verify messages.
Parameters
message
DescriptorProto message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
fromObject()
staticfromObject(object):DescriptorProto
Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.
Parameters
object
{[k: string]: any; }
Plain object
Returns
DescriptorProto
DescriptorProto
toObject()
statictoObject(message,options?):object
Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.
Parameters
message
DescriptorProto
DescriptorProto
options?
IConversionOptions
Conversion options
Returns
object
Plain object