import type { ReactiveController, ReactiveControllerHost } from 'lit'; export type StreamingState = 'idle' | 'connecting' | 'streaming' | 'paused' | 'complete' | 'error'; export interface StreamingControllerOptions { /** Called for each chunk of text received */ onChunk?: (chunk: string, accumulated: string) => void; /** Called when streaming completes */ onComplete?: (fullText: string) => void; /** Called on error */ onError?: (error: Error) => void; /** Called when state changes */ onStateChange?: (state: StreamingState) => void; } /** * StreamingController — manages ReadableStream lifecycle for AI text streaming. * Handles connect, pause, resume, abort, and chunk buffering. * * Used in: loquix-message-content, host applications */ export declare class StreamingController implements ReactiveController { private host; private _reader; private _chunks; private _state; private _options; private _paused; private _pendingChunks; private _generation; constructor(host: ReactiveControllerHost, options?: StreamingControllerOptions); hostConnected(): void; hostDisconnected(): void; /** Current streaming state */ get state(): StreamingState; /** Accumulated text so far */ get text(): string; /** All chunks received */ get chunks(): readonly string[]; /** Connect to a ReadableStream and start consuming */ connect(stream: ReadableStream): Promise; /** Pause streaming (chunks are buffered) */ pause(): void; /** Resume streaming (flush buffered chunks) */ resume(): void; /** Abort the current stream */ abort(): void; /** Reset to initial state */ reset(): void; private _processChunk; private _setState; } //# sourceMappingURL=streaming.controller.d.ts.map