Skip to main content

Class: 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?: $Properties | null

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()​

Call Signature​

static create(properties?): DescriptorProto & $Shape

Creates a new DescriptorProto instance using the specified properties.

Parameters​
properties?​

$Shape

Properties to set

Returns​

DescriptorProto & $Shape

DescriptorProto instance

Call Signature​

static create(properties?): DescriptorProto

Creates a new DescriptorProto instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

DescriptorProto

DescriptorProto instance


decode()​

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

Decodes a DescriptorProto 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​

DescriptorProto & $Shape

DescriptorProto

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): DescriptorProto & $Shape

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader 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()​

static encode(message, writer?): Writer

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

Parameters​

message​

$Properties

DescriptorProto message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

DescriptorProto message or plain object to encode

writer?​

Writer

Writer to encode to

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​

object​

{[k: string]: any; }

Plain 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​

message​

DescriptorProto

DescriptorProto

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object