spotify-api / spotify-types Goto Github PK
View Code? Open in Web Editor NEWAll the typings for the various Spotify API Object typings written in typescript.
Home Page: https://www.npmjs.com/package/spotify-types
License: MIT License
All the typings for the various Spotify API Object typings written in typescript.
Home Page: https://www.npmjs.com/package/spotify-types
License: MIT License
I could not find any typings for the recently-played
endpoint.
https://developer.spotify.com/console/get-recently-played/
I would like to have types for the token object returned from the access token request.
interface Token {
accessToken: string;
tokenType: string;
expiresIn: number;
}
I can open a PR for it. Thank you
See docs here. Suggested type below:
interface FollowedArtistCursors {
/** 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;
}
interface FollowedArtistCursorPaging<T> {
/** A link to the Web API endpoint returning the full result of the request. */
href: string;
/** The maximum number of items in the response (as set in the query or by default). */
limit: number;
/** URL to the next page of items. (null if none) */
next: string;
/** The cursors used to find the next set of items. */
cursors: FollowedArtistCursors;
/** The total number of items available to return. */
total: number;
/** The requested data. */
items: T[];
}
interface FollowedArtistsResults {
artists: FollowedArtistCursorPaging<Artist>;
}
Hi! Thank you for creating a great package. However, while using it, I noticed I couldn't narrow down the object types using standard TS type guards. For example, given an item: Track | Episode;
I can't narrow it down to Track
by simply checking item.type === "episode"
.
This happens because all interfaces share the same SpotifyType
, which doesn't guarantee an Episode
will always have a "episode"
as a type.
Could we change them to simple literal types to benefit from type narrowing? I'd like to file a PR if you're interested.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.