import React from "react"; import { ReactNextElement } from "@next-core/react-element"; import "@next-core/theme"; import type { ExampleProject, RequestStore, ShowCaseType, UploadOptions } from "../shared/interfaces.js"; import type { AIEmployee, Command } from "../shared/ChatCompletions/useChatCompletions.js"; export interface ChatStreamProps { conversationId?: string; initialRequest?: RequestStore | null; replay?: boolean; replayDelay?: number; supports?: Record; showHumanActions?: boolean; showFeedback?: boolean; showFeedbackAfterFailed?: boolean; showFeedbackOnView?: boolean; showUiSwitch?: boolean; previewUrlTemplate?: string; showCases?: ShowCaseType[]; exampleProjects?: ExampleProject[]; tryItOutUrl?: string; aiEmployees?: AIEmployee[]; commands?: Command[]; uploadOptions?: UploadOptions; hideMermaid?: boolean; } export interface ConversationDetail { projectId?: string; } /** * AI 对话流视图,以聊天气泡形式展示对话过程,支持文件上传、命令联想、回放及用户反馈等功能。 * * @description AI 对话流视图,以聊天气泡形式展示对话过程,支持文件上传、命令联想、回放及用户反馈等功能。 * @category ai-portal */ export declare class ChatStream extends ReactNextElement implements ChatStreamProps { #private; /** * 对话 ID */ accessor conversationId: string | undefined; /** 初始请求数据。仅初始设置有效。 */ accessor initialRequest: RequestStore | undefined | null; /** 是否启用回放。仅初始设置有效。 */ accessor replay: boolean | undefined; /** * 设置回放时消息之间的时间间隔,单位为秒。仅初始设置有效。 * * @default 2 */ accessor replayDelay: number | undefined; /** * 功能开关配置,键为功能名,值为是否启用 */ accessor supports: Record | undefined; /** * 是否显示 Human-in-the-loop 操作按钮 */ accessor showHumanActions: boolean | undefined; /** * 是否显示反馈按钮 */ accessor showFeedback: boolean | undefined; /** * 是否在任务失败时也显示反馈按钮 */ accessor showFeedbackAfterFailed: boolean | undefined; /** * 是否在查看生成视图时显示反馈按钮 */ accessor showFeedbackOnView: boolean | undefined; /** * 是否显示切换到画布视图的按钮 */ accessor showUiSwitch: boolean | undefined; /** * 是否隐藏 Mermaid 图表渲染,通过 CSS 属性选择器控制样式 */ accessor hideMermaid: boolean | undefined; /** * 生成视图预览页的 URL 模板,支持 {viewId} 等字段插值 */ accessor previewUrlTemplate: string | undefined; /** * 示例场景列表,用于在空对话时展示快速入口 */ accessor showCases: ShowCaseType[] | undefined; /** * 示例项目列表,用于展示可参考的已有项目 */ accessor exampleProjects: ExampleProject[] | undefined; /** * "试一试"跳转 URL */ accessor tryItOutUrl: string | undefined; /** * 可 @ 提及的数字人列表 */ accessor aiEmployees: AIEmployee[] | undefined; /** * 命令列表,支持通过 / 或搜索触发联想 */ accessor commands: Command[] | undefined; /** * 文件上传配置 */ accessor uploadOptions: UploadOptions | undefined; /** * 通知组件任务已恢复,用于继续中断的对话 */ resumed(): void; /** * 通知组件反馈提交成功 */ feedbackSubmitDone(): void; /** * 通知组件反馈提交失败 */ feedbackSubmitFailed(): void; /** * 通知组件查看视图的反馈处理完成 * @param viewId 对应的视图 ID */ feedbackOnViewDone(viewId: string): void; render(): React.JSX.Element; } export interface ChatStreamRef { resumed?: () => void; feedbackSubmitDone: () => void; feedbackSubmitFailed: () => void; feedbackOnViewDone: (viewId: string) => void; }