export type SerializedPart = { name: string; contentType: string; data: Uint8Array; }; export type RunEncoding = "zstd" | "gzip"; /** * A multipart body compressed as runs are written, so a batch waiting to * upload holds compressed bytes, not run objects. */ export declare class CompressedRunBuffer { readonly encoding: RunEncoding; readonly boundary: string; /** Uncompressed bytes written, for batch size limits. */ uncompressedSize: number; /** Number of operations written. */ count: number; readonly context: string[]; /** Called once this batch is sent. */ readonly onSent: (() => void)[]; private writer; private chunks; private readDone; constructor(encoding?: RunEncoding); /** zstd if the server takes it and this runtime has it, else gzip. */ static pickEncoding(serverAllowsZstd: boolean): RunEncoding | undefined; /** Resolves once the compressor has taken the bytes, so the caller can drop them. */ writeParts(parts: SerializedPart[], context: string, onSent: () => void): Promise; /** Close the multipart body and return the compressed bytes. */ close(): Promise>; private _write; }