forked from Moebits/soundcloud.ts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSoundCloud.ts
44 lines (41 loc) · 1.57 KB
/
SoundCloud.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
import api from "./API"
import {Apps, Comments, Me, Oembed, Playlists, Resolve, Tracks, Users, Util} from "./entities/index"
const publicID = "BeGVhOrGmfboy1LtiHTQF6Ejpt9ULJCI"
/**
* The main class for interacting with the Soundcloud API.
*/
export default class Soundcloud {
public static clientID: string
public static oauthToken: string
public api = new api(Soundcloud.clientID, Soundcloud.oauthToken)
public tracks = new Tracks(this.api)
public users = new Users(this.api)
public playlists = new Playlists(this.api)
public oembed = new Oembed(this.api)
public resolve = new Resolve(this.api)
public me = new Me(this.api)
public comments = new Comments(this.api)
public apps = new Apps(this.api)
public util = new Util(this.api)
public constructor(clientID?: string, oauthToken?: string) {
if (clientID) {
Soundcloud.clientID = clientID
if (oauthToken) Soundcloud.oauthToken = oauthToken
} else {
Soundcloud.clientID = publicID
}
this.api = new api(Soundcloud.clientID, Soundcloud.oauthToken)
this.tracks = new Tracks(this.api)
this.users = new Users(this.api)
this.playlists = new Playlists(this.api)
this.oembed = new Oembed(this.api)
this.resolve = new Resolve(this.api)
this.me = new Me(this.api)
this.comments = new Comments(this.api)
this.apps = new Apps(this.api)
this.util = new Util(this.api)
}
}
module.exports.default = Soundcloud
export * from "./entities/index"
export * from "./types/index"