Skip to main content

Class: Declaration

Represents a 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.


number​

number: number

The extension number declared within the extension range.


repeated​

repeated: boolean

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


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.


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.

Methods​

toJSON()​

toJSON(): object

Converts this Declaration to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): Declaration & $Properties

Creates a new Declaration instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

Declaration & $Properties

Declaration instance

Call Signature​

static create(properties?): Declaration

Creates a new Declaration instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

Declaration

Declaration instance


decode()​

static decode(reader, length?): Declaration & $Properties

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

Declaration & $Properties

Declaration

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): Declaration & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

Declaration & $Properties

Declaration

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

Parameters​

message​

$Properties

Declaration message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

Declaration message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): Declaration

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

Declaration

Declaration


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

Declaration

Declaration

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object