import * as react from 'react';
import { JSX, ComponentProps, RefObject } from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';

interface CustomProps {
    [key: string]: {
        value: unknown;
        description?: string;
        required: boolean;
        default?: unknown;
    };
}
interface Component<T extends keyof JSX.IntrinsicElements> {
    title: string;
    url: string;
    description: string;
    props: CustomProps extends ComponentProps<T> ? CustomProps : never;
}
interface BaseProps {
    src: string;
    autoplay?: boolean;
    loop?: boolean;
    color?: string;
    showProgress?: boolean;
    showVolume?: boolean;
}
type FFTSze = 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768;

interface PlayerProps extends ComponentProps<"audio"> {
    onNext?: () => void;
    onPrev?: () => void;
    src: BaseProps["src"];
    autoplay?: BaseProps["autoplay"];
    loop?: BaseProps["loop"];
    showProgress?: BaseProps["showProgress"];
    showVolume?: BaseProps["showVolume"];
    color?: BaseProps["color"];
    showNextPrevControls?: boolean;
    size?: number;
}
declare const Player: react.ForwardRefExoticComponent<Omit<PlayerProps, "ref"> & react.RefAttributes<HTMLAudioElement>>;

interface ShufflePlayerProps extends ComponentProps<"audio"> {
    srcs: [];
    autoplay?: BaseProps["autoplay"];
    color?: BaseProps["color"];
    showNextPrevControls?: boolean;
    showProgress?: BaseProps["showProgress"];
    showVolume?: BaseProps["showVolume"];
    shuffle?: boolean;
    onNext?: () => void;
    onPrev?: () => void;
}
declare function ShufflePlayer({ srcs, autoplay, color, showNextPrevControls, showProgress, showVolume, shuffle, onNext, onPrev, ...props }: ShufflePlayerProps): react_jsx_runtime.JSX.Element;

interface WaveformProps extends ComponentProps<"div"> {
    src: BaseProps["src"];
    size?: number;
    color?: BaseProps["color"];
    autoplay?: BaseProps["autoplay"];
    loop?: BaseProps["loop"];
    showProgress?: BaseProps["showProgress"];
    showVolume?: BaseProps["showVolume"];
    fftSize?: FFTSze;
    onLoad?: () => void;
}
/**
 * Waveform component renders an audio player and a real-time waveform visualization.
 */
declare function Waveform({ src, size, color, autoplay, loop, showProgress, showVolume, fftSize, onLoad, ...props }: WaveformProps): react_jsx_runtime.JSX.Element;

interface OscillatorProps extends ComponentProps<"div"> {
    type?: OscillatorType;
    frequency?: number;
    gain?: number;
    isPlaying: boolean;
    onFrequencyChange?: (frequency: number) => void;
    onGainChange?: (gain: number) => void;
}
declare function Oscillator({ type, frequency, gain, isPlaying, onFrequencyChange, onGainChange, ...props }: OscillatorProps): react_jsx_runtime.JSX.Element;

interface SpectroGramDisplayProps extends ComponentProps<"canvas"> {
    audioRef: RefObject<HTMLAudioElement>;
    fftSize?: FFTSze;
    width?: number | string;
    height?: number | string;
    minDecibels?: number;
    maxDecibels?: number;
    smoothingTimeConstant?: number;
    colorMap?: string[];
    onFrameUpdate?: (data: Uint8Array) => void;
    fillStyle?: string;
    loop?: boolean;
}
declare function SpectroGramDisplay({ audioRef, fftSize, width, height, minDecibels, maxDecibels, colorMap, onFrameUpdate, fillStyle, loop, smoothingTimeConstant, ...props }: SpectroGramDisplayProps): react_jsx_runtime.JSX.Element;
interface SpectrogramProps extends ComponentProps<"div"> {
    src: BaseProps["src"];
    fftSize?: FFTSze;
    width?: number | string;
    height?: number | string;
    minDecibels?: number;
    maxDecibels?: number;
    colorMap?: string[];
    smoothingTimeConstant?: number;
    onFrameUpdate?: (data: Uint8Array) => void;
    loop?: BaseProps["loop"];
    fillStyle?: string;
}
declare function Spectrogram({ src, fftSize, width, height, minDecibels, maxDecibels, colorMap, smoothingTimeConstant, onFrameUpdate, loop, fillStyle, ...props }: SpectrogramProps): react_jsx_runtime.JSX.Element;

declare const components: {
    readonly Player: Component<"audio">;
    readonly ShufflePlayer: Component<"audio">;
    readonly Waveform: Component<"canvas">;
    readonly Oscillator: Component<"div">;
    readonly Spectrogram: Component<"div">;
};

/**
 * Hook to create and manage an AnalyserNode for a given audio element and context.
 * Ensures nodes are not created or connected after the context is closed.
 */
declare function useAudioAnalyser(audioElement: HTMLAudioElement | null, audioContext: AudioContext | null, sourceNodeRef: RefObject<MediaElementAudioSourceNode | null>, fftSize: FFTSze): {
    analyser: AnalyserNode;
    getFrequencyData: () => Uint8Array<ArrayBuffer>;
} | null;

export { type BaseProps, type FFTSze, Oscillator, type OscillatorProps, Player, type PlayerProps, ShufflePlayer, type ShufflePlayerProps, SpectroGramDisplay, type SpectroGramDisplayProps, Spectrogram, type SpectrogramProps, Waveform, type WaveformProps, components, useAudioAnalyser };
