/**
 * Shared stream utilities for AWS protocols.
 * Provides helpers for converting between Effect Streams, ReadableStreams, and text.
 */
import * as Effect from "effect/Effect";
import * as Stream from "effect/Stream";
import type { StreamingInputBody } from "../traits.ts";
export declare const readEffectStreamAsText: <Err>(stream: Stream.Stream<Uint8Array, Err>) => Effect.Effect<string, Err>;
/**
 * Read a ReadableStream as text (for non-streaming responses).
 * This is lazy - only consumes when called.
 */
export declare const readStreamAsText: (stream: string | ReadableStream<Uint8Array>) => Effect.Effect<string>;
/**
 * Convert Effect Stream to ReadableStream for fetch.
 */
export declare const effectStreamToReadable: <Err>(stream: Stream.Stream<Uint8Array, Err>) => ReadableStream<Uint8Array<ArrayBufferLike>>;
/**
 * Check if a value is an Effect Stream.
 * Uses duck typing since Stream doesn't have a built-in type guard.
 */
export declare function isEffectStream(u: unknown): u is Stream.Stream<unknown, unknown, unknown>;
/**
 * Convert various streaming input types to a format suitable for fetch.
 * Handles strings, Uint8Array, ArrayBuffer, Blob, ReadableStream, and Effect Stream.
 */
export declare function convertStreamingInput(value: string | StreamingInputBody): string | Uint8Array | ReadableStream<Uint8Array>;
/**
 * Create an Effect Stream from a ReadableStream (for streaming responses).
 */
export declare const readableToEffectStream: (stream: string | ReadableStream<Uint8Array>) => Stream.Stream<Uint8Array, Error, never>;
/**
 * Create a buffered ReadableStream that ensures chunks meet minimum size.
 * This matches AWS SDK's createBufferedReadableStream behavior.
 *
 * Small chunks are accumulated until they reach the minimum size.
 * Chunks already at or above minimum size pass through immediately (if buffer is empty).
 * The last chunk can be any size.
 */
export declare function createBufferedReadableStream(upstream: ReadableStream<Uint8Array>, minSize: number): ReadableStream<Uint8Array>;
//# sourceMappingURL=stream.d.ts.map