Skip to main content

Class: DescriptorProto

google.protobuf.DescriptorProto

Represents a DescriptorProto.

Implements

Constructors

constructor

new DescriptorProto(properties?): DescriptorProto

Constructs a new DescriptorProto.

Parameters

NameTypeDescription
properties?IDescriptorProtoProperties to set

Returns

DescriptorProto

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


create

create(properties?): DescriptorProto

Creates a new DescriptorProto instance using the specified properties.

Parameters

NameTypeDescription
properties?IDescriptorProtoProperties to set

Returns

DescriptorProto

DescriptorProto instance


decode

decode(reader, length?): DescriptorProto

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

DescriptorProto

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): DescriptorProto

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

DescriptorProto

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
messageIDescriptorProtoDescriptorProto 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
messageIDescriptorProtoDescriptorProto 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


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for DescriptorProto

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


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