/** * export/protobuf.ts — a minimal, dependency-free protobuf (proto3) wire writer. * * Just enough of the encoding to emit an ONNX `ModelProto` (see {@link ./onnx}): * varint, fixed32 (for float tensors), and length-delimited (string / bytes / * nested message) fields. Keeping it tiny and self-contained preserves the * engine's zero-runtime-dependency guarantee — no `protobufjs`, no `onnx` proto. * * Only non-negative integers are emitted (all ONNX ids here are ≥ 0), so the * varint path uses plain division and stays correct up to 2^53. */ /** Accumulates protobuf-encoded bytes for one message. */ export declare class ProtoWriter { private readonly parts; private byte; private rawVarint; private tag; private rawBytes; /** A varint field (int32 / int64 / bool / enum). */ varint(field: number, value: number): void; /** A 32-bit IEEE-754 float field (wire type fixed32, little-endian). */ float(field: number, value: number): void; /** A length-delimited raw-bytes field. */ bytes(field: number, data: Uint8Array): void; /** A length-delimited UTF-8 string field. */ string(field: number, value: string): void; /** A nested-message field (the sub-message encoded as length-delimited bytes). */ message(field: number, sub: ProtoWriter): void; /** The encoded bytes of this message. */ finish(): Uint8Array; } /** Pack a Float32Array into little-endian raw bytes (for TensorProto.raw_data). */ export declare function float32ToBytes(data: Float32Array): Uint8Array; //# sourceMappingURL=protobuf.d.ts.map