/// import type { IMessage, FileItem, UploadRequestFn, ChatStrategies } from "../../../types"; import type { ChatConfig } from "../../../services/api"; /** * 聊天状态 Context * 只包含状态数据,不包含操作方法 * 这样可以避免不必要的 rerender */ export interface ChatStateContextType { /** 请求地址 */ url: string; /** 会话令牌 */ token: string; /** 消息列表 */ messages: IMessage[]; /** 加载状态 */ loading: boolean; /** 当前会话 ID */ currentSessionId: string; /** 开场白 */ prologue: string; /** 建议问题列表 */ suggestions: string[]; /** 应用配置信息 */ appInfo: ChatConfig | null; /** 是否已初始化 */ initialized: boolean; /** 是否展示点赞/点踩 */ showFeedback: boolean; /** 点击附件回调 */ onFileClick?: (file: FileItem) => void; onConfirm?: () => void; /** 自定义上传函数 */ uploadRequest?: UploadRequestFn; /** 当前 Provider 生效的聊天策略 */ strategies: ChatStrategies; } export declare const ChatStateContext: import("react").Context; /** * 使用聊天状态 Hook * @returns ChatStateContextType * @throws Error 如果在 XAdkProvider 外部使用 */ export declare const useChatState: () => ChatStateContextType;