diff --git a/dataTypes.ts b/dataTypes.ts index 7d5110a..e560ecf 100644 --- a/dataTypes.ts +++ b/dataTypes.ts @@ -4,10 +4,10 @@ export class Song { public title: string; public url: string; public image: string; - public length: number; + public length: number | null; - constructor(type: SongType, title: string, url: string, image: string, length: number) { + constructor(type: SongType, title: string, url: string, image: string, length: number | null = null) { this.type = type; this.title = title; this.url = url; @@ -20,4 +20,4 @@ export enum SongType { YouTube, Spotify } - + diff --git a/dist/dataTypes.d.ts b/dist/dataTypes.d.ts index d7e3a7e..09c336b 100644 --- a/dist/dataTypes.d.ts +++ b/dist/dataTypes.d.ts @@ -3,8 +3,8 @@ export declare class Song { title: string; url: string; image: string; - length: number; - constructor(type: SongType, title: string, url: string, image: string, length: number); + length: number | null; + constructor(type: SongType, title: string, url: string, image: string, length?: number | null); } export declare enum SongType { YouTube = 0, diff --git a/dist/dataTypes.js b/dist/dataTypes.js index 99e262e..e599150 100644 --- a/dist/dataTypes.js +++ b/dist/dataTypes.js @@ -3,6 +3,7 @@ exports.__esModule = true; exports.SongType = exports.Song = void 0; var Song = /** @class */ (function () { function Song(type, title, url, image, length) { + if (length === void 0) { length = null; } this.type = type; this.title = title; this.url = url;