export { MultipartReader }; /** * Pull-based sequential multipart reader. * * Parts are consumed strictly in wire order. Each call to `readNextPartAsText()` * advances to the next part sequentially. * * `consumePart(key)` reads file parts by key. Concurrent calls are * serialized via a promise queue: * - In-order: `file1.text(); file2.text()` — file2 waits for file1, zero buffering, no warning. * - Out-of-order: `file2.text(); file1.text()` — warns, drains file1, streams file2. file1 unreadable. */ declare class MultipartReader { #private; constructor(bodyStream: ReadableStream, boundary: string); /** Read the next part's body as a UTF-8 string. Returns null if no more parts. */ readNextPartAsText(expectedKey?: string): Promise; /** * Consume file part by its multipart `key` (e.g. `__telefunc_multipart_0`). * * Concurrent calls are serialized — each waits for the previous stream to * be fully consumed before reading from the wire: * `file1.stream().pipeTo(w1); file2.stream().pipeTo(w2)` — works, no warning. * * Out-of-order access warns and drains skipped parts (they become unreadable). */ consumePart(key: string): Promise>; }