interface IBinaryWriter {
    bool(value): IBinaryWriter;
    bytes(value): IBinaryWriter;
    double(value): IBinaryWriter;
    finish(): Uint8Array;
    fixed32(value): IBinaryWriter;
    fixed64(value): IBinaryWriter;
    float(value): IBinaryWriter;
    fork(): IBinaryWriter;
    int32(value): IBinaryWriter;
    int64(value): IBinaryWriter;
    join(): IBinaryWriter;
    raw(chunk): IBinaryWriter;
    sfixed32(value): IBinaryWriter;
    sfixed64(value): IBinaryWriter;
    sint32(value): IBinaryWriter;
    sint64(value): IBinaryWriter;
    string(value): IBinaryWriter;
    tag(fieldNo, type): IBinaryWriter;
    uint32(value): IBinaryWriter;
    uint64(value): IBinaryWriter;
}

Methods

  • Write a bool value, a variant.

    Parameters

    • value: boolean

    Returns IBinaryWriter

  • Write a bytes value, length-delimited arbitrary data.

    Parameters

    • value: Uint8Array

    Returns IBinaryWriter

  • Write a double value, a 64-bit floating point number.

    Parameters

    • value: number

    Returns IBinaryWriter

  • Return all bytes written and reset this writer.

    Returns Uint8Array

  • Write a fixed32 value, an unsigned, fixed-length 32-bit integer.

    Parameters

    • value: number

    Returns IBinaryWriter

  • Write a fixed64 value, an unsigned, fixed-length 64 bit integer.

    Parameters

    • value: string | number | bigint

    Returns IBinaryWriter

  • Write a float value, 32-bit floating point number.

    Parameters

    • value: number

    Returns IBinaryWriter

  • Start a new fork for length-delimited data like a message or a packed repeated field.

    Must be joined later with join().

    Returns IBinaryWriter

  • Write a int32 value, a signed 32 bit varint.

    Parameters

    • value: number

    Returns IBinaryWriter

  • Write a int64 value, a signed 64-bit varint.

    Parameters

    • value: string | number | bigint

    Returns IBinaryWriter

  • Join the last fork. Write its length and bytes, then return to the previous state.

    Returns IBinaryWriter

  • Write a chunk of raw bytes.

    Parameters

    • chunk: Uint8Array

    Returns IBinaryWriter

  • Write a sfixed32 value, a signed, fixed-length 32-bit integer.

    Parameters

    • value: number

    Returns IBinaryWriter

  • Write a fixed64 value, a signed, fixed-length 64-bit integer.

    Parameters

    • value: string | number | bigint

    Returns IBinaryWriter

  • Write a sint32 value, a signed, zigzag-encoded 32-bit varint.

    Parameters

    • value: number

    Returns IBinaryWriter

  • Write a sint64 value, a signed, zig-zag-encoded 64-bit varint.

    Parameters

    • value: string | number | bigint

    Returns IBinaryWriter

  • Write a string value, length-delimited data converted to UTF-8 text.

    Parameters

    • value: string

    Returns IBinaryWriter

  • Writes a tag (field number and wire type).

    Equivalent to uint32( (fieldNo << 3 | type) >>> 0 )

    Generated code should compute the tag ahead of time and call uint32().

    Parameters

    Returns IBinaryWriter

  • Write a uint32 value, an unsigned 32 bit varint.

    Parameters

    • value: number

    Returns IBinaryWriter

  • Write a uint64 value, an unsigned 64-bit varint.

    Parameters

    • value: string | number | bigint

    Returns IBinaryWriter

Generated using TypeDoc