Added playlist
This commit is contained in:
+30
-2
@@ -1,4 +1,4 @@
|
||||
import {Song, PlayingSong, QueuedSong} from "./dataTypes";
|
||||
import {Song, PlayingSong, QueuedSong, Playlist} from "./dataTypes";
|
||||
|
||||
export type StuenMessages =
|
||||
ListenerLeft
|
||||
@@ -15,7 +15,11 @@ export type StuenMessages =
|
||||
| ReorderSong
|
||||
| SkipSong
|
||||
| SongLikes
|
||||
| ToggleSongLike;
|
||||
| CreatePlaylist
|
||||
| ToggleSongLike
|
||||
| AddSongToPlaylist
|
||||
| RemoveSongFromPlaylist
|
||||
| Playlists;
|
||||
|
||||
export abstract class StuenMessage {
|
||||
constructor(public type: string) {
|
||||
@@ -120,3 +124,27 @@ export class SongLikes extends StuenMessage {
|
||||
super('SongLikes');
|
||||
}
|
||||
}
|
||||
|
||||
export class CreatePlaylist extends StuenMessage {
|
||||
constructor(public title: string) {
|
||||
super('CreatePlaylist');
|
||||
}
|
||||
}
|
||||
|
||||
export class Playlists extends StuenMessage {
|
||||
constructor(public playlists: Playlist[]) {
|
||||
super('Playlists');
|
||||
}
|
||||
}
|
||||
|
||||
export class AddSongToPlaylist extends StuenMessage {
|
||||
constructor(public song: Song, public playlist: string) {
|
||||
super('AddSongToPlaylist');
|
||||
}
|
||||
}
|
||||
|
||||
export class RemoveSongFromPlaylist extends StuenMessage {
|
||||
constructor(public song: Song, public playlist: string) {
|
||||
super('RemoveSongToPlaylist');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user