Protobuf wire data. Mutation of this array after initialization will lead to unexpected behaviour
Lazily-initialized fields dictionary
Get an array of fields with given key
Key of items to be added into result
Expected type of items in array
Get an array of fields with given key
Key of items to be added into result
Expected type of items in array
Get an array of fields with given key
Key of items to be added into result
Expected type of items in array
Get an array of fields with given key
Key of items to be added into result
Expected type of items in array
Get an array of fields with given key
Key of items to be added into result
Expected type of items in array
Get an array of fields with given key
Key of items to be added into result
Expected type of items in array
Returns field value with key key
and optionally index interpreted as a bool
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a bytes
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a double
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a fixed32
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a fixed64
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a float
Field key
Optional array index
Get a field value by key and optionally index
Field key
Field value
Get a field value by key, type and optionally index
Field key
Field type
Field value
Get a field value by key, type and optionally index
Field key
Field type
Field value
Get a field value by key, type and optionally index
Field key
Field type
Field value
Get a field value by key, type and optionally index
Field key
Field type
Field value
Get a field value by key, type and optionally index
Field key
Field type
Field value
Get a field value by key, type and optionally index
Field key
Field type
Field value
Returns whether message has key
field at index
index.
Field key
Field index
Whether to ignore known fields (see OutputMessage.known)
Returns field value with key key
and optionally index interpreted as a int32
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a int64
Field key
Optional array index
Get an iterator over fields with given key
Key of items to be iterated over
Expected type of iterables
Get an iterator over fields with given key
Key of items to be iterated over
Expected type of iterables
Get an iterator over fields with given key
Key of items to be iterated over
Expected type of iterables
Get an iterator over fields with given key
Key of items to be iterated over
Expected type of iterables
Get an iterator over fields with given key
Key of items to be iterated over
Expected type of iterables
Get an iterator over fields with given key
Key of items to be iterated over
Expected type of iterables
Registers some fields (by key) that are known-for-sure to be present in message.
For example, in protobuf int32
fields with value 0 are not in wire, so this is the only
way to get information about those fields.
You can use either a number or object with number keys and type(s) as a value.
Multiple calls to the function will extend existing mappings for new keys and overwrite for existing
Example (assuming msg
is some OutputMessage):
msg.int32(1) // Error: no such field
msg.known(1).int32(1) // 0
msg.known(1).int64(1) // Long(0)
msg.known({ 1: 'int32' }).int32(1) // 0
msg.known({ 1: 'int32' }).int64(1) // Error: field is not int64
msg.known({ 1: ['int32', 'int64'] }).int32(1) // 0
msg.known({ 1: ['int32', 'int64'] }).int64(1) // Long(0)
Information about known fields.
this
Returns number of items in message for key
key.
Throws error if key is not present.
Key to lookup
Returns field value with key key
and optionally index interpreted as a message
Field key
Optional array index
Protobuf version 3 declares a new, more efficient way to store repeated
elements by storing them in a single length-delimited field.
However, this increases the complexity of parsing them — it is not actually
possible without knowing the type of items.
Thus, to provide possibility of parsing those fields, this method is available.
This method only does stuff internally and returns this
Usage:
msg.repeated(1, 'int32').array(1, 'int32')
Key of field which is supposed to be repeated
Type of repeated field.
Returns field value with key key
and optionally index interpreted as a sfixed32
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a sfixed64
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a sint32
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a sint64
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a string
Field key
Optional array index
Coverts OutputMessage to InputMessage.
Note: you likely won't be able to use InputMessage.get, because types will be erased down to primitives. If you will need to get the field values later, keep the original message at hand.
Note: when converted back to the wire, it may not be exactly the same as the original message, even if no changes were made. Particularly, order of the fields may not be preserved, empty fields may be removed (use InputMessage.keepDefault to avoid that), and non-packed primitives may get packed. Still, the resulting message should stay compatible with the original one.
Converts OutputMessage to JSON API compatible object. Will only contain one inferred value for each field, and is not recommended overall.
Returns type of field with key
key and index
index.
Note: Message is invalid according to protobuf specs if
field has different type at the same key, but it is not in protoflex.
Returns field value with key key
and optionally index interpreted as a uint32
Field key
Optional array index
Returns field value with key key
and optionally index interpreted as a uint64
Field key
Optional array index
Generated using TypeDoc
Describes a single message that was parsed by Protoflex and can be read.