Skip to content

Commit

Permalink
fix: made cursorpaging global as per issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
scientific-dev committed Apr 18, 2024
1 parent 8526e45 commit 9b44009
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
19 changes: 19 additions & 0 deletions typings/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,25 @@ export interface Paging<T> {
total: number;
}

/**
* The cursor object having before and after keys of the items.
*/
export interface Cursor {
/** The cursor to use as key to find the next page of items. */
after: string;
/** The cursor to use as key to find the previous page of items. */
before: string;
}


/**
* The paging object but with a additional cursor field.
*/
export interface CursorPaging<T> extends Omit<Paging<T>, 'offset' | 'previous'> {
/** The cursors used to find the next set of items. */
cursors: Cursor;
}

/**
* The copyright object contains the type and the name of copyright.
*/
Expand Down
19 changes: 1 addition & 18 deletions typings/player.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SimplifiedTrack, Track } from "./track";
import { Episode } from "./episode";
import { ErrorResponse, ExternalUrl, Paging, SpotifyType } from "./global";
import { ErrorResponse, ExternalUrl, Cursor, SpotifyType } from "./global";

/**
* The repeat state of the context.
Expand Down Expand Up @@ -122,23 +122,6 @@ export interface CurrentlyPlaying {
timestamp: number;
}

/**
* The cursor object of the player api.
*/
export interface Cursor {
/** The cursor to use as key to find the next page of items. */
after: string;
}


/**
* The cursor paging object of the player api.
*/
export interface CursorPaging<T> extends Omit<Paging<T>, 'offset' | 'previous'> {
/** The cursors used to find the next set of items. */
cursors: Cursor;
}

/**
* The devices object of the player api.
*/
Expand Down
2 changes: 1 addition & 1 deletion typings/user.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface FollowedArtistsResults {
/**
* The spotify api object containing the user's access token.
*
* @see https://developer.spotify.com/documentation/general/guides/authorization/client-credentials/
* @see https://developer.spotify.com/documentation/web-api/concepts/access-token
*/
export interface AccessToken {
/** The token used to access the Spotify Web API */
Expand Down

0 comments on commit 9b44009

Please sign in to comment.