import Emittery from 'emittery';
import GatewayService from '@/services/GatewayService';
import FramePlayer from '@/utils/framePlayer';
export type VoiceState = 'SLEEPING' | 'IDLE' | 'LISTENING' | 'THINKING' | 'SPEAKING';
export interface VoiceError {
    code: 'WEBRTC_FAILED' | 'ASR_ERROR' | 'LLM_TIMEOUT' | 'LLM_ERROR' | 'TTS_FAILED' | 'GATEWAY_DISCONNECTED';
    message: string;
    recoverable: boolean;
}
export interface VoiceConversationE2EConfig {
    gateway: GatewayService;
    renderer: any;
    framePlayer: FramePlayer;
    characterId: string;
    wakeWords?: string[];
    exitWords?: string[];
    interruptWords?: string[];
    idleTimeout?: number;
    autoWake?: boolean;
    echoDetection?: boolean;
    doubleWakeWord?: boolean;
    bargeInStrictMode?: boolean;
    continuousWindowMs?: number;
    gracefulExitEnabled?: boolean;
    gracefulExitPrompt?: string;
    animations?: {
        wake?: string;
        idle: string;
        talk: string | string[];
    };
    onStateChange?: (state: VoiceState, prevState: VoiceState) => void;
    onTranscript?: (text: string, isFinal: boolean) => void;
    onResponse?: (text: string) => void;
    onError?: (error: VoiceError) => void;
}
export declare class VoiceConversationE2E extends Emittery {
    private _config;
    private _state;
    private _conversationId;
    private _isStarted;
    private isTransitioning;
    private pendingTransition;
    private textBuffer;
    private lastTranscript;
    private llmResponseText;
    private echoDetector;
    private effectiveWakeWords;
    private effectiveInterruptWords;
    private idleTimer;
    private gracefulExitPhase;
    private ttsDataEnded;
    private isReceivingTTSAudio;
    private wakeTimestamp;
    private ttsEndTimestamp;
    private boundHandleTTSPlayStart;
    private boundHandleTTSPlayEnd;
    constructor(config: VoiceConversationE2EConfig);
    getState(): VoiceState;
    isStarted(): boolean;
    start(): Promise<void>;
    stop(): Promise<void>;
    destroy(): void;
    wake(): void;
    sleep(): void;
    sendText(_text: string): Promise<void>;
    private handleASRResult;
    private handleASRInSleeping;
    private handleASRInIdle;
    private handleASRInListening;
    private handleListeningFinal;
    private handleASRInSpeaking;
    private handleLLMResponse;
    private handleTTSPlayStart;
    private handleTTSPlayEnd;
    private handleInterrupt;
    private handleSleep;
    private startIdleTimer;
    private clearIdleTimer;
    private transitionTo;
    private onEnterState;
}
export default VoiceConversationE2E;
//# sourceMappingURL=voice-conversation-e2e.d.ts.map