Common stuff initial

This commit is contained in:
Torben Pi Jensen 2023-11-05 13:50:06 +01:00
parent 0ac6508abc
commit d82afc5e9d
4 changed files with 143 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,2 +1 @@
node_modules/
dist/

18
dist/common.js vendored Normal file
View File

@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
exports.__esModule = true;
__exportStar(require("./dataTypes"), exports);
__exportStar(require("./messageTypes"), exports);

19
dist/dataTypes.js vendored Normal file
View File

@ -0,0 +1,19 @@
"use strict";
exports.__esModule = true;
exports.SongType = exports.Song = void 0;
var Song = /** @class */ (function () {
function Song(type, title, url, image, length) {
this.type = type;
this.title = title;
this.url = url;
this.image = image;
this.length = length;
}
return Song;
}());
exports.Song = Song;
var SongType;
(function (SongType) {
SongType[SongType["YouTube"] = 0] = "YouTube";
SongType[SongType["Spotify"] = 1] = "Spotify";
})(SongType = exports.SongType || (exports.SongType = {}));

106
dist/messageTypes.js vendored Normal file
View File

@ -0,0 +1,106 @@
"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 __());
};
})();
exports.__esModule = true;
exports.SearchSongResult = exports.SearchSong = exports.ChatMessage = exports.SendChatMessage = exports.ListenerList = exports.ListenerLeft = exports.ListenerJoined = 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 ListenerJoined = /** @class */ (function (_super) {
__extends(ListenerJoined, _super);
function ListenerJoined(name) {
var _this = _super.call(this, 'ListenerJoined') || this;
_this.name = name;
return _this;
}
return ListenerJoined;
}(StuenMessage));
exports.ListenerJoined = ListenerJoined;
var ListenerLeft = /** @class */ (function (_super) {
__extends(ListenerLeft, _super);
function ListenerLeft(name) {
var _this = _super.call(this, 'ListenerLeft') || this;
_this.name = name;
return _this;
}
return ListenerLeft;
}(StuenMessage));
exports.ListenerLeft = ListenerLeft;
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;