export type PictureDataType = import('../../../basics/mediaContent.mjs').PictureDataType; export type MediaContent = import('../../../basics/mediaContent.mjs').MediaContent; export type ContentTimeData = { /** * - The total duration of the media in milliseconds. */ total: number; /** * - The current playback position in milliseconds. */ current: number; /** * - The remaining time until the media ends in milliseconds. */ remaining: number; /** * - The percentage of the media that has been played (0 to 100). */ playbackPercentage: number; }; export type ContentData = { /** * - The unique identifier for the content. */ id: string; /** * - The timestamp indicating when the content was created. */ createdAt: string; /** * - The title of the content. */ title: string; /** * - The duration of the content. */ duration: number; /** * - The unique identifier for the artist. */ artistId: string; /** * - The name of the artist (optional). */ artistName?: string; /** * - A brief description of the content (optional). */ description?: string; /** * - The URL for the artist's avatar image (optional). */ avatar?: string; /** * - The URL to access the content (optional). */ url?: string; }; export type BaseMediaAdapterEvents = { destroyed: () => void; volumeChange: (volume: number) => void; seek: (time: number) => void; play: () => void; pause: () => void; ended: () => void; timeupdate: (data: ContentTimeData) => void; onReady: () => void; error: (error: any) => void; onStateChange: (event: any) => void; } & Record void>; /** * Event map for {@link BaseMediaAdapter}. * * Adapters bridge third-party players, so the event map is kept open * (`Record`) to allow forwarding arbitrary player events while * still providing autocomplete for the well-known ones. * * @typedef {{ * destroyed: () => void, * volumeChange: (volume: number) => void, * seek: (time: number) => void, * play: () => void, * pause: () => void, * ended: () => void, * timeupdate: (data: ContentTimeData) => void, * onReady: () => void, * error: (error: any) => void, * onStateChange: (event: any) => void, * } & Record void>} BaseMediaAdapterEvents */ /** @type {new () => import('../../../jsdoc/EventEmitter.mjs').ICustomEventEmitter} */ declare const TypedEventEmitter: new () => import('../../../jsdoc/EventEmitter.mjs').ICustomEventEmitter; /** * Interface definition for a Media Provider Adapter. * All specific API wrappers must extend and implement this class. * @abstract */ declare class BaseMediaAdapter extends TypedEventEmitter { #private; constructor(); get destroyed(): boolean; /** * Returns the thumbnail URL for the currently loaded track. * @param {string} trackId - The SoundCloud track ID. * @returns {string} The thumbnail URL. * @throws {TypeError} If the trackId is not a valid string. */ static getThumbnailUrl(trackId: string): string; /** * Determines if this adapter can play the provided content. * @param {MediaContent} content - The media content to evaluate. * @returns {boolean} True if the adapter can handle the content, false otherwise. */ static canHandle(content: MediaContent): boolean; /** * Synchronously checks whether the media adapter is fully initialized and ready. * @returns {boolean} True if the adapter is ready, false otherwise. */ isReady(): boolean; /** * Checks whether the media adapter is paused. * @returns {boolean} True if the adapter is ready, false otherwise. */ isPaused(): boolean; /** * Checks whether the media adapter is ended. * @returns {boolean} True if the adapter is ready, false otherwise. */ isEnded(): boolean; /** * Asynchronously waits until the content media adapter is fully initialized and ready. * @returns {Promise} A promise that resolves once the adapter is ready. */ waitIsReady(): Promise; /** * Determines if this adapter can play the provided content. * @param {MediaContent} content - The media content to evaluate. * @returns {boolean} True if the adapter can handle the content, false otherwise. */ canHandle(content: MediaContent): boolean; /** * Starts or resumes playback of the provided content. * @param {MediaContent} content - The media content to play. * @returns {Promise} */ play(content: MediaContent): Promise; /** * Pauses the current playback. * @returns {Promise} */ pause(): Promise; /** * Stops the playback completely and resets the internal platform state. * @returns {Promise} */ stop(): Promise; /** * Seeks to a specific time in the media timeline. * @param {number} timeMs - The target time in milliseconds. * @returns {Promise} */ seek(timeMs: number): Promise; /** * Checks whether the player is currently muted. * @returns {boolean|null} True if muted, false otherwise. */ isMuted(): boolean | null; /** * Mutes the current playback. * @returns {Promise} */ mute(): Promise; /** * Unmutes the current playback. * @returns {Promise} */ unMute(): Promise; /** * Retrieves the current playback time from the underlying API. * @returns {number} The current time in milliseconds. */ getCurrentTime(): number; /** * Gets the total duration of the content. * @returns {number} The total duration in milliseconds. */ getTotalDuration(): number; /** * Gets the remaining time until the content ends. * @returns {number} The remaining time in milliseconds. */ getRemainingTime(): number; /** * Gets the percentage of the content that has been played. * @returns {number} The percentage from 0 to 100. */ getPlaybackPercentage(): number; /** * Retrieves a consolidated object containing all time-related metrics for the current media content. * @returns {ContentTimeData} An object containing total, current, remaining time, and playback percentage. */ getTimeData(): ContentTimeData; /** * Sets the playback volume for the underlying API. * @param {number} volume - The volume level from 0.0 to 1.0. * @returns {void} */ setVolume(volume: number): void; /** * Gets the playback volume for the underlying API. * @returns {number} - The volume level from 0.0 to 1.0. */ getVolume(): number; /** * Retrieves the metadata of the currently loaded content, returning a structured * object containing details such as the content ID, title, author, and duration. * @returns {Promise} */ getContentData(): Promise; /** * Cleans up the instance. * @returns {void} */ destroy(): void; } export { BaseMediaAdapter }; //# sourceMappingURL=index.d.mts.map