import { K as Key } from './useInput-D8eE1Kzb.js'; type PushToTalkStatus = 'idle' | 'warmup' | 'recording' | 'transcribing' | 'error'; /** Minimal interface every capture backend must implement. */ interface VoiceCapture { start(): void | Promise; stop(): Promise; cancel?(): void | Promise; } interface PushToTalkOptions { captureFactory: () => VoiceCapture; transcribe: (audio: Buffer) => Promise; /** Enable or disable the hook without unmounting. Default: true. */ enabled?: boolean; /** * Number of rapid consecutive Space events required to activate recording. * Default: 2 (initial press + 1 rapid repeat). */ warmupRepeatThreshold?: number; /** * Milliseconds of silence between Space events that counts as "released". * Used both as warmup timeout and release debounce. Default: 180. */ releaseDebounceMs?: number; onTranscript: (text: string) => void; onError?: (error: Error) => void; } interface HandleInputResult { /** When true, TextInput must not append the character to its value. */ consume: boolean; /** * When set, TextInput must remove this many trailing characters from its * current value (retracts provisional warmup spaces on activation). */ removeTrailingChars?: number; } interface PushToTalkResult { status: PushToTalkStatus; isListening: boolean; /** Human-readable hint string to display near the input. Empty in idle. */ hint: string; handleInput: (input: string, key: Key) => HandleInputResult; } interface PttState { status: PushToTalkStatus; /** Number of Space characters inserted into the field during warmup. */ typedWarmupChars: number; error: Error | null; } type PttAction = { type: 'SPACE_PRESS'; } | { type: 'SPACE_WARMUP_CHAR'; } | { type: 'SPACE_ACTIVATE'; } | { type: 'WARMUP_TIMEOUT'; } | { type: 'STOP_RECORDING'; } | { type: 'TRANSCRIPT'; } | { type: 'ERROR'; error: Error; } | { type: 'RESET'; }; declare const initialPttState: PttState; declare function pttReducer(state: PttState, action: PttAction): PttState; declare function usePushToTalk(options: PushToTalkOptions): PushToTalkResult; export { type HandleInputResult as H, type PttAction as P, type VoiceCapture as V, type PttState as a, type PushToTalkOptions as b, type PushToTalkResult as c, type PushToTalkStatus as d, initialPttState as i, pttReducer as p, usePushToTalk as u };