@dvxch/yandex-music
    Preparing search index...

    Class Track

    A music track.

    In addition to plain data, a track carries convenience methods (such as Track.getDownloadInfo) that delegate to the owning Client.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    albums?: Album[]

    Albums the track belongs to.

    artists?: Artist[]

    Performing artists.

    available?: boolean

    Whether the track is available for playback.

    availableAsRbt?: boolean

    Whether available as a ringback tone.

    availableForOptions?: string[]

    Options the track is available for.

    availableForPremiumUsers?: boolean

    Whether available for premium users.

    availableFullWithoutPermission?: boolean

    Whether the full track is available without a subscription.

    backgroundVideoId?: string

    Background video identifier.

    backgroundVideoUri?: string

    Background video URI for the track.

    best?: boolean

    Whether this is the "best" track.

    canPublish?: boolean

    Whether the track can be published.

    chart?: Chart

    Chart standing, present when the track comes from a chart context.

    client?: Client

    The client that created this model, used by convenience methods.

    contentWarning?: string

    Content warning marker.

    coverUri?: string

    Cover URI template.

    derivedColors?: CoverDerivedColors

    Colors derived from the cover.

    desiredVisibility?: string

    Desired visibility.

    disclaimers?: string[]

    Disclaimers.

    durationMs?: number

    Duration in milliseconds.

    error?: string

    Error code when the track could not be resolved.

    explicit?: boolean

    Explicit marker.

    fade?: Fade

    Crossfade timings.

    filename?: string

    Original filename (user-uploaded tracks).

    fileSize?: number

    File size in bytes.

    id?: string | number

    Unique track identifier.

    isSuitableForChildren?: boolean

    Whether suitable for children.

    lyricsAvailable?: boolean

    Whether lyrics are available.

    lyricsInfo?: LyricsInfo

    Lyrics availability flags.

    major?: Major

    Content provider major.

    matchedTrack?: Track

    Track this one matched against (search).

    metaData?: MetaData

    Embedded tag metadata.

    normalization?: Normalization

    Loudness normalization parameters.

    ogImage?: string

    Open Graph image URI template.

    playerId?: string

    Player identifier.

    podcastEpisodeType?: string

    Podcast episode kind (podcast episodes only).

    poetryLoverMatches?: PoetryLoverMatch[]

    Matched lyric ranges (poetry-lover feature).

    previewDurationMs?: number

    Preview duration in milliseconds.

    pubDate?: string

    Publication date (podcast episodes only, ISO 8601).

    r128?: R128

    EBU R128 loudness measurements.

    realId?: string | number

    Canonical track id when this track is a duplicate.

    regions?: string[]

    Regions where available.

    rememberPosition?: boolean

    Whether playback position is remembered (podcasts).

    shortDescription?: string

    Short description (podcasts).

    smartPreviewParams?: SmartPreviewParams

    Smart preview parameters.

    specialAudioResources?: string[]

    Special audio resource identifiers.

    state?: string

    Publication state.

    storageDir?: string

    Storage directory.

    substituted?: Track

    Track substituted for this one when unavailable.

    title?: string

    Track title.

    trackSharingFlag?: string

    Sharing flag.

    trackSource?: string

    Source of the track.

    type?: string

    Track kind, for example music or podcast-episode.

    version?: string

    Version (for example "Remastered").

    Methods

    • Fetch the lyrics of this track.

      Parameters

      • format: "TEXT" | "LRC" = 'TEXT'

        TEXT (plain) or LRC (time-synced). Defaults to TEXT.

      Returns Promise<TrackLyrics | null>

      The lyrics, or null when none exist.

      On any transport or API error.

    • Assert that this model carries a client, returning it narrowed to non-null.

      Convenience methods that need to call the API use this to fail fast with a clear message instead of a generic "cannot read property of undefined".

      Returns Client

      The owning Client.

      When the model was created without a client.

    • Resolve the numeric portion of this track's id (drops any :album suffix).

      Returns string | number

      The track id as-is, suitable for passing to API methods.

      When the track has no id.