import { AudioFrame } from '@livekit/rtc-node';
import type { Span } from '@opentelemetry/api';
import { type ReadableStream } from 'stream/web';
import type { AdaptiveInterruptionDetector } from './interruption_detector.js';
import { type AgentSpeechEnded, type AgentSpeechStarted, type ApiConnectOptions, type Flush, type InterruptionSentinel, type OverlapSpeechEnded, type OverlapSpeechStarted, type OverlappingSpeechEvent } from './types.js';
export type { AgentSpeechEnded, AgentSpeechStarted, ApiConnectOptions, Flush, InterruptionSentinel, OverlapSpeechEnded, OverlapSpeechStarted, };
export declare class InterruptionStreamSentinel {
    static agentSpeechStarted(): AgentSpeechStarted;
    static agentSpeechEnded(): AgentSpeechEnded;
    static overlapSpeechStarted(speechDuration: number, startedAt: number, userSpeakingSpan?: Span): OverlapSpeechStarted;
    static overlapSpeechEnded(endedAt: number): OverlapSpeechEnded;
    static flush(): Flush;
}
export declare class InterruptionStreamBase {
    private inputStream;
    private eventStream;
    private resampler?;
    private numRequests;
    private userSpeakingSpan;
    private overlapSpeechStartedAt;
    private options;
    private apiOptions;
    private model;
    private logger;
    private wsReconnect?;
    private wsClose?;
    private transportOptions;
    constructor(model: AdaptiveInterruptionDetector, apiOptions: Partial<ApiConnectOptions>);
    /**
     * Update stream options. For WebSocket transport, this triggers a reconnection.
     */
    updateOptions(options: {
        threshold?: number;
        minInterruptionDurationInS?: number;
    }): Promise<void>;
    private setupTransform;
    private ensureInputNotEnded;
    private ensureStreamsNotEnded;
    private getResamplerFor;
    stream(): ReadableStream<OverlappingSpeechEvent>;
    pushFrame(frame: InterruptionSentinel | AudioFrame): Promise<void>;
    flush(): Promise<void>;
    endInput(): Promise<void>;
    close(): Promise<void>;
}
//# sourceMappingURL=interruption_stream.d.ts.map