import type { RealtimeConnection, AudioFormat, CommitStrategy } from "@elevenlabs/client"; export type ScribeStatus = "disconnected" | "connecting" | "connected" | "transcribing" | "error"; export interface WordTimestamp { text?: string; /** Start time in seconds */ start?: number; /** End time in seconds */ end?: number; type?: "word" | "spacing"; speaker_id?: string; logprob?: number; characters?: string[]; } export interface TranscriptSegment { id: string; text: string; timestamp: number; isFinal: boolean; /** Word-level timestamps (only present when includeTimestamps is enabled) */ words?: WordTimestamp[]; } export interface ScribeCallbacks { onSessionStarted?: () => void; onPartialTranscript?: (data: { text: string; }) => void; onCommittedTranscript?: (data: { text: string; }) => void; onCommittedTranscriptWithTimestamps?: (data: { text: string; words?: WordTimestamp[]; }) => void; /** Called for any error (also called when specific error callbacks fire) */ onError?: (error: Error | Event) => void; onAuthError?: (data: { error: string; }) => void; onQuotaExceededError?: (data: { error: string; }) => void; onCommitThrottledError?: (data: { error: string; }) => void; onTranscriberError?: (data: { error: string; }) => void; onUnacceptedTermsError?: (data: { error: string; }) => void; onRateLimitedError?: (data: { error: string; }) => void; onInputError?: (data: { error: string; }) => void; onQueueOverflowError?: (data: { error: string; }) => void; onResourceExhaustedError?: (data: { error: string; }) => void; onSessionTimeLimitExceededError?: (data: { error: string; }) => void; onChunkSizeExceededError?: (data: { error: string; }) => void; onInsufficientAudioActivityError?: (data: { error: string; }) => void; onConnect?: () => void; onDisconnect?: () => void; } export interface ScribeHookOptions extends ScribeCallbacks { token?: string; modelId?: string; baseUri?: string; commitStrategy?: CommitStrategy; vadSilenceThresholdSecs?: number; vadThreshold?: number; minSpeechDurationMs?: number; minSilenceDurationMs?: number; languageCode?: string; microphone?: { deviceId?: string; echoCancellation?: boolean; noiseSuppression?: boolean; autoGainControl?: boolean; channelCount?: number; }; audioFormat?: AudioFormat; sampleRate?: number; autoConnect?: boolean; includeTimestamps?: boolean; } export interface UseScribeReturn { status: ScribeStatus; isConnected: boolean; isTranscribing: boolean; partialTranscript: string; committedTranscripts: TranscriptSegment[]; error: string | null; connect: (options?: Partial) => Promise; disconnect: () => void; sendAudio: (audioBase64: string, options?: { commit?: boolean; sampleRate?: number; previousText?: string; }) => void; commit: () => void; clearTranscripts: () => void; getConnection: () => RealtimeConnection | null; } export declare function useScribe(options?: ScribeHookOptions): UseScribeReturn; export { AudioFormat, CommitStrategy, RealtimeEvents, } from "@elevenlabs/client"; export type { RealtimeConnection } from "@elevenlabs/client"; //# sourceMappingURL=scribe.d.ts.map