import type { MessengerLabels } from "./messenger-labels.js"; /** The longest voice message: five minutes. Past it the take ends by itself. */ export declare const VOICE_MESSAGE_MAX_MS: number; /** Shorter than this is a slip of the finger, not a message. */ export declare const VOICE_MESSAGE_MIN_MS = 500; /** * The container the browser records a voice in, best first. * * AAC in MP4 first: it is the one recording every phone plays, iPhones * included. A voice recorded as WebM on an Android phone and sent to an * iPhone is a message the other person may not be able to open. Opus in WebM * where AAC is not offered (Firefox), then whatever is left. */ export declare function voiceMimeType(supported?: (type: string) => boolean): string | null; /** Can this browser record a voice message at all? */ export declare function canRecordVoice(): boolean; /** "voice-2026-11-13-2004.m4a": a name a person can find again in a folder. */ export declare function voiceFileName(at: Date, mimeType: string): string; export type VoiceTake = { file: File; durationMs: number; }; export type VoiceRecording = { phase: "idle" | "opening" | "recording" | "failed"; elapsedMs: number; start: () => Promise; /** Stop and hand over the take, or null for one too short or empty. */ finish: () => Promise; /** Stop and throw the take away. */ cancel: () => void; }; /** * Recording a voice, without any markup: the microphone is open only while * recording and is closed on every way out (finish, cancel, the five-minute * limit, the component going away). One request at a time, so a second tap * while the microphone is still opening cannot open a second one. */ export declare function useVoiceRecording(maxMs?: number): VoiceRecording; /** * The message box while a voice is recorded: Delete, the time with a red * dot, Send. It takes the box's place, so the thread above stays where it * was and the thumb that started the recording ends it in the same spot. * Recording starts as soon as it is shown. */ export declare function VoiceBar({ onSend, onClose, onTooShort, labels, maxMs, }: { onSend: (take: VoiceTake) => void; onClose: () => void; /** Send was tapped before there was anything to send. Never silent. */ onTooShort?: () => void; labels: MessengerLabels; maxMs?: number; }): import("react").JSX.Element; /** * The recorder in a sheet: start, stop, listen, then add. For an app with its * own arrangement; the Messenger itself records in the box (`VoiceBar`). */ export declare function VoiceRecorder({ onDone, labels, maxMs, }: { onDone: (file: File, durationMs?: number) => void; labels: MessengerLabels; maxMs?: number; }): import("react").JSX.Element; //# sourceMappingURL=VoiceRecorder.d.ts.map