import { ApiConfig, SuggestedQuestion, EventAction, ParaSource, ChatMessage } from '../types/index.js'; import 'react'; /** * 移动端聊天服务层 * 基于 @icos-react/largemodel 的 apiService + messageService 适配 * 纯浏览器 API,无第三方依赖 */ declare function getAuthToken(): string | null; declare function sendChatRequest(config: ApiConfig, message: string, sessionId?: string, signal?: AbortSignal): Promise; declare function fetchSessionId(url?: string): Promise; interface StreamCallbacks { onChunk: (text: string) => void; onDone: (fullText: string) => void; onError: (err: Error) => void; onSuggestedQuestions?: (questions: SuggestedQuestion[]) => void; onAction?: (actions: EventAction[]) => void; onPara?: (para: ParaSource[]) => void; } /** * 消费 SSE 流,通过回调逐步更新 UI */ declare function consumeStream(response: Response, callbacks: StreamCallbacks): Promise; declare function createUserMessage(content: string): ChatMessage; declare function createAssistantMessage(partial?: string): ChatMessage; export { StreamCallbacks, consumeStream, createAssistantMessage, createUserMessage, fetchSessionId, getAuthToken, sendChatRequest };