/** * https://developers.soundcloud.com/docs/api/html5-widget * @fileoverview JSDoc type definitions for the SoundCloud IFrame Player API. * This file provides full IntelliSense/autocomplete for the global `window.SC` object. * @module youtube-api-docs */ export type SoundObject = { /** * - The title of the track. */ title: string; /** * - Total duration of the track in milliseconds. */ duration: number; /** * - The URL of the track's cover art image. */ artwork_url: string; /** * - A short descriptive caption for the track. */ caption: string; /** * - The total number of comments on the track. */ comment_count: number; /** * - Indicates if users are allowed to comment on this track. */ commentable: boolean; /** * - ISO 8601 timestamp of when the track was created. */ created_at: string; /** * - The full text description of the track. */ description: string; /** * - A human-readable string representing the date. */ display_date: string; /** * - The total number of times the track has been downloaded. */ download_count: number; /** * - Indicates if the track is available for download. */ downloadable: boolean; /** * - Information regarding the permissions for embedding the track. */ embeddable_by: string; /** * - The complete duration of the track in milliseconds. */ full_duration: number; /** * - The musical genre assigned to the track. */ genre: string; /** * - Indicates if the user has remaining download credits. */ has_downloads_left: boolean; /** * - The unique numerical identifier for the sound. */ id: number; /** * - The type of resource (e.g., 'track'). */ kind: string; /** * - The name of the record label associated with the track. */ label_name: string; /** * - ISO 8601 timestamp of the last time the track was modified. */ last_modified: string; /** * - The licensing terms applied to the track. */ license: string; /** * - The total number of likes the track has received. */ likes_count: number; /** * - The specific model used for track monetization. */ monetization_model: string; /** * - The unique URL slug for the track. */ permalink: string; /** * - The full URL of the track's permalink. */ permalink_url: string; /** * - Indicates if the track is currently playable. */ playable: boolean; /** * - The total number of times the track has been played. */ playback_count: number; /** * - The usage policy governing the track. */ policy: string; /** * - Indicates if the track is accessible to the public. */ public: boolean; /** * - The title used when purchasing the track. */ purchase_title: string; /** * - The URL used to purchase the track. */ purchase_url: string; /** * - The official release date of the track. */ release_date: string; /** * - The total number of times the track has been reposted. */ reposts_count: number; /** * - The category of the resource. */ resource_type: string; /** * - A token required to access private or restricted tracks. */ secret_token: string; /** * - Information regarding the sharing status or permissions. */ sharing: string; /** * - The current playback or availability state of the track. */ state: string; /** * - The permalink for the associated station. */ station_permalink: string; /** * - The Uniform Resource Name for the associated station. */ station_urn: string; /** * - Indicates if the track can be streamed. */ streamable: boolean; /** * - A list of tags associated with the track. */ tag_list: string; /** * - Authorization details for accessing the track. */ track_authorization: string; /** * - The Uniform Resource Identifier for the track. */ uri: string; /** * - The Uniform Resource Name for the track. */ urn: string; /** * - The unique identifier of the user who uploaded the track. */ user_id: number; /** * - Configuration data for track visuals. */ visuals: string; /** * - The URL of the track's waveform image. */ waveform_url: string; /** * - Object containing media and transcoding information. */ media: MediaObject; /** * - Metadata regarding the track's publisher. */ publisher_metadata: PublisherObject; /** * - Information about the user who owns the track. */ user: UserObject; /** * - Internal identifier for the resource. */ _resource_id: number; /** * - Internal type identifier for the resource. */ _resource_type: string; }; export type MediaObject = { /** * - An array of available audio transcoding formats. */ transcodings: TranscodingObject[]; }; export type TranscodingObject = { /** * - The MIME type and protocol of the audio format. */ format: { mime_type: string; protocol: string; }; /** * - The duration of this specific transcoding in milliseconds. */ duration: number; /** * - Indicates if this is an older, legacy transcoding format. */ is_legacy_transcoding: boolean; /** * - The preset used to generate this transcoding. */ preset: string; /** * - The audio quality level of this transcoding. */ quality: string; /** * - Indicates if this is a short preview or snippet. */ snipped: boolean; /** * - The direct URL to the transcoded audio file. */ url: string; }; export type PublisherObject = { /** * - The unique identifier for the publisher. */ id: number; /** * - The Uniform Resource Name for the publisher. */ urn: string; /** * - The name of the artist. */ artist: string; /** * - The name of the publishing entity. */ publisher: string; /** * - The name of the writer or composer. */ writer_composer: string; }; export type UserBadgesObject = { /** * - Indicates if the user has mid-tier creator status. */ creator_mid_tier: boolean; /** * - Indicates if the user has a Pro subscription. */ pro: boolean; /** * - Indicates if the user has an Unlimited subscription. */ pro_unlimited: boolean; /** * - Indicates if the user's account is verified. */ verified: boolean; }; export type CreatorSubscriptionObject = { /** * - An object containing the ID of the subscription product. */ product: { id: string; }; }; export type VisualsObject = { /** * - Indicates if the visualizer is enabled. */ enabled: boolean; /** * - Indicates if visualizer tracking is enabled. */ tracking: boolean; /** * - The Uniform Resource Name for the visualizer. */ urn: string; /** * - The specific data for the visualizer. */ visuals: VisualsObjectData; }; export type VisualsObjectData = { /** * - The timestamp when the visual element starts. */ entry_time: number; /** * - The Uniform Resource Name for the visual data. */ urn: string; /** * - The URL of the visual asset. */ visual_url: string; }; export type UserObject = { /** * - Visualizer configuration for the user. */ visuals: VisualsObject; /** * - The user's current subscription product. */ creator_subscription: CreatorSubscriptionObject; /** * - A list of all subscriptions held by the user. */ creator_subscriptions: CreatorSubscriptionObject[]; /** * - The badges and status indicators assigned to the user. */ badges: UserBadgesObject; /** * - The URL of the user's profile picture. */ avatar_url: string; /** * - The city where the user is located. */ city: string; /** * - The total number of comments made by the user. */ comments_count: number; /** * - The ISO country code of the user. */ country_code: string; /** * - ISO 8601 timestamp of when the user account was created. */ created_at: string; /** * - The user's date of birth. */ date_of_birth: string; /** * - The user's profile description. */ description: string; /** * - The user's first name. */ first_name: string; /** * - The total number of followers the user has. */ followers_count: number; /** * - The total number of accounts the user follows. */ followings_count: number; /** * - The user's complete name. */ full_name: string; /** * - The total number of groups the user belongs to. */ groups_count: number; /** * - The unique numerical identifier for the user. */ id: number; /** * - The type of resource (e.g., 'user'). */ kind: string; /** * - ISO 8601 timestamp of the last profile update. */ last_modified: string; /** * - The user's last name. */ last_name: string; /** * - The total number of likes the user has given. */ likes_count: number; /** * - The unique profile slug for the user. */ permalink: string; /** * - The full URL of the user's profile. */ permalink_url: string; /** * - The total number of playlists created by the user. */ playlist_count: number; /** * - The total number of playlists liked by the user. */ playlist_likes_count: number; /** * - The total number of reposts made by the user. */ reposts_count: number; /** * - The permalink for the user's station. */ station_permalink: string; /** * - The Uniform Resource Name for the user's station. */ station_urn: string; /** * - The total number of tracks uploaded by the user. */ track_count: number; /** * - The Uniform Resource Identifier for the user. */ uri: string; /** * - The Uniform Resource Name for the user. */ urn: string; /** * - The user's unique username. */ username: string; /** * - Indicates if the user's account is verified. */ verified: boolean; }; /** * @typedef {Object} SoundObject * @property {string} title - The title of the track. * @property {number} duration - Total duration of the track in milliseconds. * @property {string} artwork_url - The URL of the track's cover art image. * @property {string} caption - A short descriptive caption for the track. * @property {number} comment_count - The total number of comments on the track. * @property {boolean} commentable - Indicates if users are allowed to comment on this track. * @property {string} created_at - ISO 8601 timestamp of when the track was created. * @property {string} description - The full text description of the track. * @property {string} display_date - A human-readable string representing the date. * @property {number} download_count - The total number of times the track has been downloaded. * @property {boolean} downloadable - Indicates if the track is available for download. * @property {string} embeddable_by - Information regarding the permissions for embedding the track. * @property {number} full_duration - The complete duration of the track in milliseconds. * @property {string} genre - The musical genre assigned to the track. * @property {boolean} has_downloads_left - Indicates if the user has remaining download credits. * @property {number} id - The unique numerical identifier for the sound. * @property {string} kind - The type of resource (e.g., 'track'). * @property {string} label_name - The name of the record label associated with the track. * @property {string} last_modified - ISO 8601 timestamp of the last time the track was modified. * @property {string} license - The licensing terms applied to the track. * @property {number} likes_count - The total number of likes the track has received. * @property {string} monetization_model - The specific model used for track monetization. * @property {string} permalink - The unique URL slug for the track. * @property {string} permalink_url - The full URL of the track's permalink. * @property {boolean} playable - Indicates if the track is currently playable. * @property {number} playback_count - The total number of times the track has been played. * @property {string} policy - The usage policy governing the track. * @property {boolean} public - Indicates if the track is accessible to the public. * @property {string} purchase_title - The title used when purchasing the track. * @property {string} purchase_url - The URL used to purchase the track. * @property {string} release_date - The official release date of the track. * @property {number} reposts_count - The total number of times the track has been reposted. * @property {string} resource_type - The category of the resource. * @property {string} secret_token - A token required to access private or restricted tracks. * @property {string} sharing - Information regarding the sharing status or permissions. * @property {string} state - The current playback or availability state of the track. * @property {string} station_permalink - The permalink for the associated station. * @property {string} station_urn - The Uniform Resource Name for the associated station. * @property {boolean} streamable - Indicates if the track can be streamed. * @property {string} tag_list - A list of tags associated with the track. * @property {string} track_authorization - Authorization details for accessing the track. * @property {string} uri - The Uniform Resource Identifier for the track. * @property {string} urn - The Uniform Resource Name for the track. * @property {number} user_id - The unique identifier of the user who uploaded the track. * @property {string} visuals - Configuration data for track visuals. * @property {string} waveform_url - The URL of the track's waveform image. * @property {MediaObject} media - Object containing media and transcoding information. * @property {PublisherObject} publisher_metadata - Metadata regarding the track's publisher. * @property {UserObject} user - Information about the user who owns the track. * @property {number} _resource_id - Internal identifier for the resource. * @property {string} _resource_type - Internal type identifier for the resource. */ /** * @typedef {Object} MediaObject * @property {TranscodingObject[]} transcodings - An array of available audio transcoding formats. */ /** * @typedef {Object} TranscodingObject * @property {{ mime_type: string, protocol: string }} format - The MIME type and protocol of the audio format. * @property {number} duration - The duration of this specific transcoding in milliseconds. * @property {boolean} is_legacy_transcoding - Indicates if this is an older, legacy transcoding format. * @property {string} preset - The preset used to generate this transcoding. * @property {string} quality - The audio quality level of this transcoding. * @property {boolean} snipped - Indicates if this is a short preview or snippet. * @property {string} url - The direct URL to the transcoded audio file. */ /** * @typedef {Object} PublisherObject * @property {number} id - The unique identifier for the publisher. * @property {string} urn - The Uniform Resource Name for the publisher. * @property {string} artist - The name of the artist. * @property {string} publisher - The name of the publishing entity. * @property {string} writer_composer - The name of the writer or composer. */ /** * @typedef {Object} UserBadgesObject * @property {boolean} creator_mid_tier - Indicates if the user has mid-tier creator status. * @property {boolean} pro - Indicates if the user has a Pro subscription. * @property {boolean} pro_unlimited - Indicates if the user has an Unlimited subscription. * @property {boolean} verified - Indicates if the user's account is verified. */ /** * @typedef {Object} CreatorSubscriptionObject * @property {{ id: string }} product - An object containing the ID of the subscription product. */ /** * @typedef {Object} VisualsObject * @property {boolean} enabled - Indicates if the visualizer is enabled. * @property {boolean} tracking - Indicates if visualizer tracking is enabled. * @property {string} urn - The Uniform Resource Name for the visualizer. * @property {VisualsObjectData} visuals - The specific data for the visualizer. */ /** * @typedef {Object} VisualsObjectData * @property {number} entry_time - The timestamp when the visual element starts. * @property {string} urn - The Uniform Resource Name for the visual data. * @property {string} visual_url - The URL of the visual asset. */ /** * @typedef {Object} UserObject * @property {VisualsObject} visuals - Visualizer configuration for the user. * @property {CreatorSubscriptionObject} creator_subscription - The user's current subscription product. * @property {CreatorSubscriptionObject[]} creator_subscriptions - A list of all subscriptions held by the user. * @property {UserBadgesObject} badges - The badges and status indicators assigned to the user. * @property {string} avatar_url - The URL of the user's profile picture. * @property {string} city - The city where the user is located. * @property {number} comments_count - The total number of comments made by the user. * @property {string} country_code - The ISO country code of the user. * @property {string} created_at - ISO 8601 timestamp of when the user account was created. * @property {string} date_of_birth - The user's date of birth. * @property {string} description - The user's profile description. * @property {string} first_name - The user's first name. * @property {number} followers_count - The total number of followers the user has. * @property {number} followings_count - The total number of accounts the user follows. * @property {string} full_name - The user's complete name. * @property {number} groups_count - The total number of groups the user belongs to. * @property {number} id - The unique numerical identifier for the user. * @property {string} kind - The type of resource (e.g., 'user'). * @property {string} last_modified - ISO 8601 timestamp of the last profile update. * @property {string} last_name - The user's last name. * @property {number} likes_count - The total number of likes the user has given. * @property {string} permalink - The unique profile slug for the user. * @property {string} permalink_url - The full URL of the user's profile. * @property {number} playlist_count - The total number of playlists created by the user. * @property {number} playlist_likes_count - The total number of playlists liked by the user. * @property {number} reposts_count - The total number of reposts made by the user. * @property {string} station_permalink - The permalink for the user's station. * @property {string} station_urn - The Uniform Resource Name for the user's station. * @property {number} track_count - The total number of tracks uploaded by the user. * @property {string} uri - The Uniform Resource Identifier for the user. * @property {string} urn - The Uniform Resource Name for the user. * @property {string} username - The user's unique username. * @property {boolean} verified - Indicates if the user's account is verified. */ /** * Class representing a SoundCloud Widget instance. */ declare class SoundCloudWidget { #private; /** * Creates an instance of SoundCloudWidget. * @param {HTMLElement|string} elementOrId - The iframe element or its ID. * @throws {TypeError} If the argument is not a string or an HTMLElement. */ constructor(elementOrId: HTMLElement | string); /** @returns {number} The current volume level. */ get volume(): number; /** * Sets the widget volume. * @param {number} value - Volume value between 0 and 100. * @throws {TypeError} If value is not a number. * @throws {RangeError} If value is outside the 0-100 range. */ set volume(value: number); /** * Adds a listener function for a specific event. * @param {string} eventName - The name of the event. * @param {Function} listener - The callback function. * @throws {TypeError} If listener is not a function. */ bind(eventName: string, listener: Function): void; /** * Removes all listeners for a specific event. * @param {string} eventName - The name of the event. */ unbind(eventName: string): void; /** * Simulates loading a new widget. * @param {string} url - The URL of the new widget. * @param {Record} [options] - Configuration options. */ load(url: string, options?: Record): void; /** Plays the sound. */ play(): void; /** Pauses the sound. */ pause(): void; /** Toggles the sound state. */ toggle(): void; /** * Jumps to a specific position. * @param {number} milliseconds - Position in milliseconds. * @throws {TypeError} If milliseconds is not a number. */ seekTo(milliseconds: number): void; /** * Sets the volume via method. * @param {number} volume - Value between 0 and 100. */ setVolume(volume: number): void; /** Skips to the next sound. */ next(): void; /** Skips to the previous sound. */ prev(): void; /** * Jumps to a specific sound index. * @param {number} soundIndex - Index starting from 0. * @throws {RangeError} If index is out of bounds. */ skip(soundIndex: number): void; /** * @param {(volume: number) => void} callback - Receives the volume. */ getVolume(callback: (volume: number) => void): void; /** * @param {(volume: number) => void} callback - Receives the duration. */ getDuration(callback: (volume: number) => void): void; /** * @param {(position: number) => void} callback - Receives the current position. */ getPosition(callback: (position: number) => void): void; /** * @param {(soundsData: Partial[]) => void} callback - Receives the list of sounds. */ getSounds(callback: (soundsData: Partial[]) => void): void; /** * @param {(soundData: Partial) => void} callback - Receives the current sound object. */ getCurrentSound(callback: (soundData: Partial) => void): void; /** * @param {(index: number) => void} callback - Receives the current sound index. */ getCurrentSoundIndex(callback: (index: number) => void): void; /** * @param {(paused: boolean) => void} callback - Receives the paused status. */ isPaused(callback: (paused: boolean) => void): void; /** * Triggers an event and notifies listeners. * @param {string} eventName * @param {any} data * @private */ private _triggerEvent; } export default SoundCloudWidget; //# sourceMappingURL=SoundCloudWidget.d.mts.map