/** * Streaming Utilities * Provides streaming support for large results */ export interface StreamOptions { chunkSize?: number; delayMs?: number; onProgress?: (progress: number, total: number) => void; } /** * Stream large text content in chunks * @param content - The text content to stream. * @param options - Streaming options (chunkSize, delayMs, onProgress). * @returns An async generator yielding string chunks. */ export declare function streamContent(content: string, options?: StreamOptions): AsyncGenerator; /** * Stream array results in batches * @param items - The array of items to stream. * @param options - Streaming options (chunkSize, delayMs, onProgress). * @returns An async generator yielding batches of items. */ export declare function streamArray(items: T[], options?: StreamOptions): AsyncGenerator; /** * Format streaming response with progress * @param chunks - The chunks to format. * @param metadata - Metadata with total and processed counts. * @param metadata.total - Total number of items. * @param metadata.processed - Number of items processed. * @returns A formatted string with progress indicator. */ export declare function formatStreamingResponse(chunks: string[], metadata: { total: number; processed: number; }): string; /** * Wrap a long-running operation with timeout * @param operation - The promise to wrap with a timeout. * @param timeoutMs - The timeout duration in milliseconds. * @param operationName - A name for the operation (used in error messages). * @returns The result of the operation. */ export declare function withTimeout(operation: Promise, timeoutMs: number, operationName?: string): Promise; /** * Truncate large results with summary * @param items - The array of items to truncate. * @param maxItems - Maximum number of items to keep. * @returns An object with truncated items and metadata. */ export declare function truncateResults(items: T[], maxItems: number): { items: T[]; truncated: boolean; total: number; shown: number; }; //# sourceMappingURL=streaming.d.ts.map