import { ThoughtNode, ThoughtSSEMeta } from '../thought_chain_types';
/**
 * SSE 消息接口（通用）
 */
export interface SSEMessage extends ThoughtSSEMeta {
    sessionId: string;
    queryId: string;
    lastDate: string | number;
    status: number;
    reply: {
        content: string;
        type: string;
        errorMsg?: string | null;
        errorCode?: string | null;
    };
    reference?: any;
    webReference?: any;
    graphReference?: any;
    databaseReference?: any;
    knowledgeBases?: any;
    faqReference?: any;
    resultType?: number;
    respTime?: number;
    chainRespTime?: number;
    tokens?: number;
    enableCot?: number;
    llmType?: number;
    llmConfig?: {
        model?: string;
        temperature?: number;
        diversity?: number;
        maxTokens?: number;
    };
    prompt?: string;
    retrieveInfo?: any;
    retrieveConfig?: any;
}
/**
 * 解析 SSE 数据
 */
export declare function parseSSEData(data: string): SSEMessage | null;
/**
 * 思维链处理回调接口
 */
export interface ThoughtChainCallbacks {
    onThoughtNodesUpdate: (updater: (prev: ThoughtNode[]) => ThoughtNode[]) => void;
    onChainRespTimeUpdate: (time: number) => void;
    onStatusUpdate?: (status: number) => void;
}
/**
 * 消息更新回调接口
 */
export interface MessageUpdateCallbacks {
    onContentUpdate: (content: string) => void;
    onStatusUpdate: (status: 'ready' | 'processing') => void;
    onReferencesUpdate: (references: {
        reference?: any;
        webReference?: any;
        graphReference?: any;
        databaseReference?: any;
        knowledgeBases?: any;
        faqReference?: any;
        resultType?: number;
        respTime?: number;
    }) => void;
    onRetrieveDataUpdate?: (data: {
        llmConfig?: any;
        prompt?: string;
        retrieveInfo?: any;
        retrieveConfig?: any;
    }) => void;
}
/**
 * 处理思维链节点更新（status=4）
 */
export declare function handleThoughtChainUpdate(parsed: SSEMessage, thoughtChainCallbacks: ThoughtChainCallbacks): void;
/**
 * 处理正文内容更新（status=1）
 */
export declare function handleContentUpdate(parsed: SSEMessage, thoughtChainCallbacks: ThoughtChainCallbacks, messageCallbacks: MessageUpdateCallbacks): void;
/**
 * 处理完成状态（status=2）
 */
export declare function handleCompleteStatus(parsed: SSEMessage, thoughtChainCallbacks: ThoughtChainCallbacks, messageCallbacks: MessageUpdateCallbacks): void;
/**
 * 处理其他状态的内容更新
 */
export declare function handleOtherStatusContent(parsed: SSEMessage, messageCallbacks: MessageUpdateCallbacks): void;
/**
 * 处理引用数据更新
 */
export declare function handleReferencesUpdate(parsed: SSEMessage, messageCallbacks: MessageUpdateCallbacks): void;
/**
 * 处理召回聊天特有数据更新
 */
export declare function handleRetrieveDataUpdate(parsed: SSEMessage, messageCallbacks: MessageUpdateCallbacks): void;
/**
 * 计算 SSE 延迟时间
 * 优先处理 status=1 的正文内容（打字机效果），使用更快的速度
 */
export declare function calculateSSEDelay(parsed: SSEMessage, baseInterval: number, lastNodeStatus: Map<string, number>, lastNodeTime: Map<string, number>): number;
/**
 * 模拟 SSE 流式输出，根据节点状态和 chainRespTime 设置动态延迟
 * 支持思维链处理和普通内容处理
 */
export declare function simulateSSE(dataLines: string[], onMessage: (event: {
    data: string;
}) => void, onClose: () => void, baseInterval?: number): () => void;
/**
 * 处理 SSE 消息的完整流程
 * 统一处理思维链、正文内容、引用数据等
 */
export declare function processSSEMessage(parsed: SSEMessage, thoughtChainCallbacks: ThoughtChainCallbacks, messageCallbacks: MessageUpdateCallbacks): void;
