import * as i0 from '@angular/core';
import { OnDestroy, ElementRef, InputSignal } from '@angular/core';
import WaveSurfer from 'wavesurfer.js';
import { AXEvent } from '@acorex/cdk/common';
import * as i1 from '@angular/common';
import * as i2 from '@acorex/components/button';
import * as i3 from '@acorex/components/decorators';
import * as i4 from '@acorex/components/skeleton';
import * as i5 from '@acorex/core/translation';

interface AXWaveConfig {
    container?: HTMLElement;
    waveColor?: string;
    progressColor?: string;
    url: string;
    barWidth?: number;
    barGap?: number;
    barRadius?: number;
    height?: number;
    audioRate?: number;
}
interface AXAudioWaveChangeEvent extends AXEvent {
    status: 'load' | 'loading' | 'decode' | 'ready' | 'redrawcomplete' | 'play' | 'pause' | 'finish' | 'timeupdate' | 'seeking' | 'interaction' | 'click' | 'drag' | 'scroll' | 'zoom' | 'destroy' | 'error';
    data: null | any;
}

/**
 * Displays and interacts with audio waveform visualization.
 *
 * @category Components
 */
declare class AXAudioWaveComponent implements OnDestroy {
    /**
     *  @ignore
     */
    protected div: ElementRef<HTMLDivElement>;
    /**
     * Configuration settings for the audio wave.
     */
    config: InputSignal<AXWaveConfig>;
    /**
     * Emits an event when the status of the audio wave changes.
     *
     * @event
     */
    onStatusChanged: i0.OutputEmitterRef<AXAudioWaveChangeEvent>;
    audioState: i0.WritableSignal<"loading" | "ready" | "error" | "playing" | "paused">;
    errorMessage: i0.WritableSignal<string>;
    /**
     *  @ignore
     */
    protected audio: WaveSurfer;
    /**
     *  @ignore
     */
    private ngZone;
    private platformID;
    /**
     *  @ignore
     */
    constructor();
    /**
     * Loads the audio from the specified URL.
     *
     * @param url - The URL of the audio to load. Defaults to the URL from the config.
     */
    load(url?: string): void;
    /**
     * Plays the audio.
     *
     */
    play(): Promise<any>;
    /**
     * Pauses the audio.
     */
    pause(): void;
    /**
     * Retrieves the duration of the audio.
     *
     */
    getDuration(): number;
    /**
     * Retrieves the media element of the audio.
     *
     */
    getMediaElement(): HTMLMediaElement;
    /**
     * Sets the playback rate of the audio.
     *
     * @param rate - The playback rate to set.
     */
    setRate(rate: number): void;
    /**
     *  @ignore
     */
    protected bindEvents(): void;
    /** When audio starts loading */
    protected handleLoad(): void;
    /** During audio loading */
    protected handleLoading(): void;
    /** When the audio has been decoded */
    protected handleDecode(): void;
    /** When the audio is both decoded and can play */
    protected handleReady(): void;
    /** When all audio channel chunks of the waveform have drawn */
    protected handleRedRawComplete(): void;
    /** When the audio starts playing */
    protected handlePlay(): void;
    /** When the audio pauses */
    protected handlePause(): void;
    /** When the audio finishes playing */
    protected handleFinish(): void;
    /** On audio position change, fires continuously during playback */
    protected handleTimeUpdate(): void;
    /** When the user seeks to a new position */
    protected handleSeeking(): void;
    /** When the user interacts with the waveform (i.g. clicks or drags on it) */
    protected handleInteraction(): void;
    /** When the user clicks on the waveform */
    protected handleClick(): void;
    /** When the user drags the cursor */
    protected handleDrag(): void;
    /** When the waveform is scrolled (panned) */
    protected handleScroll(): void;
    /** When the zoom level changes */
    protected handleZoom(): void;
    /** Just before the waveform is destroyed so you can clean up your events */
    protected handleDestroy(): void;
    /** Just before the waveform is destroyed so you can clean up your events */
    protected handleError(): void;
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXAudioWaveComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXAudioWaveComponent, "ax-audio-wave", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, { "onStatusChanged": "onStatusChanged"; }, never, never, true, never>;
}

declare class AXAudioWaveModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXAudioWaveModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXAudioWaveModule, never, [typeof i1.CommonModule, typeof i2.AXButtonModule, typeof i3.AXDecoratorModule, typeof i4.AXSkeletonModule, typeof i5.AXTranslationModule, typeof AXAudioWaveComponent], [typeof AXAudioWaveComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXAudioWaveModule>;
}

export { AXAudioWaveComponent, AXAudioWaveModule };
export type { AXAudioWaveChangeEvent, AXWaveConfig };
