import { AudioRecorderOptions, AudioRecording, InferAudioRecordingOutput } from "@tanstack/ai-client"; //#region src/use-audio-recorder.d.ts type UseAudioRecorderOptions = AudioRecorderOptions & { /** * Optional transform applied to the recording when `stop()` resolves. Its * (awaited) return value becomes `recording` and the resolved value of * `stop()`. Return nothing to keep the raw `AudioRecording`. */ onComplete?: TOnComplete; }; interface UseAudioRecorderReturn { /** Solid accessor: latest recording (transformed if `onComplete` provided), or null. */ recording: () => TOutput | null; /** Solid accessor: true while actively capturing audio. */ isRecording: () => boolean; /** Whether the browser supports recording. */ isSupported: boolean; start: () => Promise; /** Stop and resolve with the completed recording (transformed if `onComplete` provided). */ stop: () => Promise; /** Discard the in-progress recording and release the mic. */ cancel: () => void; } /** * Solid hook for recording an audio message. The resolved recording carries * `.part` (for `useChat.sendMessage`) and `.base64` (for generation hooks). * * Errors are delivered via `onError`. `start()` and `stop()` also reject on * failure (and `stop()` rejects with `Recording cancelled` if `cancel()` runs * while a stop is in flight, e.g. on unmount) — handle one channel, not both. */ declare function useAudioRecorder unknown>(options: UseAudioRecorderOptions & { onComplete: TOnComplete; }): UseAudioRecorderReturn>; declare function useAudioRecorder(options?: UseAudioRecorderOptions): UseAudioRecorderReturn; //#endregion export { UseAudioRecorderOptions, UseAudioRecorderReturn, useAudioRecorder }; //# sourceMappingURL=use-audio-recorder.d.ts.map