-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMusicKit.d.ts
95 lines (87 loc) · 2.46 KB
/
MusicKit.d.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/// <reference path="MusicKit.Player.d.ts" />
/**
* Use the MusicKit namespace to configure MusicKit JS and to access app
* instances, control music playback, and fetch data from the Apple Music API.
*/
declare namespace MusicKit {
/**
* A configuration for an app.
*/
interface AppConfiguration {
/**
* The build number of your app.
*/
build?: string | undefined;
/**
* A URL for your app icon.
*/
icon?: string | undefined;
/**
* The name of your app.
*/
name?: string | undefined;
/**
* The version of your app.
*/
version?: string | undefined;
}
interface FormattedPlaybackDuration {
hours: number;
minutes: number;
}
interface EmbedOptions {
height: number | string;
width: number | string;
}
const errors: MKError[];
const version: string;
interface AuthStatus {
NOT_DETERMINED: 0;
DENIED: 1;
RESTRICTED: 2;
AUTHORIZED: 3;
}
/**
* A dictionary of configuration options for the MusicKit instance.
*/
interface Configuration {
/**
* The version of your app.
*/
app?: AppConfiguration | undefined;
/**
* This property indicates whether you have explicitly enabled or disabled
* declarative markup.
*/
declarativeMarkup?: boolean | undefined;
/**
* The developer token to identify yourself as a trusted developer and
* member of the Apple Developer Program.
*/
developerToken?: string | undefined;
/**
* The current storefront for this MusicKit configuration.
*/
storefrontId?: string | undefined;
/**
* The playback bit rate of the music player.
*/
bitrate?: PlaybackBitrate | undefined;
}
/**
* Configure a MusicKit instance.
*/
function configure(configuration: Configuration): Promise<MusicKitInstance>;
/**
* Returns the configured MusicKit instance.
*/
function getInstance(): MusicKitInstance;
/**
* Returns a formatted artwork URL.
*
* @param artwork An artwork resource object.
* @param height The desired artwork height.
* @param width the desired artwork width.
*/
function formatArtworkURL(artwork: Artwork, width?: number, height?: number): string;
}