Skip to main content

Class: Declaration

protobuf.ExtensionRangeOptions.Declaration

Represents a Declaration.

Implements

Constructors

constructor

new Declaration(properties?): Declaration

Constructs a new Declaration.

Parameters

NameTypeDescription
properties?IDeclarationProperties to set

Returns

Declaration

Properties

fullName

fullName: string

The fully-qualified name of the extension field. There must be a leading dot in front of the full name.

Implementation of

IDeclaration.fullName


number

number: number

The extension number declared within the extension range.

Implementation of

IDeclaration.number


repeated

repeated: boolean

If true, indicates that the extension must be defined as repeated. Otherwise the extension must be defined as optional.

Implementation of

IDeclaration.repeated


reserved

reserved: boolean

If true, indicates that the number is reserved in the extension range, and any extension field with the number will fail to compile. Set this when a declared extension field is deleted.

Implementation of

IDeclaration.reserved


type

type: string

The fully-qualified type name of the extension field. Unlike Metadata.type, Declaration.type must have a leading dot for messages and enums.

Implementation of

IDeclaration.type

Methods

toJSON

toJSON(): Object

Converts this Declaration to JSON.

Returns

Object

JSON object


create

create(properties?): Declaration

Creates a new Declaration instance using the specified properties.

Parameters

NameTypeDescription
properties?IDeclarationProperties to set

Returns

Declaration

Declaration instance


decode

decode(reader, length?): Declaration

Decodes a Declaration message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Declaration

Declaration

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Declaration

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Declaration

Declaration

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 Declaration message. Does not implicitly google.protobuf.ExtensionRangeOptions.Declaration.verify|verify messages.

Parameters

NameTypeDescription
messageIDeclarationDeclaration message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

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

Parameters

NameTypeDescription
messageIDeclarationDeclaration message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): Declaration

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Declaration

Declaration


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Declaration

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 Declaration message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageDeclarationDeclaration
options?IConversionOptionsConversion options

Returns

Object

Plain object