import { HttpClient } from '@sisense/sdk-rest-client'; import { WidgetProps } from '../../domains/widgets/components/widget/types'; /** * Pure function that fetches NLG insights from WidgetProps. * * This function converts WidgetProps to the required API format and makes an HTTP request * to get natural language insights about the chart or pivot data. * * @param props - WidgetProps containing chart or pivot configuration (`config.narrative` * drives {@link WidgetNarrativeConfig}) * @param httpClient - HttpClient instance for making API requests * @returns Promise that resolves to the NLG insights answer string * @throws Error if dataSource cannot be resolved or if API response is invalid * @example * ```typescript * import { getNlgInsightsFromWidget } from '@sisense/sdk-ui/ai'; * import { HttpClient } from '@sisense/sdk-rest-client'; * * const widgetProps: WidgetProps = { * chartType: 'bar', * dataOptions: { category: [...], value: [...] }, * dataSource: 'Sample ECommerce', * filters: [...], * }; * * const httpClient = new HttpClient(url, auth, env); * * const insights = await getNlgInsightsFromWidget(widgetProps, httpClient); * ``` * @internal */ export declare function getNlgInsightsFromWidget(props: WidgetProps, httpClient: HttpClient): Promise;