func (w writer) WriteInt32(field int, value int32) {
	w.Call("writeInt32", field, value)
}
WriteInt32 writes an int32 field to the buffer.
package jspb
import "github.com/gopherjs/gopherjs/js"
type Writer interface {
	GetResult() []byte
	WriteInt32(int, int32)
	WriteInt64(int, int64)
	WriteUint32(int, uint32)
	WriteUint64(int, uint64)
	WriteSint32(int, int32)
	WriteSint64(int, int64)
	WriteFixed32(int, uint32)
	WriteFixed64(int, uint64)
	WriteSfixed32(int, int32)
	WriteSfixed64(int, int64)
	WriteFloat32(int, float32)
	WriteFloat64(int, float64)
	WriteEnum(int, int)
	WriteBool(int, bool)
	WriteString(int, string)
	WriteBytes(int, []byte)
	WriteInt32Slice(int, []int32)
	WriteInt64Slice(int, []int64)
	WriteUint32Slice(int, []uint32)
	WriteUint64Slice(int, []uint64)
	WriteSint32Slice(int, []int32)
	WriteSint64Slice(int, []int64)
	WriteFixed32Slice(int, []uint32)
	WriteFixed64Slice(int, []uint64)
	WriteSfixed32Slice(int, []int32)
	WriteSfixed64Slice(int, []int64)
	WriteFloat32Slice(int, []float32)
	WriteFloat64Slice(int, []float64)
	WriteBoolSlice(int, []bool)
	WriteEnumSlice(int, []int)
	WriteMessage(int, func())
}
type encoder struct {
	*js.Object
}
func (e encoder) WriteInt64(value int64) {
	e.Call("writeSplitVarint64", value&0xffffffff, uint64(value)>>32)
}
func (e encoder) WriteUint64(value uint64) {
	e.Call("writeSplitVarint64", value&0xffffffff, value>>32)
}
func (e encoder) WriteZigzag64(value int64) {
	v := (uint64(value) << 1) ^ uint64(value>>63)
	e.WriteUint64(v)
}
func (e encoder) WriteFixed64(value uint64) {
	e.Call("writeSplitFixed64", value&0xffffffff, value>>32)
}
func (e encoder) WriteSignedFixed64(value int64) {
	e.Call("writeSplitFixed64", value&0xffffffff, uint64(value)>>32)
}
func NewWriter() Writer {
	w := &writer{
		Object: js.Global.Get("BinaryWriter").New(),
	}
	w.encoder = &encoder{
		Object: w.Get("encoder_"),
	}
	return w
}
type writer struct {
	*js.Object
	encoder *encoder
}
type wireType int
const (
	varint wireType = iota
	fixed64
	delimited
	startGroup
	endGroup
	fixed32
)
func (w writer) GetResult() []byte {
	return w.Call("getResultBuffer").Interface().([]byte)
}