/** * @fileoverview Concrete loader for audio. Mirrors the VideoLoader API so the * two are interchangeable inside a factory. Audio has no intrinsic dimensions, * so width and height are always 0. */ import TinyContentLoader from './TinyContentLoader.mjs'; export type AudioLoaderOptions = { /** * - The audio source URL. */ src?: string; /** * - Maximum time in milliseconds before the load is aborted. */ timeout?: number; /** * - The CORS mode applied to the audio. */ crossOrigin?: string | null; /** * - Whether the audio should autoplay. */ autoplay?: boolean; /** * - Whether the audio should loop. */ loop?: boolean; /** * - Whether the audio should be muted. */ muted?: boolean; /** * - Whether the audio should display controls (default true). */ controls?: boolean; /** * - The preload strategy. */ preload?: 'none' | 'metadata' | 'auto'; /** * - An existing DOM element to adopt. */ element?: HTMLAudioElement | null; /** * - Whether to render progressively during fetch (default true). */ progressive?: boolean; /** * - Whether an external `src` change triggers a reload. */ autoReload?: boolean; /** * - Whether to download the audio through fetch for byte progress. */ stream?: boolean; /** * - An optional shared memory cache. */ cache?: import('../../utils/TinyMediaCache.mjs').default | null; }; /** * Configuration options for {@link TinyAudioLoader}. * @typedef {Object} AudioLoaderOptions * @property {string} [src] - The audio source URL. * @property {number} [timeout] - Maximum time in milliseconds before the load is aborted. * @property {string|null} [crossOrigin] - The CORS mode applied to the audio. * @property {boolean} [autoplay] - Whether the audio should autoplay. * @property {boolean} [loop] - Whether the audio should loop. * @property {boolean} [muted] - Whether the audio should be muted. * @property {boolean} [controls] - Whether the audio should display controls (default true). * @property {'none'|'metadata'|'auto'} [preload] - The preload strategy. * @property {HTMLAudioElement|null} [element] - An existing DOM element to adopt. * @property {boolean} [progressive] - Whether to render progressively during fetch (default true). * @property {boolean} [autoReload] - Whether an external `src` change triggers a reload. * @property {boolean} [stream] - Whether to download the audio through fetch for byte progress. * @property {import('../../utils/TinyMediaCache.mjs').default|null} [cache] - An optional shared memory cache. */ /** * Loads a single audio track with full lifecycle control. * @extends {TinyContentLoader} * @beta */ declare class TinyAudioLoader extends TinyContentLoader { /** * Retrieves the uppercase tag name of the element this loader creates. * @returns {string} The literal string `'AUDIO'`. */ static get tagName(): string; /** * Creates a new audio loader and validates the provided options. * @param {AudioLoaderOptions} [options] - The loader configuration. * @throws {TypeError} If `crossOrigin` is not a string or null. * @throws {TypeError} If `preload` is not a string. */ constructor(options?: AudioLoaderOptions); /** * The underlying `