import { ForwardRefExoticComponent } from 'react'; import { HTMLAttributes } from 'react'; import { ReactNode } from 'react'; import { RefAttributes } from 'react'; export declare const AudioWaveform: ForwardRefExoticComponent>; /** * AudioWaveform-specific appearance configuration * Extends WaveformAppearance with playhead styles */ export declare interface AudioWaveformAppearance extends WaveformAppearance { /** Playhead color (CSS color value). Default: "#ef4444" (red-500) */ playheadColor?: string; /** Playhead width (pixels). Default: 2 */ playheadWidth?: number; } declare interface AudioWaveformProps extends React.CanvasHTMLAttributes { /** Audio blob to visualize (provide either blob or peaks) */ blob?: Blob | null; /** Pre-computed peaks data (normalized 0-1 range, skips decoding when provided) */ peaks?: number[]; /** Waveform appearance configuration (barColor, barWidth, playheadColor, etc.) */ appearance?: AudioWaveformAppearance; /** Enable Suspense mode (requires Suspense boundary in parent) */ suspense?: boolean; /** Current playback time in seconds (shows playhead) */ currentTime?: number; /** Total audio duration in seconds (required for playhead positioning) */ duration?: number; /** Callback when user clicks/seeks on waveform (simple seek) */ onSeek?: (time: number) => void; /** Callback when drag-to-seek starts (use to pause playback) */ onSeekStart?: () => void; /** Callback during drag-to-seek with current time (real-time updates) */ onSeekDrag?: (time: number) => void; /** Callback when drag-to-seek ends (use to resume playback) */ onSeekEnd?: (time: number) => void; } declare interface AudioWaveformRef { canvas: HTMLCanvasElement | null; } /** * Real-time audio frequency visualization component * Analyzes MediaRecorder audio via Web Audio API and renders as bars */ export declare const LiveRecorder: ForwardRefExoticComponent>; declare interface LiveRecorderProps extends React.CanvasHTMLAttributes { /** * MediaRecorder instance to visualize */ mediaRecorder: MediaRecorder | null; /** * Waveform appearance configuration */ appearance?: WaveformAppearance; /** * FFT size for frequency analysis (must be power of 2) * @default 2048 */ fftSize?: number; /** * Smoothing time constant for analyser (0-1) * @default 0.8 */ smoothingTimeConstant?: number; /** * Show minimal bars when not recording (idle state) * @default true */ showIdleState?: boolean; /** * Amplitude multiplier - lower values produce quieter waveforms * @default 1.5 */ amplitudeScale?: number; } declare interface LiveRecorderRef { /** Get the canvas element */ getCanvas: () => HTMLCanvasElement | null; /** Get the audio context */ getAudioContext: () => AudioContext | null; /** Get the analyser node */ getAnalyser: () => AnalyserNode | null; } export declare const LiveStreamingRecorder: ForwardRefExoticComponent> & { Root: ForwardRefExoticComponent>; Canvas: ForwardRefExoticComponent>; }; /** * LiveStreamingRecorder-specific appearance configuration * Extends WaveformAppearance with scrollbar styles */ declare interface LiveStreamingRecorderAppearance extends WaveformAppearance { /** Scrollbar appearance configuration */ scrollbar?: ScrollbarAppearance; } declare interface LiveStreamingRecorderCanvasProps extends HTMLAttributes { /** Additional className for canvas element */ className?: string; /** Inline styles for canvas element */ style?: React.CSSProperties; /** Waveform appearance configuration (barColor, barWidth, etc.) - scrollbar settings only apply in Root */ appearance?: LiveStreamingRecorderAppearance; } declare type LiveStreamingRecorderContextValue = UseRecordingAmplitudesReturn; declare interface LiveStreamingRecorderRootProps extends UseRecordingAmplitudesOptions, Omit, "children"> { children: ReactNode | ((value: ReturnType) => ReactNode); /** Appearance configuration (waveform + scrollbar styles) */ appearance?: LiveStreamingRecorderAppearance; } export declare const LiveStreamingStackRecorder: ForwardRefExoticComponent>; declare interface LiveStreamingStackRecorderProps extends UseRecordingAmplitudesOptions, Omit, "children"> { /** Waveform appearance configuration (barColor, barWidth, etc.) */ appearance?: WaveformAppearance; } /** * Scrollbar appearance configuration * Used by LiveStreamingRecorder for custom scrollbar styling (OverlayScrollbars) */ export declare interface ScrollbarAppearance { /** Scrollbar thumb/handle color (CSS color value). Default: "rgba(148, 163, 184, 0.5)" */ thumbColor?: string; /** Hide scrollbar completely. Default: false */ hidden?: boolean; } /** * Custom hook for audio recording with real-time visualization support * Based on react-audio-visualize patterns */ export declare const useAudioRecorder: (config?: UseAudioRecorderConfig) => UseAudioRecorderReturn; declare interface UseAudioRecorderConfig { /** * MIME type for the recording * - string: Directly specify MIME type (e.g., 'audio/webm', 'audio/mp4') * - function: Select MIME type with custom logic (browser detection, etc.) * - undefined: Auto-select by browser (Safari: audio/mp4, Others: audio/webm) * @default getDefaultMimeType() - Auto-select by browser */ mimeType?: string | (() => string); /** * Audio constraints for getUserMedia * @default true */ audioConstraints?: MediaTrackConstraints | boolean; /** * Callback when recording is complete */ onRecordingComplete?: (blob: Blob) => void; } export declare interface UseAudioRecorderReturn { /** Start recording from the microphone */ startRecording: () => Promise; /** Stop recording and generate the audio blob */ stopRecording: () => void; /** Pause the current recording */ pauseRecording: () => void; /** Resume a paused recording */ resumeRecording: () => void; /** Clear the recording and reset state */ clearRecording: () => void; /** The MediaRecorder instance (for visualization) */ mediaRecorder: MediaRecorder | null; /** The recorded audio as a Blob (available after stopRecording) */ recordingBlob: Blob | null; /** Recording duration in seconds */ recordingTime: number; /** Whether currently recording */ isRecording: boolean; /** Whether recording is paused */ isPaused: boolean; /** Any error that occurred */ error: Error | null; } /** * LiveStreamingRecorder Context hook * Must be used within LiveStreamingRecorder.Root component */ declare function useLiveStreamingRecorderContext(): LiveStreamingRecorderContextValue; declare interface UseRecordingAmplitudesOptions { /** MediaRecorder instance to sample from */ mediaRecorder: MediaRecorder | null; /** FFT size for frequency analysis (must be power of 2) */ fftSize?: number; /** Smoothing time constant for analyser (0-1) */ smoothingTimeConstant?: number; /** Interval in ms for sampling amplitude data */ sampleInterval?: number; /** * Amplitude multiplier - lower values produce quieter waveforms * @default 1.5 */ amplitudeScale?: number; } declare interface UseRecordingAmplitudesReturn { /** Array of amplitude values (0-1 range) sampled over time */ amplitudes: number[]; /** Audio context instance */ audioContext: AudioContext | null; /** Analyser node instance */ analyser: AnalyserNode | null; /** Whether recording is active */ isRecording: boolean; /** Whether recording is paused */ isPaused: boolean; /** Clear all amplitude data */ clearAmplitudes: () => void; } /** * Base waveform appearance configuration * Used by all waveform components */ export declare interface WaveformAppearance { /** Bar color (CSS color value). Default: "#3b82f6" (blue-500) */ barColor?: string; /** Bar width (pixels). Default: 3 */ barWidth?: number; /** Bar gap (pixels). Default: 1 */ barGap?: number; /** Bar corner radius (pixels). Default: 1.5 */ barRadius?: number; /** Bar height scale (0.0 - 1.0). Default: 0.95 (5% top/bottom margin) */ barHeightScale?: number; } export { }