File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed
Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 44 "homepage" : " https://github.com/microlinkhq/spotify-url-info" ,
55 "version" : " 3.2.18" ,
66 "main" : " src/index.js" ,
7+ "types" : " src/index.d.ts" ,
78 "author" : {
89 "email" : " kall@kall.ws" ,
910 "name" : " Karl Sander"
Original file line number Diff line number Diff line change 1+ export type SpotifyType = 'album' | 'artist' | 'episode' | 'playlist' | 'track'
2+
3+ export interface ImageSource {
4+ url : string
5+ width ?: number
6+ height ?: number
7+ }
8+
9+ export interface Track {
10+ artist : string
11+ duration ?: number
12+ name : string
13+ previewUrl ?: string
14+ uri : string
15+ }
16+
17+ export interface Preview {
18+ date : string | null
19+ title : string
20+ type : SpotifyType
21+ track : string
22+ description ?: string
23+ artist : string
24+ image ?: string
25+ audio ?: string
26+ link : string
27+ embed : string
28+ }
29+
30+ export interface Details {
31+ preview : Preview
32+ tracks : Track [ ]
33+ }
34+
35+ export interface SpotifyUrlInfo {
36+ getLink : ( data : unknown ) => string
37+ getData : ( url : string , opts ?: RequestInit ) => Promise < unknown >
38+ getPreview : ( url : string , opts ?: RequestInit ) => Promise < Preview >
39+ getTracks : ( url : string , opts ?: RequestInit ) => Promise < Track [ ] >
40+ getDetails : ( url : string , opts ?: RequestInit ) => Promise < Details >
41+ }
42+
43+ export interface SpotifyUrlInfoModule {
44+ ( fetch : typeof fetch ) : SpotifyUrlInfo
45+ parseData : ( html : string ) => unknown
46+ throwError : ( message : string , html : string ) => never
47+ }
48+
49+ export default SpotifyUrlInfoModule
You can’t perform that action at this time.
0 commit comments