-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecentTracks.ts
49 lines (42 loc) · 976 Bytes
/
RecentTracks.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
export interface RecentTracks {
"@attr": Attr;
track: Track[];
}
export interface Track {
album: Artist;
artist: Artist;
date: Date;
image: Image[];
mbid: string;
name: string;
streamable: string;
url: string;
}
export interface Image {
"#text": string;
size: string;
}
export interface Date {
"#text": string;
uts: string;
}
export interface Artist {
"#text": string;
mbid: string;
}
export interface Attr {
page: string;
perPage: string;
total: string;
totalPages: string;
user: string;
}
// Converts JSON strings to/from your types
export module RecentTracksConverter {
export function toRecentTracks(json: string): RecentTracks {
return JSON.parse(json);
}
export function recentTracksToJson(value: RecentTracks): string {
return JSON.stringify(value, null, 2);
}
}