export interface UseAudioPlayerProps { /** Source URL of the audio file */ src?: string; /** Whether to play automatically on mount */ autoPlay?: boolean; /** Initial playback time in seconds */ initialTime?: number; /** Total duration in seconds (optional — loaded from metadata if not provided) */ initialDuration?: number; /** Display variant: 'card' (standard floating) or 'bar' (global fixed bar) */ variant?: 'card' | 'bar'; /** Whether the player is currently visible and open (only for 'bar' variant) */ isOpen?: boolean; /** Whether the player should automatically float when scrolled out of view */ enableAutoFloat?: boolean; /** Callback fired when user manually closes the floating player */ onCloseFloating?: () => void; } export interface UseAudioPlayerReturn { audioRef: React.RefObject; containerRef: React.RefObject; isPlaying: boolean; currentTime: number; duration: number; volume: number; isMuted: boolean; playbackSpeed: number; isFloating: boolean; isManualFloating: boolean; isVisible: boolean; isMobile: boolean; enableAutoFloatLocal: boolean; sidebarExpanded: boolean; sidebarWidth: number; assistenteExpanded: boolean; togglePlay: () => void; toggleMute: () => void; handleSeek: (value: number[]) => void; handleVolumeChange: (value: number[]) => void; handleSetFloating: (floating: boolean) => void; handleEnableManualFloat: () => void; setPlaybackSpeed: (speed: number) => void; resetAudio: () => void; onPlay: () => void; onPause: () => void; onEnded: () => void; onTimeUpdate: (e: React.SyntheticEvent) => void; onLoadedMetadata: (e: React.SyntheticEvent) => void; formatTime: (time: number) => string; } /** * `useAudioPlayer` — Headless hook for the AudioPlayer component. * * Encapsulates all state management and side effects for audio playback, * including auto-float on scroll, mobile detection, and layout context integration. * * @example * ```tsx * import { useAudioPlayer } from './use-audio-player'; * * function MyCustomPlayer({ src }: { src: string }) { * const { isPlaying, togglePlay, formatTime, currentTime, duration } = useAudioPlayer({ src }); * return ( *
* * {formatTime(currentTime)} / {formatTime(duration)} *
* ); * } * ``` */ export declare function useAudioPlayer({ src, autoPlay, initialTime, initialDuration, variant, isOpen, enableAutoFloat, onCloseFloating, }?: UseAudioPlayerProps): UseAudioPlayerReturn;