Skip to content

Commit 932e72d

Browse files
pduchesneJMPerez
authored andcommitted
Fix type declaration for play operation and match existing implementation (#120)
1 parent cf44467 commit 932e72d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/typings/spotify-api.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ declare namespace SpotifyApi {
125125
offset?: Object;
126126
}
127127

128+
interface PlayParameterObject {
129+
device_id?: string;
130+
context_uri?: string;
131+
uris?: string[];
132+
offset?: {
133+
position?: number;
134+
uri?: string;
135+
};
136+
position_ms?: number;
137+
}
138+
128139
//
129140
// Responses from the Spotify Web API in the same order as in the API endpoint docs seen here:
130141
// [API Endpoint Reference](https://developer.spotify.com/web-api/endpoint-reference/)

src/typings/spotify-web-api.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,8 @@ declare namespace SpotifyWebApi {
940940
* one is the error object (null if no error), and the second is the value if the request succeeded.
941941
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
942942
*/
943-
play(options?: SpotifyApi.DeviceSpecificParameterObject): Promise<void>;
944-
play(options: SpotifyApi.DeviceSpecificParameterObject, callback: VoidResultsCallback): void;
943+
play(options?: SpotifyApi.PlayParameterObject): Promise<void>;
944+
play(options: SpotifyApi.PlayParameterObject, callback: VoidResultsCallback): void;
945945
play(callback: VoidResultsCallback): void;
946946

947947
/**

0 commit comments

Comments
 (0)