/** * BinaryEncoder implements encoders for all the wire types specified in * https://developers.google.com/protocol-buffers/docs/encoding. */ export declare class BinaryEncoder { buffer_: number[]; constructor(); length(): number; end(): Array; /** * Encodes a 64-bit integer in 32:32 split representation into its wire-format * varint representation and stores it in the buffer. */ writeSplitVarint64(lowBits: number, highBits: number): void; /** * Encodes a 64-bit integer in 32:32 split representation into its wire-format * fixed representation and stores it in the buffer. */ writeSplitFixed64(lowBits: number, highBits: number): void; /** * Encodes a 32-bit unsigned integer into its wire-format varint representation * and stores it in the buffer. */ writeUnsignedVarint32(value: number): void; /** * Encodes a 32-bit signed integer into its wire-format varint representation * and stores it in the buffer. */ writeSignedVarint32(value: number): void; /** * Encodes a 64-bit unsigned integer into its wire-format varint representation * and stores it in the buffer. Integers that are not representable in 64 bits * will be truncated. */ writeUnsignedVarint64(value: number): void; /** * Encodes a 64-bit signed integer into its wire-format varint representation * and stores it in the buffer. Integers that are not representable in 64 bits * will be truncated. */ writeSignedVarint64(value: number): void; /** * Encodes a JavaScript integer into its wire-format, zigzag-encoded varint * representation and stores it in the buffer. */ writeZigzagVarint32(value: number): void; /** * Encodes a JavaScript integer into its wire-format, zigzag-encoded varint * representation and stores it in the buffer. Integers not representable in 64 * bits will be truncated. */ writeZigzagVarint64(value: number): void; /** * Encodes a JavaScript decimal string into its wire-format, zigzag-encoded * varint representation and stores it in the buffer. Integers not representable * in 64 bits will be truncated. */ writeZigzagVarint64String(value: string): void; /** * Writes a 64-bit hash string (8 characters @ 8 bits of data each) to the * buffer as a zigzag varint. */ writeZigzagVarintHash64(hash: string): void; /** * Writes an 8-bit unsigned integer to the buffer. Numbers outside the range * [0,2^8) will be truncated. */ writeUint8(value: number): void; /** * Writes a 16-bit unsigned integer to the buffer. Numbers outside the * range [0,2^16) will be truncated. */ writeUint16(value: number): void; /** * Writes a 32-bit unsigned integer to the buffer. Numbers outside the * range [0,2^32) will be truncated. */ writeUint32(value: number): void; /** * Writes a 64-bit unsigned integer to the buffer. Numbers outside the * range [0,2^64) will be truncated. */ writeUint64(value: number): void; /** * Writes an 8-bit integer to the buffer. Numbers outside the range * [-2^7,2^7) will be truncated. */ writeInt8(value: number): void; /** * Writes a 16-bit integer to the buffer. Numbers outside the range * [-2^15,2^15) will be truncated. */ writeInt16(value: number): void; /** * Writes a 32-bit integer to the buffer. Numbers outside the range * [-2^31,2^31) will be truncated. */ writeInt32(value: number): void; /** * Writes a 64-bit integer to the buffer. Numbers outside the range * [-2^63,2^63) will be truncated. */ writeInt64(value: number): void; /** * Writes a 64-bit integer decimal strings to the buffer. Numbers outside the * range [-2^63,2^63) will be truncated. */ writeInt64String(value: string): void; /** * Writes a single-precision floating point value to the buffer. Numbers * requiring more than 32 bits of precision will be truncated. */ writeFloat(value: number): void; /** * Writes a double-precision floating point value to the buffer. As this is * the native format used by JavaScript, no precision will be lost. */ writeDouble(value: number): void; /** * Writes a boolean value to the buffer as a varint. We allow numbers as input * because the JSPB code generator uses 0/1 instead of true/false to save space * in the string representation of the proto. */ writeBool(value: boolean | number): void; /** * Writes an enum value to the buffer as a varint. */ writeEnum(value: number): void; /** * Writes an arbitrary byte array to the buffer. */ writeBytes(bytes: Uint8Array): void; /** * Writes a 64-bit hash string (8 characters @ 8 bits of data each) to the * buffer as a varint. */ writeVarintHash64(hash: string): void; /** * Writes a 64-bit hash string (8 characters @ 8 bits of data each) to the * buffer as a fixed64. */ writeFixedHash64(hash: string): void; /** * Writes a UTF16 Javascript string to the buffer encoded as UTF8. */ writeString(value: string): number; }