Skip to main content

Class: DescriptorProto

google.protobuf.DescriptorProto

Represents a DescriptorProto.

Implements#

Constructors#

constructor#

new DescriptorProto(properties?)

Constructs a new DescriptorProto.

Parameters#

NameType
properties?IDescriptorProto

Properties#

enumType#

enumType: IEnumDescriptorProto[]

DescriptorProto enumType.

Implementation of#

IDescriptorProto.enumType


extension#

extension: IFieldDescriptorProto[]

DescriptorProto extension.

Implementation of#

IDescriptorProto.extension


extensionRange#

extensionRange: IExtensionRange[]

DescriptorProto extensionRange.

Implementation of#

IDescriptorProto.extensionRange


field#

field: IFieldDescriptorProto[]

DescriptorProto field.

Implementation of#

IDescriptorProto.field


name#

name: string

DescriptorProto name.

Implementation of#

IDescriptorProto.name


nestedType#

nestedType: IDescriptorProto[]

DescriptorProto nestedType.

Implementation of#

IDescriptorProto.nestedType


oneofDecl#

oneofDecl: IOneofDescriptorProto[]

DescriptorProto oneofDecl.

Implementation of#

IDescriptorProto.oneofDecl


options#

Optional options: null | IMessageOptions

DescriptorProto options.

Implementation of#

IDescriptorProto.options


reservedName#

reservedName: string[]

DescriptorProto reservedName.

Implementation of#

IDescriptorProto.reservedName


reservedRange#

reservedRange: IReservedRange[]

DescriptorProto reservedRange.

Implementation of#

IDescriptorProto.reservedRange

Methods#

toJSON#

toJSON(): Object

Converts this DescriptorProto to JSON.

Returns#

Object

JSON object


decode#

Static decode(reader, length?): DescriptorProto

Decodes a DescriptorProto message from the specified reader or buffer.

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?number-

Returns#

DescriptorProto

DescriptorProto


decodeDelimited#

Static decodeDelimited(reader): DescriptorProto

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

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns#

DescriptorProto

DescriptorProto


encode#

Static encode(message, writer?): Writer

Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.

Parameters#

NameTypeDescription
messageIDescriptorProtoDescriptorProto message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


encodeDelimited#

Static encodeDelimited(message, writer?): Writer

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

Parameters#

NameTypeDescription
messageIDescriptorProtoDescriptorProto message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


fromObject#

Static 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#

Static toObject(message, options?): Object

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

Parameters#

NameTypeDescription
messageDescriptorProtoDescriptorProto
options?IConversionOptions-

Returns#

Object

Plain object