You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably just me not knowing typescript enough, but I've been trying now for hours unsuccessfully.
I want to type a variable to SpotifyApi.TrackObjectFull[]
Basically after calling this.spotify.getTracks(...), I'm assigning the result to a variable, and I need to type it. In my IDE, I can see the return type of the function is a Promise<SpotifyApi.MultipleTracksResponse> inside of which is the tracks key, which has the type: TrackObjectFull[];
All I would like to do is to be able to define my variable like so:
letmyTrack: TrackObjectFull[]
However I'm unable to resolve this type from anywhere. Its doesn't seem to be exported from the 'spotify-web-api-js' module. I even tried npm i --save-dev @types/spotify-api to see if I could import it somehow from there, but when I try to import it, it says its not a module.
I can see that the IDE picks up on the type, but I really need to use it as well. What do I need to import for it to work?
Thank you for your help.
The text was updated successfully, but these errors were encountered:
This is probably just me not knowing typescript enough, but I've been trying now for hours unsuccessfully.
I want to type a variable to
SpotifyApi.TrackObjectFull[]
Basically after calling
this.spotify.getTracks(...)
, I'm assigning the result to a variable, and I need to type it. In my IDE, I can see the return type of the function is aPromise<SpotifyApi.MultipleTracksResponse>
inside of which is thetracks
key, which has the type:TrackObjectFull[];
All I would like to do is to be able to define my variable like so:
However I'm unable to resolve this type from anywhere. Its doesn't seem to be exported from the
'spotify-web-api-js'
module. I even triednpm i --save-dev @types/spotify-api
to see if I could import it somehow from there, but when I try to import it, it says its not a module.I can see that the IDE picks up on the type, but I really need to use it as well. What do I need to import for it to work?
Thank you for your help.
The text was updated successfully, but these errors were encountered: