import { Ref } from 'vue'; export type MicrophoneState = 'idle' | 'requesting' | 'live' | 'denied' | 'unsupported' | 'error'; export interface UseMicrophoneOptions { /** * Extra `getUserMedia` audio constraints. The defaults turn the browser's * voice processing off so the beam reacts to the raw signal; pass your own * to override (e.g. `{ echoCancellation: true }`). */ constraints?: MediaTrackConstraints; /** Ask for the microphone on mount rather than waiting for `start()`. */ autoStart?: boolean; } export interface UseMicrophoneResult { /** The live stream to hand to ``, or null. */ stream: Ref; state: Ref; /** The error behind a 'denied' / 'error' state, if any. */ error: Ref; /** True when this browser can capture audio at all. */ supported: Ref; /** Request the microphone. Call it from a click so Safari lets audio start. */ start: () => Promise; /** Stop every track and drop the stream. */ stop: () => void; } /** * Microphone access for TxVoiceBeam. * * ```vue * * * ``` * * The stream is stopped on unmount, and when the browser ends the track * (device unplugged, permission revoked) the state falls back to 'idle'. */ export declare function useMicrophone(options?: UseMicrophoneOptions): UseMicrophoneResult;