import { HttpClient } from '../core/http-client.js'; import { InsightRequest, InsightStreamRequest, InsightResponse } from '../types/insights.types.js'; import { AIStream } from '../core/ai-stream.js'; /** * Insights API operations * * Provides AI-powered insight generation for dashboards and visualizations. * * @example * ```typescript * // Non-streaming * const insight = await client.ai.insights.get({ * dashboardId: 'my-dashboard', * type: 'summary', * }); * * // Streaming * const stream = await client.ai.insights.get({ * dashboard: revealView.dashboard, * type: 'analysis', * stream: true, * }); * for await (const event of stream) { ... } * ``` */ export declare class InsightsOperations { private httpClient; private basePath; /** * Create insights API operations. * * @param httpClient - HTTP client used to call the Reveal AI API * @param basePath - Base path for AI endpoints */ constructor(httpClient: HttpClient, basePath: string); /** * Get AI insights for a dashboard or specific visualization. * * When `stream` is omitted or false, returns a Promise that resolves * with the complete InsightResponse (uses plain JSON HTTP, no SSE). * * When `stream` is true, returns an AIStream that yields events * as they arrive from the server (SSE). The stream supports: * - `for await (const event of stream)` iteration * - `.on('text', handler)` event listeners * - `.finalResponse()` to get the aggregated InsightResponse * * @param request - Insight request parameters * @returns Insight response for non-streaming requests or AIStream for streaming requests */ get(request: InsightRequest): Promise; get(request: InsightStreamRequest): Promise>; /** * Non-streaming path: POST with Accept: application/json, get plain JSON back */ private getNonStreaming; /** * Streaming path: POST with Accept: text/event-stream, return AIStream */ private getStreaming; /** * Build the server request body from the client request object */ private buildRequestBody; private capitalizeFirst; } //# sourceMappingURL=insights.d.ts.map