Skip to main content

Class: DescriptorProto

google.protobuf.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​

• Optional options: null | $Properties

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​

▸ create(properties?): DescriptorProto & $Shape

Creates a new DescriptorProto instance using the specified properties.

Parameters​

NameTypeDescription
properties?$ShapeProperties to set

Returns​

DescriptorProto & $Shape

DescriptorProto instance

▸ create(properties?): DescriptorProto

Parameters​

NameType
properties?$Properties

Returns​

DescriptorProto


decode​

▸ decode(reader, length?): DescriptorProto & $Shape

Decodes a DescriptorProto message from the specified reader or buffer.

Parameters​

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

▸ decodeDelimited(reader): DescriptorProto & $Shape

Decodes a DescriptorProto message from the specified reader or buffer, length delimited.

Parameters​

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

▸ encode(message, writer?): Writer

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

Parameters​

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

Returns​

Writer

Writer


encodeDelimited​

▸ encodeDelimited(message, writer?): Writer

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

Parameters​

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

Returns​

Writer

Writer


fromObject​

▸ fromObject(object): DescriptorProto

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

Parameters​

NameTypeDescription
objectObjectPlain object

Returns​

DescriptorProto

DescriptorProto


toObject​

▸ toObject(message, options?): Object

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

Parameters​

NameTypeDescription
messageDescriptorProtoDescriptorProto
options?IConversionOptionsConversion options

Returns​

Object

Plain object