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
staticcreate(properties?):Declaration&$Properties
Creates a new Declaration instance using the specified properties.
Parameters
properties?
Properties to set
Returns
Declaration & $Properties
Declaration instance
Call Signature
staticcreate(properties?):Declaration
Creates a new Declaration instance using the specified properties.
Parameters
properties?
Properties to set
Returns
Declaration
Declaration instance
decode()
staticdecode(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()
staticdecodeDelimited(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()
staticencode(message,writer?):Writer
Encodes the specified Declaration message. Does not implicitly google.protobuf.ExtensionRangeOptions.Declaration.verify|verify messages.
Parameters
message
Declaration message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
encodeDelimited()
staticencodeDelimited(message,writer?):Writer
Encodes the specified Declaration message, length delimited. Does not implicitly google.protobuf.ExtensionRangeOptions.Declaration.verify|verify messages.
Parameters
message
Declaration message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
fromObject()
staticfromObject(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()
statictoObject(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