| Method | What it does |
| Protobuf.decode(bytes, { schema, type }) | A message { fields, offset, end, type }, or null when the bytes aren't one. Each field has number, wireType, offset, end, and value (varints, as a BigInt) or bytes; length-delimited fields get an interpretation (message, string, packed, bytes or empty); with a schema, name, fieldType, repeated, typedValue. |
| Protobuf.readings(field) | Every reading of a scalar: [{ kind, value }] for uint, int64, sint, bool, fixed64, double, sfixed64, fixed32, float, sfixed32. |
| Protobuf.interpret(bytes, depth) | The best guess for length-delimited bytes. |
| Protobuf.parseMessage(bytes, start, end) | The fields alone, without interpretations, or null. |
| Protobuf.readVarint(bytes, position, end) | [value, next position]. |
| Protobuf.unframe(bytes), Protobuf.delimited(bytes) | gRPC frames [{ offset, bytes, compressed }], or varint-delimited messages; null when the data isn't framed that way. |
| Protobuf.schemaFromDescriptorSet(bytes) | A schema { types, enums, files } from a FileDescriptorSet. Schemas can also be written by hand: types["pkg.Msg"].fields[number] = { name, type, label, typeName }. |
| Protobuf.bestType(schema, bytes) | The message type whose fields fit the bytes best. |
| Protobuf.applySchema(message, schema, type) | Adds names and types to a parsed message. |
| Protobuf.toJSON(message) | Plain values keyed by field name or number; repeated fields become arrays. |
| Protobuf.SCALAR_TYPES | Descriptor type numbers to type names (1 double … 18 sint64). |
| Protobuf.parseBytesText(text) | Bytes from hex, Base64, or escaped text (\x0a, protoc's \012), or null. |