Class: Value
Represents a Value.
Implements
Constructors
constructor
• new Value(properties?): Value
Constructs a new Value.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IValue | Properties to set |
Returns
Properties
boolValue
• Optional boolValue: boolean
Value boolValue.
Implementation of
kind
• Optional kind: "nullValue" | "numberValue" | "stringValue" | "boolValue" | "structValue" | "listValue"
Value kind.
listValue
• Optional listValue: IListValue
Value listValue.
Implementation of
nullValue
• Optional nullValue: NULL_VALUE
Value nullValue.
Implementation of
numberValue
• Optional numberValue: number
Value numberValue.
Implementation of
stringValue
• Optional stringValue: string
Value stringValue.
Implementation of
structValue
• Optional structValue: IStruct
Value structValue.
Implementation of
Methods
create
▸ create(properties?): Value
Creates a new Value instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | IValue | Properties to set |
Returns
Value instance
decode
▸ decode(reader, length?): Value
Decodes a Value message from the specified reader or buffer.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
Value
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): Value
Decodes a Value message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
Value
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 Value message. Does not implicitly verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IValue | Value message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message, writer?): Writer
Encodes the specified Value message, length delimited. Does not implicitly verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | IValue | Value message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): Value
Creates a Value message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
Value
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for Value
Parameters
| Name | Type | Description |
|---|---|---|
typeUrlPrefix? | string | your custom typeUrlPrefix(default "type.googleapis.com") |
Returns
string
The default type url
toJSON
▸ toJSON(): Object
Converts this Value to JSON.
Returns
Object
JSON object
toObject
▸ toObject(message, options?): Object
Creates a plain object from a Value message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | Value | Value |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object
verify
▸ verify(message): string
Verifies a Value message.
Parameters
| Name | Type | Description |
|---|---|---|
message | Object | Plain object to verify |
Returns
string
null if valid, otherwise the reason why it is not