Options
All
  • Public
  • Public/Protected
  • All
Menu

The core of the library

Hierarchy

Index

Constructors

constructor

Properties

accessTokenDetails

accessTokenDetails: null | AccessTokenDetails

The details about the access token returned by the API after authorization

albums

albums: AlbumManager

The album nanager class that holds the cache of albums and their methods

artists

artists: ArtistManager

The manager class that holds cache and API methods of artists

categories

categories: CategoryManager

The manager class that holds cache and API methods of categories

credentials

credentials: null | ClientCredentials

The credentials for the client to login with

episodes

episodes: EpisodeManager

The manager class that holds cache and API methods of episodes

lastTokenUpdateAt

lastTokenUpdateAt: null | Date

Time at which the client last updated the access token

options

options: ClientOptions

Options to pass when initiating the client

playlists

playlists: PlaylistManager

The manager class that holds cache and API methods of playlists

readyAt

readyAt: null | Date

Time at which the client became ready

rest

rest: default

The rest manager class that holds the methods for API calls

shows

The manager class that holds cache and API methods of shows

tracks

tracks: TrackManager

The manager class that holds cache and API methods of tracks

users

users: default

The manager class that holds cache and API methods of users

Static Readonly captureRejectionSymbol

captureRejectionSymbol: typeof captureRejectionSymbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Accessors

_api

  • get _api(): any

Methods

_updateAccessToken

  • Updates the access token by making a brand new Client Credentials Flow authorization request and emits accessTokenUpdate event on success

    Returns Promise<AccessTokenDetails>

    An AccessTokenDetails object

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

fetchAvailableMarkets

  • fetchAvailableMarkets(): Promise<string[]>
  • Fetches a list of markets where Spotify is available

    Returns Promise<string[]>

    An array of ISO 3166-1 alpha-2 strings as a Promise

fetchRecommendationGenres

  • fetchRecommendationGenres(): Promise<string[]>
  • Fetches a list of available genres

    Returns Promise<string[]>

    An array of genre strings as a Promise

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

login

off

  • off(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

on

  • on(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

once

  • once(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): Client

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

setMaxListeners

  • setMaxListeners(n: number): Client

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Static on

  • on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>
  • Parameters

    • emitter: EventEmitter
    • event: string

    Returns AsyncIterableIterator<any>

Static once

  • once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>
  • once(emitter: DOMEventTarget, event: string): Promise<any[]>
  • Parameters

    • emitter: NodeEventTarget
    • event: string | symbol

    Returns Promise<any[]>

  • Parameters

    • emitter: DOMEventTarget
    • event: string

    Returns Promise<any[]>

Legend

  • Constructor
  • Property
  • Method
  • Constructor
  • Property
  • Inherited property
  • Inherited method
  • Protected property
  • Protected method
  • Private property
  • Private method

Generated using TypeDoc