import type { Message, TTSParams, ChatFile } from './api';
export type IOSAudioMode = 'baseline' | 'aec' | 'aec_full';
export interface GatewayConfig {
    url: string;
    token: string;
    audioProfile?: 'standard' | 'asr_priority';
    iosAudioMode?: IOSAudioMode;
    autoReconnect?: boolean;
    reconnectInterval?: number;
    maxReconnectAttempts?: number;
    heartbeatInterval?: number;
}
export type GatewayMessageType = 'chat' | 'tts' | 'asr' | 'heartbeat' | 'error';
export interface GatewayRequestBase {
    type: GatewayMessageType;
    requestId: string;
    timestamp?: number;
}
export interface GatewayResponseBase {
    type: GatewayMessageType;
    event: string;
    requestId?: string;
    timestamp?: number;
}
export interface ChatRequestData {
    message: Message[];
    conversationId?: string;
    model?: string;
    files?: ChatFile[];
    inputs?: Record<string, any>;
    stream?: boolean;
}
export interface ChatRequest extends GatewayRequestBase {
    type: 'chat';
    data: ChatRequestData;
}
export interface ChatResponseData {
    event: 'message' | 'message_end' | 'error';
    conversationId: string;
    messageId: string;
    answer: string;
    errorMessage?: string;
}
export interface ChatResponse extends GatewayResponseBase {
    type: 'chat';
    data: ChatResponseData;
}
export interface TTSRequestData extends TTSParams {
    content: string;
}
export interface TTSRequest extends GatewayRequestBase {
    type: 'tts';
    data: TTSRequestData;
}
export interface TTSResponseData {
    event: 'audio' | 'audio_end' | 'error';
    audio?: ArrayBuffer | string;
    blendShapes?: number[][];
    duration?: number;
    sampleRate?: number;
    errorMessage?: string;
}
export interface TTSResponse extends GatewayResponseBase {
    type: 'tts';
    data: TTSResponseData;
}
export interface ASRRequestData {
    audio: ArrayBuffer;
    sampleRate: number;
    language?: string;
    isLast?: boolean;
}
export interface ASRRequest extends GatewayRequestBase {
    type: 'asr';
    data: ASRRequestData;
}
export interface ASRResponseData {
    event: 'text' | 'text_end' | 'error';
    text: string;
    isFinal: boolean;
    confidence?: number;
    errorMessage?: string;
}
export interface ASRResponse extends GatewayResponseBase {
    type: 'asr';
    data: ASRResponseData;
}
export interface HeartbeatRequest extends GatewayRequestBase {
    type: 'heartbeat';
    data: {
        ping: string;
    };
}
export interface HeartbeatResponse extends GatewayResponseBase {
    type: 'heartbeat';
    data: {
        pong: string;
    };
}
export interface ErrorResponse extends GatewayResponseBase {
    type: 'error';
    data: {
        code: string | number;
        message: string;
        details?: any;
    };
}
export type GatewayRequest = ChatRequest | TTSRequest | ASRRequest | HeartbeatRequest;
export type GatewayResponse = ChatResponse | TTSResponse | ASRResponse | HeartbeatResponse | ErrorResponse;
export declare enum WebSocketState {
    CONNECTING = 0,
    OPEN = 1,
    CLOSING = 2,
    CLOSED = 3
}
export declare enum GatewayState {
    DISCONNECTED = "disconnected",
    CONNECTING = "connecting",
    CONNECTED = "connected",
    RECONNECTING = "reconnecting",
    CLOSED = "closed"
}
//# sourceMappingURL=gateway.d.ts.map