Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type declaration for play operation #120

Merged
merged 1 commit into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/typings/spotify-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,17 @@ declare namespace SpotifyApi {
device_id?: string;
}

interface PlayParameterObject {
device_id?: string;
context_uri?: string;
uris?: string[];
offset?: {
position?: number;
uri?: string;
};
position_ms?: number;
}

//
// Responses from the Spotify Web API in the same order as in the API endpoint docs seen here:
// [API Endpoint Reference](https://developer.spotify.com/web-api/endpoint-reference/)
Expand Down
4 changes: 2 additions & 2 deletions src/typings/spotify-web-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,8 @@ declare namespace SpotifyWebApi {
* one is the error object (null if no error), and the second is the value if the request succeeded.
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
play(options?: SpotifyApi.DeviceSpecificParameterObject): Promise<void>;
play(options: SpotifyApi.DeviceSpecificParameterObject, callback: VoidResultsCallback): void;
play(options?: SpotifyApi.PlayParameterObject): Promise<void>;
play(options: SpotifyApi.PlayParameterObject, callback: VoidResultsCallback): void;
play(callback: VoidResultsCallback): void;

/**
Expand Down