From cac779ffaad1b699c83a963357d999ccc1a10387 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 19 May 2025 21:22:28 -0400 Subject: [PATCH] update types --- index.ts | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/index.ts b/index.ts index 01fc1d2..4a9c686 100644 --- a/index.ts +++ b/index.ts @@ -95,18 +95,18 @@ const tracks = await utils.fetchTracks() as { premiumStreamingOnly: boolean, trackNumber: number, volumeNumber: number, // discNumber - version: null, // ? + version: string, // Slowed, Acoustic, Remix, etc popularity: number, copyright: string, - bpm: null, // think this is only provided to DJ users + bpm: null | number, // not available for all tracks url: string, isrc: string, editable: boolean, explicit: boolean, audioQuality: string, - audioModes: "STEREO"[], // todo find other modes + audioModes: "STEREO" | "DOLBY_ATMOS"[], // todo find other modes mediaMetadata: { - tags: "LOSSLESS"[], // todo find other tags + tags: "DOLBY_ATMOS" | "LOSSLESS" | "HIRES_LOSSLESS"[], // todo find other tags }, upload: boolean, // was uploaded by a user artist: { @@ -121,7 +121,7 @@ const tracks = await utils.fetchTracks() as { id: number, name: string, handle: null, - type: "MAIN", + type: "MAIN" | "FEATURED", picture: string, } ], @@ -130,15 +130,22 @@ const tracks = await utils.fetchTracks() as { title: string, cover: string, vibrantColor: string, - videoCover: null, + videoCover: null | string, // only available for some albums }, mixes: { - TRACK_MIX: string, + TRACK_MIX?: string, }, } }[] }; - +/* +for (const track of tracks.items) { + // check if has more than just stereo + if (track.item.artist.handle) { + console.log(track.item.artist.handle); + } +} +*/ /* Remove all tracks that are unavailable for (const track of tracks.items) { if (track.item.streamReady) {