import type { InsightEngine } from '../../../app/insight-engine/insight-engine.js'; import type { SearchEngine } from '../../../app/search-engine/search-engine.js'; import type { FollowUpAnswersState } from '../../../features/follow-up-answers/follow-up-answers-state.js'; import type { GeneratedAnswerState } from '../../../index.js'; import { type GeneratedAnswer, type GeneratedAnswerAnalyticsClient, type GeneratedAnswerProps } from '../../core/generated-answer/headless-core-generated-answer.js'; export interface GeneratedAnswerWithFollowUpsState extends GeneratedAnswerState { followUpAnswers: FollowUpAnswersState; } export interface GeneratedAnswerWithFollowUps extends GeneratedAnswer { /** * The state of the GeneratedAnswer controller. */ state: GeneratedAnswerWithFollowUpsState; /** * Marks the answer as liked. * @param answerId - Optional ID of the answer to like. Defaults to the first answer. */ like(answerId?: string): void; /** * Marks the answer as disliked. * @param answerId - Optional ID of the answer to dislike. Defaults to the first answer. */ dislike(answerId?: string): void; /** * Logs a custom event indicating a cited source link was hovered. * @param citationId - The ID of the hovered citation. * @param citationHoverTimeMs - The number of milliseconds spent hovering over the citation. * @param answerId - Optional ID of the answer for which the citation was hovered. Defaults to the first answer. */ logCitationHover(citationId: string, citationHoverTimeMs: number, answerId?: string): void; /** * Logs a click on a cited source link for analytics. * @param citationId - The ID of the clicked citation. * @param answerId - Optional ID of the answer for which the citation was clicked. Defaults to the first answer. */ logCitationClick(citationId: string, answerId?: string): void; /** * Logs a copy-to-clipboard interaction for analytics. * @param answerId - Optional ID of the copied answer. Defaults to the first answer. */ logCopyToClipboard(answerId?: string): void; /** * Asks a follow-up question. * @param question - The follow-up question to ask. */ askFollowUp(question: string): void; } export type GeneratedAnswerWithFollowUpsProps = GeneratedAnswerProps & Required>; /** * * @internal * * Creates a `GeneratedAnswerWithFollowUps` controller instance using the Answer API stream pattern. * * @param engine - The headless engine. * @param props - The configurable `GeneratedAnswerWithFollowUps` properties. * @returns A `GeneratedAnswerWithFollowUps` controller instance. */ export declare function buildGeneratedAnswerWithFollowUps(engine: SearchEngine | InsightEngine, analyticsClient: GeneratedAnswerAnalyticsClient, props: GeneratedAnswerWithFollowUpsProps): GeneratedAnswerWithFollowUps;