I'm in the process of updating my encoder/decoder generator to match the API of protobuf.js 6.x (currently it mimics protobuf.js 4.x, you can see it here). The generated decode methods will take an object with properties buf and pos. buf will have to be a Buffer since the decoder will take advantage of Buffer's methods.
I also want to be able to pass the same data type to both my own decode and protobuf.js's decode. The latter accepts BufferReader, but the documentation for BufferReader says its buf is a Uint8Array, not Buffer, so it would be technically incompatible with my decode. But it's clear from the source code that it's actually a Buffer.
Can you update the documentation to state that BufferReader#buf is a Buffer and not just Uint8Array?
I'm in the process of updating my encoder/decoder generator to match the API of protobuf.js 6.x (currently it mimics protobuf.js 4.x, you can see it here). The generated
decodemethods will take an object with propertiesbufandpos.bufwill have to be a Buffer since the decoder will take advantage of Buffer's methods.I also want to be able to pass the same data type to both my own
decodeand protobuf.js'sdecode. The latter accepts BufferReader, but the documentation for BufferReader says itsbufis a Uint8Array, not Buffer, so it would be technically incompatible with mydecode. But it's clear from the source code that it's actually a Buffer.Can you update the documentation to state that BufferReader#buf is a Buffer and not just Uint8Array?