-
Notifications
You must be signed in to change notification settings - Fork 0
/
MusicKit.Queue.d.ts
73 lines (70 loc) · 2.43 KB
/
MusicKit.Queue.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
declare namespace MusicKit {
/**
* An array of media items to be played.
*/
interface Queue {
/**
* The item at the queue.position index within the queue.items array. This is the nowPlayingItem when the Queue is the current queue for the MusicKit Instance.
*/
currentItem: MediaItem;
/**
* A Boolean value indicating whether the queue has no items.
*/
readonly isEmpty: boolean;
/**
* An array of all the media items in the queue.
*/
readonly items: MediaItem[];
/**
* The number of items in the queue.
*/
readonly length: number;
/**
* The next playable media item in the queue.
*/
readonly nextPlayableItem?: MediaItem | undefined;
/**
* The current queue position.
*/
readonly position: number;
/**
* The previous playable media item in the queue.
*/
readonly previousPlayableItem?: MediaItem | undefined;
/**
* Add an event listener for a MusicKit queue by name.
*
* @param name The name of the event.
* @param callback The callback function to remove.
*/
addEventListener(name: string, callback: () => any): void;
/**
* Inserts the media items defined by the queue descriptor after the last
* media item in the current queue.
*/
append(descriptor: Descriptor): void;
/**
* Returns the index in the playback queue for a media item descriptor.
*
* @param descriptor A descriptor can be an instance of the MusicKit.MediaItem
* class, or a string identifier.
*/
indexForItem(descriptor: Descriptor): number;
/**
* Returns the media item located in the indicated array index.
*/
item(index: number): MediaItem | null | undefined;
/**
* Inserts the media items defined by the queue descriptor into the current
* queue immediately after the currently playing media item.
*/
prepend(descriptor: any): void;
/**
* Removes an event listener for a MusicKit queue by name.
*
* @param name The name of the event.
* @param callback The callback function to remove.
*/
removeEventListener(name: string, callback: () => any): void;
}
}