Skip to main content

Class: EnumDescriptorProto

google.protobuf.EnumDescriptorProto

Describes an enum type.

Properties

name

name: string

EnumDescriptorProto name.


options

Optional options: null | $Properties

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

create(properties?): EnumDescriptorProto & $Shape

Creates a new EnumDescriptorProto instance using the specified properties.

Parameters

NameTypeDescription
properties?$ShapeProperties to set

Returns

EnumDescriptorProto & $Shape

EnumDescriptorProto instance

create(properties?): EnumDescriptorProto

Parameters

NameType
properties?$Properties

Returns

EnumDescriptorProto


decode

decode(reader, length?): EnumDescriptorProto & $Shape

Decodes an EnumDescriptorProto message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage 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

decodeDelimited(reader): EnumDescriptorProto & $Shape

Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader 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

encode(message, writer?): Writer

Encodes the specified EnumDescriptorProto message. Does not implicitly google.protobuf.EnumDescriptorProto.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesEnumDescriptorProto message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly google.protobuf.EnumDescriptorProto.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesEnumDescriptorProto message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): EnumDescriptorProto

Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

EnumDescriptorProto

EnumDescriptorProto


toObject

toObject(message, options?): Object

Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageEnumDescriptorProtoEnumDescriptorProto
options?IConversionOptionsConversion options

Returns

Object

Plain object