/**
 * Streaming Adapter Interface
 *
 * 定义统一的流式请求接口，抽象平台差异
 */

export interface StreamConfig {
  url: string;
  method?: 'GET' | 'POST';
  data?: any;
  headers?: Record<string, string>;
  onMessage: (chunk: any) => void;
  onError?: (error: any) => void;
  onComplete?: () => void;
}

export interface IStreamingAdapter {
  /**
   * 创建流式连接
   */
  connect(config: StreamConfig): Promise<void>;

  /**
   * 关闭流式连接
   */
  disconnect(): void;

  /**
   * 检查连接状态
   */
  isConnected(): boolean;
}
