common/dist/messageTypes.js
2024-05-04 16:09:35 +02:00

283 lines
10 KiB
JavaScript

"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RemoveFromAutoPlay = exports.Shuffle = exports.ToggleTag = exports.RemoveSongFromPlaylist = exports.AddSongToPlaylist = exports.OthersPlaylists = exports.GetOtherPlaylists = exports.PlaylistSongs = exports.GetPlaylist = exports.Playlists = exports.RemovePlaylist = exports.CreatePlaylist = exports.SongLikes = exports.ToggleSongLike = exports.SkipSong = exports.ReorderSong = exports.UnqueueSong = exports.CurrentSong = exports.CurrentQueue = exports.QueueSong = exports.SearchSongResult = exports.SearchSong = exports.ChatMessage = exports.SendChatMessage = exports.ListenerList = exports.Join = exports.StuenMessage = void 0;
var StuenMessage = /** @class */ (function () {
function StuenMessage(type) {
this.type = type;
}
return StuenMessage;
}());
exports.StuenMessage = StuenMessage;
var Join = /** @class */ (function (_super) {
__extends(Join, _super);
function Join(name) {
var _this = _super.call(this, 'Join') || this;
_this.name = name;
return _this;
}
return Join;
}(StuenMessage));
exports.Join = Join;
var ListenerList = /** @class */ (function (_super) {
__extends(ListenerList, _super);
function ListenerList(names) {
var _this = _super.call(this, 'ListenerList') || this;
_this.names = names;
return _this;
}
return ListenerList;
}(StuenMessage));
exports.ListenerList = ListenerList;
var SendChatMessage = /** @class */ (function (_super) {
__extends(SendChatMessage, _super);
function SendChatMessage(message) {
var _this = _super.call(this, 'SendChatMessage') || this;
_this.message = message;
return _this;
}
return SendChatMessage;
}(StuenMessage));
exports.SendChatMessage = SendChatMessage;
var ChatMessage = /** @class */ (function (_super) {
__extends(ChatMessage, _super);
function ChatMessage(name, message) {
var _this = _super.call(this, 'ChatMessage') || this;
_this.name = name;
_this.message = message;
return _this;
}
return ChatMessage;
}(StuenMessage));
exports.ChatMessage = ChatMessage;
var SearchSong = /** @class */ (function (_super) {
__extends(SearchSong, _super);
function SearchSong(query) {
var _this = _super.call(this, 'SearchSong') || this;
_this.query = query;
return _this;
}
return SearchSong;
}(StuenMessage));
exports.SearchSong = SearchSong;
var SearchSongResult = /** @class */ (function (_super) {
__extends(SearchSongResult, _super);
function SearchSongResult(result) {
var _this = _super.call(this, 'SearchSongResult') || this;
_this.result = result;
return _this;
}
return SearchSongResult;
}(StuenMessage));
exports.SearchSongResult = SearchSongResult;
var QueueSong = /** @class */ (function (_super) {
__extends(QueueSong, _super);
function QueueSong(song) {
var _this = _super.call(this, 'QueueSong') || this;
_this.song = song;
return _this;
}
return QueueSong;
}(StuenMessage));
exports.QueueSong = QueueSong;
var CurrentQueue = /** @class */ (function (_super) {
__extends(CurrentQueue, _super);
function CurrentQueue(songs) {
var _this = _super.call(this, 'CurrentQueue') || this;
_this.songs = songs;
return _this;
}
return CurrentQueue;
}(StuenMessage));
exports.CurrentQueue = CurrentQueue;
var CurrentSong = /** @class */ (function (_super) {
__extends(CurrentSong, _super);
function CurrentSong(song) {
var _this = _super.call(this, 'CurrentSong') || this;
_this.song = song;
return _this;
}
return CurrentSong;
}(StuenMessage));
exports.CurrentSong = CurrentSong;
var UnqueueSong = /** @class */ (function (_super) {
__extends(UnqueueSong, _super);
function UnqueueSong(position, all) {
if (all === void 0) { all = false; }
var _this = _super.call(this, 'UnqueueSong') || this;
_this.position = position;
_this.all = all;
return _this;
}
return UnqueueSong;
}(StuenMessage));
exports.UnqueueSong = UnqueueSong;
var ReorderSong = /** @class */ (function (_super) {
__extends(ReorderSong, _super);
function ReorderSong(positionToMove, placePosition) {
var _this = _super.call(this, 'ReorderSong') || this;
_this.positionToMove = positionToMove;
_this.placePosition = placePosition;
return _this;
}
return ReorderSong;
}(StuenMessage));
exports.ReorderSong = ReorderSong;
var SkipSong = /** @class */ (function (_super) {
__extends(SkipSong, _super);
function SkipSong() {
return _super.call(this, 'SkipSong') || this;
}
return SkipSong;
}(StuenMessage));
exports.SkipSong = SkipSong;
var ToggleSongLike = /** @class */ (function (_super) {
__extends(ToggleSongLike, _super);
function ToggleSongLike() {
return _super.call(this, 'ToggleSongLike') || this;
}
return ToggleSongLike;
}(StuenMessage));
exports.ToggleSongLike = ToggleSongLike;
var SongLikes = /** @class */ (function (_super) {
__extends(SongLikes, _super);
function SongLikes(listeners) {
var _this = _super.call(this, 'SongLikes') || this;
_this.listeners = listeners;
return _this;
}
return SongLikes;
}(StuenMessage));
exports.SongLikes = SongLikes;
var CreatePlaylist = /** @class */ (function (_super) {
__extends(CreatePlaylist, _super);
function CreatePlaylist(title) {
var _this = _super.call(this, 'CreatePlaylist') || this;
_this.title = title;
return _this;
}
return CreatePlaylist;
}(StuenMessage));
exports.CreatePlaylist = CreatePlaylist;
var RemovePlaylist = /** @class */ (function (_super) {
__extends(RemovePlaylist, _super);
function RemovePlaylist(title) {
var _this = _super.call(this, 'RemovePlaylist') || this;
_this.title = title;
return _this;
}
return RemovePlaylist;
}(StuenMessage));
exports.RemovePlaylist = RemovePlaylist;
var Playlists = /** @class */ (function (_super) {
__extends(Playlists, _super);
function Playlists(playlists) {
var _this = _super.call(this, 'Playlists') || this;
_this.playlists = playlists;
return _this;
}
return Playlists;
}(StuenMessage));
exports.Playlists = Playlists;
var GetPlaylist = /** @class */ (function (_super) {
__extends(GetPlaylist, _super);
function GetPlaylist(playlist) {
var _this = _super.call(this, 'GetPlaylist') || this;
_this.playlist = playlist;
return _this;
}
return GetPlaylist;
}(StuenMessage));
exports.GetPlaylist = GetPlaylist;
var PlaylistSongs = /** @class */ (function (_super) {
__extends(PlaylistSongs, _super);
function PlaylistSongs(playlist) {
var _this = _super.call(this, 'PlaylistSongs') || this;
_this.playlist = playlist;
return _this;
}
return PlaylistSongs;
}(StuenMessage));
exports.PlaylistSongs = PlaylistSongs;
var GetOtherPlaylists = /** @class */ (function (_super) {
__extends(GetOtherPlaylists, _super);
function GetOtherPlaylists() {
return _super.call(this, 'GetOtherPlaylists') || this;
}
return GetOtherPlaylists;
}(StuenMessage));
exports.GetOtherPlaylists = GetOtherPlaylists;
var OthersPlaylists = /** @class */ (function (_super) {
__extends(OthersPlaylists, _super);
function OthersPlaylists(playlists) {
var _this = _super.call(this, 'OthersPlaylists') || this;
_this.playlists = playlists;
return _this;
}
return OthersPlaylists;
}(StuenMessage));
exports.OthersPlaylists = OthersPlaylists;
var AddSongToPlaylist = /** @class */ (function (_super) {
__extends(AddSongToPlaylist, _super);
function AddSongToPlaylist(song, playlist) {
var _this = _super.call(this, 'AddSongToPlaylist') || this;
_this.song = song;
_this.playlist = playlist;
return _this;
}
return AddSongToPlaylist;
}(StuenMessage));
exports.AddSongToPlaylist = AddSongToPlaylist;
var RemoveSongFromPlaylist = /** @class */ (function (_super) {
__extends(RemoveSongFromPlaylist, _super);
function RemoveSongFromPlaylist(song, playlist) {
var _this = _super.call(this, 'RemoveSongFromPlaylist') || this;
_this.song = song;
_this.playlist = playlist;
return _this;
}
return RemoveSongFromPlaylist;
}(StuenMessage));
exports.RemoveSongFromPlaylist = RemoveSongFromPlaylist;
var ToggleTag = /** @class */ (function (_super) {
__extends(ToggleTag, _super);
function ToggleTag(song, tag) {
var _this = _super.call(this, 'ToggleTag') || this;
_this.song = song;
_this.tag = tag;
return _this;
}
return ToggleTag;
}(StuenMessage));
exports.ToggleTag = ToggleTag;
var Shuffle = /** @class */ (function (_super) {
__extends(Shuffle, _super);
function Shuffle() {
return _super.call(this, 'Shuffle') || this;
}
return Shuffle;
}(StuenMessage));
exports.Shuffle = Shuffle;
var RemoveFromAutoPlay = /** @class */ (function (_super) {
__extends(RemoveFromAutoPlay, _super);
function RemoveFromAutoPlay() {
return _super.call(this, 'RemoveFromAutoPlay') || this;
}
return RemoveFromAutoPlay;
}(StuenMessage));
exports.RemoveFromAutoPlay = RemoveFromAutoPlay;