Class PaginatedList<T>

A paginated list of resources from the Deezer API. This class implements AsyncIterable to allow for easy iteration over all items.

Type Parameters

Implements

  • AsyncIterable<T>

Constructors

Methods

  • Returns AsyncIterator<T>

  • The total number of items in the list, mirroring what Deezer returns.

    Returns Promise<null | number>

    • The total number of items in the list.
  • Returns a slice of the list.

    Parameters

    • start: number = 0

      The index to start the slice at.

    • Optionalend: number

      The index to end the slice at.

    Returns Promise<T[]>

    • The slice of the list.
  • Returns the item at the given index.

    Parameters

    • index: number

      The index of the item to return.

    Returns Promise<T>

    • The item at the given index.
  • Returns the list as an array.

    This method is not recommended for large lists, as it will fetch all items at once.

    Returns Promise<T[]>

    • The list as an array.