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