import { type DictationFinalEvent, type DictationServerEvent } from '@ottocode/sdk/dictation/protocol'; import type { CreateDictationSessionResponse, GetDictationStatusResponse, InstallDictationModelResponse } from './generated/types.gen'; import { type SSERequestMethod, type SSETransportMode } from './streaming'; /** @deprecated Import DEFAULT_AUDIO_FORMAT from @ottocode/sdk/dictation/protocol. */ export declare const DICTATION_AUDIO_FORMAT: { encoding: "pcm_s16le"; sampleRate: number; channels: number; }; export type DictationStatus = GetDictationStatusResponse; export type DictationModelState = DictationStatus['models'][number]; export type DictationSession = CreateDictationSessionResponse; export type DictationModelInstallResponse = InstallDictationModelResponse; export type { DictationFinalEvent, DictationServerEvent }; export interface DictationWebSocketLike { readonly readyState: number; binaryType: BinaryType; onopen: ((event: Event) => void) | null; onmessage: ((event: MessageEvent) => void) | null; onerror: ((event: Event) => void) | null; onclose: ((event: CloseEvent) => void) | null; send(data: string | ArrayBufferLike | ArrayBufferView): void; close(code?: number, reason?: string): void; } export type DictationWebSocketFactory = (url: string) => DictationWebSocketLike; export interface ConnectDictationSessionOptions { session: DictationSession; baseUrl?: string; language?: string; partialResults?: boolean; timeoutMs?: number; webSocketFactory?: DictationWebSocketFactory; onEvent?: (event: DictationServerEvent) => void; } export interface DictationConnection { readonly sessionId: string; readonly model: string; sendAudio(frame: Uint8Array): void; stop(): Promise; cancel(): void; close(): void; } export interface StreamDictationModelInstallOptions { baseUrl: string; model: string; headers?: HeadersInit; signal?: AbortSignal; fetch?: typeof fetch; method?: SSERequestMethod; transportMode?: SSETransportMode; onModel: (model: DictationModelState) => void; } /** Resolves a session socket through the API origin selected by the client. */ export declare function resolveDictationWebSocketUrl(wsUrl: string, baseUrl?: string): string; /** Opens an existing dictation session and owns its WebSocket protocol. */ export declare function connectDictationSession(options: ConnectDictationSessionOptions): Promise; /** Streams model installation state from the daemon's SSE endpoint. */ export declare function streamDictationModelInstall(options: StreamDictationModelInstallOptions): Promise; export declare function parseDictationServerEvent(raw: string): DictationServerEvent | null; //# sourceMappingURL=dictation.d.ts.map