diff --git a/README.md b/README.md index 74a7ccb..2cba63b 100644 --- a/README.md +++ b/README.md @@ -226,148 +226,6 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play }) ``` -### Data Types - -#### `ThumbnailFull` - -| Name | Data Type | Description | -| :----- | :-------- | :------------------ | -| url | `string` | Link | -| width | `number` | Width of the image | -| height | `number` | Height of the image | - -#### `SongDetailed` - -| Name | Data Type | Description | -| :--------- | :---------------------------------- | :------------------ | -| type | `"SONG"` | Type of data | -| videoId | `string` | YouTube Video ID | -| name | `string` | Name | -| artists | [ArtistBasic](#ArtistBasic)`[]` | Artists | -| album | [AlbumBasic](#AlbumBasic) | Album | -| duration | `number` | Duration in seconds | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | - -#### `SongFull` - -| Name | Data Type | Description | -| :-------------- | :---------------------------------- | :--------------------- | -| type | `"SONG"` | Type of data | -| videoId | `string` | YouTube Video ID | -| name | `string` | Name | -| artists | [ArtistBasic](#ArtistBasic)`[]` | Artists | -| duration | `number` | Duration in seconds | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | -| description | `string` | Description | -| formats | `any[]` | Video Formats | -| adaptiveFormats | `any[]` | Adaptive Video Formats | - -#### `VideoDetailed` - -| Name | Data Type | Description | -| :--------- | :---------------------------------- | :------------------------------ | -| type | `"VIDEO"` | Type of data | -| videoId | `string` | YouTube Video ID | -| name | `string` | Name | -| artists | [ArtistBasic](#ArtistBasic)`[]` | Channels that created the video | -| views | `number` | View count | -| duration | `number` | Duration in seconds | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | - -#### `VideoFull` - -| Name | Data Type | Description | -| :---------- | :---------------------------------- | :------------------------------------- | -| type | `"VIDEO"` | Type of data | -| videoId | `string` | YouTube Video ID | -| name | `string` | Name | -| artists | [ArtistBasic](#ArtistBasic)`[]` | Channels that created the video | -| views | `number` | View count | -| duration | `number` | Duration in seconds | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | -| description | `string` | Description | -| unlisted | `boolean` | If the video is unlisted on YouTube | -| familySafe | `boolean` | If the video is family safe on YouTube | -| paid | `boolean` | If the video is paid on YouTube | -| tags | `string[]` | Tags | - -#### `ArtistBasic` - -| Name | Data Type | Description | -| :------- | :-------- | :---------- | -| artistId | `string` | Artist ID | -| name | `string` | Name | - -#### `ArtistDetailed` - -| Name | Data Type | Description | -| :--------- | :---------------------------------- | :----------- | -| type | `"ARTIST"` | Type of data | -| artistId | `string` | Artist ID | -| name | `string` | Name | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | - -#### `ArtistFull` - -| Name | Data Type | Description | -| :---------- | :---------------------------------------------------- | :----------------------------------- | -| type | `"ARTIST"` | Type of data | -| artistId | `string` | Artist ID | -| name | `string` | Name | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | -| description | `string` | Description | -| subscribers | `number` | Number of subscribers the Artist has | -| topSongs | `Omit<`[SongDetailed](#SongDetailed)`, "duration">[]` | Top Songs from Artist | -| topAlbums | [AlbumDetailed](#AlbumDetailed)`[]` | Top Albums from Artist | - -#### `AlbumBasic` - -| Name | Data Type | Description | -| :------ | :-------- | :---------- | -| albumId | `string` | Album ID | -| name | `string` | Name | - -#### `AlbumDetailed` - -| Name | Data Type | Description | -| :--------- | :---------------------------------- | :-------------------- | -| type | `"ALBUM"` | Type of data | -| albumId | `string` | Album ID | -| playlistId | `string` | Playlist ID for Album | -| name | `string` | Name | -| artists | [ArtistBasic](#ArtistBasic)`[]` | Creators of the Album | -| year | `number` | Publication Year | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | - -#### `AlbumFull` - -| Name | Data Type | Description | -| :---------- | :---------------------------------- | :-------------------- | -| type | `"ALBUM"` | Type of data | -| albumId | `string` | Album ID | -| playlistId | `string` | Playlist ID for Album | -| name | `string` | Name | -| artists | [ArtistBasic](#ArtistBasic)`[]` | Creators of the Album | -| year | `number` | Publication Year | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | -| description | `string` | Description | -| songs | [SongDetailed](#SongDetailed)`[]` | Songs in the Album | - -#### `PlaylistFull` - -| Name | Data Type | Description | -| :--------- | :---------------------------------- | :------------------------------- | -| type | `"PLAYLIST"` | Type of data | -| playlistId | `string` | Playlist ID | -| name | `string` | Name | -| artist | [ArtistBasic](#ArtistBasic) | Creator of the Playlist | -| videoCount | `number` | Number of videos in the Playlist | -| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | - -#### `SearchResult` - -[SongDetailed](#SongDetailed) or [VideoDetailed](#VideoDetailed) or [ArtistDetailed](#ArtistDetailed) or [AlbumDetailed](#AlbumDetailed) or [PlaylistFull](#PlaylistFull) - ## Credits A lot of the credit should go to [youtube-music-api](https://npmjs.com/package/youtube-music-api). I build this package as a refactored and tested version of youtube-music-api with TypeScript annotations diff --git a/docs/references/interfaces/AlbumDetailed.md b/docs/references/interfaces/AlbumDetailed.md index 1f05de3..919fc6a 100644 --- a/docs/references/interfaces/AlbumDetailed.md +++ b/docs/references/interfaces/AlbumDetailed.md @@ -2,20 +2,20 @@ ## Properties -| Name | Data Type | Description | -| :----------- | :----------------------------------- | :-------------------- | -| `type` | `"ALBUM"` | Type of data | -| `albumId` | `string` | Album ID | -| `playlistId` | `string` | Playlist ID for Album | -| `name` | `string` | Name | -| `artists` | [ArtistBasic](./ArtistBasic)`[]` | Creators of the Album | -| `year` | `number` | Publication Year | -| `thumbnails` | [ThumbnailFull](./ThumbnailFull)`[]` | Thumbnails | +| Name | Data Type | Description | +| :----------- | :---------------------------------------- | :-------------------- | +| `type` | `"ALBUM"` | Type of data | +| `albumId` | `string` | Album ID | +| `playlistId` | `string` | Playlist ID for Album | +| `name` | `string` | Name | +| `artists` | [ArtistBasic](./ArtistBasic.html)`[]` | Creators of the Album | +| `year` | `number` | Publication Year | +| `thumbnails` | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | ## TypeScript Source Code ```ts -interface AlbumBasic { +interface AlbumDetailed { type: "ALBUM" albumId: string playlistId: string @@ -25,3 +25,9 @@ interface AlbumBasic { thumbnails: ThumbnailFull[] } ``` + +## Usages + +[ArtistFull#topAlbums](./ArtistFull.html) + +[SearchResult](../types/SearchResult.html) diff --git a/docs/references/interfaces/AlbumFull.md b/docs/references/interfaces/AlbumFull.md index e69de29..e8c76a7 100644 --- a/docs/references/interfaces/AlbumFull.md +++ b/docs/references/interfaces/AlbumFull.md @@ -0,0 +1,35 @@ +# AlbumFull + +## Properties + +| Name | Data Type | Description | +| :------------ | :---------------------------------------- | :-------------------- | +| `type` | `"ALBUM"` | Type of data | +| `albumId` | `string` | Album ID | +| `playlistId` | `string` | Playlist ID for Album | +| `name` | `string` | Name | +| `artists` | [ArtistBasic](./ArtistBasic.html)`[]` | Creators of the Album | +| `year` | `number` | Publication Year | +| `thumbnails` | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | +| `description` | `string` | Description | +| `songs` | [SongDetailed](./SongDetailed.html)`[]` | Songs in the Album | + +## TypeScript Source Code + +```ts +interface AlbumFull { + type: "ALBUM" + albumId: string + playlistId: string + name: string + artists: ArtistBasic[] + year: number + thumbnails: ThumbnailFull[] + description: string + songs: SongDetailed[] +} +``` + +## Usages + +[YTMusic#getAlbum](../../guides/usage/getAlbum.md) diff --git a/docs/references/interfaces/ArtistBasic.md b/docs/references/interfaces/ArtistBasic.md index e69de29..a222237 100644 --- a/docs/references/interfaces/ArtistBasic.md +++ b/docs/references/interfaces/ArtistBasic.md @@ -0,0 +1,27 @@ +# ArtistBasic + +## Properties + +| Name | Data Type | Description | +| :------- | :-------- | :---------- | +| artistId | `string` | Artist ID | +| name | `string` | Name | + +## TypeScript Source Code + +```ts +interface ArtistBasic { + artistId: string + name: string +} +``` + +## Usages + +[SongDetailed#artists](./SongDetailed.html) + +[VideoDetailed#artists](./VideoDetailed.html) + +[AlbumDetailed#artists](./AlbumDetailed.html) + +[PlaylistFull#artists](./PlaylistFull.html) diff --git a/docs/references/interfaces/ArtistDetailed.md b/docs/references/interfaces/ArtistDetailed.md index e69de29..1cf782e 100644 --- a/docs/references/interfaces/ArtistDetailed.md +++ b/docs/references/interfaces/ArtistDetailed.md @@ -0,0 +1,27 @@ +# ArtistDetailed + +## Properties + +| Name | Data Type | Description | +| :--------- | :---------------------------------------- | :----------- | +| type | `"ARTIST"` | Type of data | +| artistId | `string` | Artist ID | +| name | `string` | Name | +| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | + +## TypeScript Source Code + +```ts +interface ArtistDetailed { + type: "ARTIST" + artistId: string + name: string + thumbnails: ThumbnailFull[] +} +``` + +## Usages + +[SearchResult](../types/SearchResult.html) + +[YTMusic#searchArtist](../../guides/usage/searchArtist.html) diff --git a/docs/references/interfaces/ArtistFull.md b/docs/references/interfaces/ArtistFull.md index e69de29..7b23aa6 100644 --- a/docs/references/interfaces/ArtistFull.md +++ b/docs/references/interfaces/ArtistFull.md @@ -0,0 +1,33 @@ +# ArtistFull + +## Properties + +| Name | Data Type | Description | +| :---------- | :---------------------------------------------------------- | :----------------------------------- | +| type | `"ARTIST"` | Type of data | +| artistId | `string` | Artist ID | +| name | `string` | Name | +| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | +| description | `string` | Description | +| subscribers | `number` | Number of subscribers the Artist has | +| topSongs | `Omit<`[SongDetailed](./SongDetailed.html)`, "duration">[]` | Top Songs from Artist | +| topAlbums | [AlbumDetailed](./AlbumDetailed.html)`[]` | Top Albums from Artist | + +## TypeScript Source Code + +```ts +interface ArtistFull { + type: "ARTIST" + artistId: string + name: string + thumbnails: ThumbnailFull[] + description: string + subscribers: number + topSongs: Omit[] + topAlbums: AlbumDetailed[] +} +``` + +## Usages + +[YTMusic#getArtist](../../guides/usage/getArtist.html) diff --git a/docs/references/interfaces/PlaylistFull.md b/docs/references/interfaces/PlaylistFull.md index e69de29..6f59e31 100644 --- a/docs/references/interfaces/PlaylistFull.md +++ b/docs/references/interfaces/PlaylistFull.md @@ -0,0 +1,33 @@ +# PlaylistFull + +## Properties + +| Name | Data Type | Description | +| :--------- | :---------------------------------- | :------------------------------- | +| type | `"PLAYLIST"` | Type of data | +| playlistId | `string` | Playlist ID | +| name | `string` | Name | +| artist | [ArtistBasic](#ArtistBasic) | Creator of the Playlist | +| videoCount | `number` | Number of videos in the Playlist | +| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | + +## TypeScript Source Code + +```ts +interface PlaylistFull { + type: "PLAYLIST" + playlistId: string + name: string + artist: ArtistBasic + videoCount: number + thumbnails: ThumbnailFull[] +} +``` + +## Usages + +[SearchResult](../types/SearchResult.html) + +[YTMusic#searchPlaylist](../../guides/usage/searchPlaylist.html) + +[YTMusic#getPlaylist](../../guides/usage/getPlaylist.html) diff --git a/docs/references/interfaces/SongDetailed.md b/docs/references/interfaces/SongDetailed.md index e69de29..f89ec71 100644 --- a/docs/references/interfaces/SongDetailed.md +++ b/docs/references/interfaces/SongDetailed.md @@ -0,0 +1,35 @@ +# SongDetailed + +## Properties + +| Name | Data Type | Description | +| :--------- | :---------------------------------------- | :------------------ | +| type | `"SONG"` | Type of data | +| videoId | `string` | YouTube Video ID | +| name | `string` | Name | +| artists | [ArtistBasic](./ArtistBasic.html)`[]` | Artists | +| album | [AlbumBasic](./AlbumBasic.html) | Album | +| duration | `number` | Duration in seconds | +| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | + +## TypeScript Source Code + +```ts +interface SongDetailed { + type: "SONG" + videoId: string + name: string + artists: ArtistBasic[] + album: AlbumBasic + duration: number + thumbnails: ThumbnailFull[] +} +``` + +## Usages + +[ArtistFull#topSongs](./ArtistFull.html) + +[AlbumFull#songs](./AlbumFull.html) + +[SearchResult](../types/SearchResult.html) diff --git a/docs/references/interfaces/SongFull.md b/docs/references/interfaces/SongFull.md index e69de29..0f4af33 100644 --- a/docs/references/interfaces/SongFull.md +++ b/docs/references/interfaces/SongFull.md @@ -0,0 +1,35 @@ +# SongFull + +## Properties + +| Name | Data Type | Description | +| :-------------- | :---------------------------------------- | :--------------------- | +| type | `"SONG"` | Type of data | +| videoId | `string` | YouTube Video ID | +| name | `string` | Name | +| artists | [ArtistBasic](./ArtistBasic.html)`[]` | Artists | +| duration | `number` | Duration in seconds | +| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | +| description | `string` | Description | +| formats | `any[]` | Video Formats | +| adaptiveFormats | `any[]` | Adaptive Video Formats | + +## TypeScript Source Code + +```ts +interface SongFull { + type: "SONG" + videoId: string + name: string + artists: ArtistBasic[] + duration: number + thumbnails: ThumbnailFull[] + description: string + formats: any[] + adaptiveFormats: any[] +} +``` + +## Usages + +[YTMusic#getSong](../../guides/usage/getSong.html) diff --git a/docs/references/interfaces/ThumbnailFull.md b/docs/references/interfaces/ThumbnailFull.md index e69de29..cb91fe8 100644 --- a/docs/references/interfaces/ThumbnailFull.md +++ b/docs/references/interfaces/ThumbnailFull.md @@ -0,0 +1,31 @@ +# ThumbnailFull + +## Properties + +| Name | Data Type | Description | +| :------- | :-------- | :------------------ | +| `url` | `string` | Link | +| `width` | `number` | Width of the image | +| `height` | `number` | Height of the image | + +## TypeScript Source Code + +```ts +interface ThumbnailFull { + url: string + width: number + height: number +} +``` + +## Usages + +[SongDetailed#thumbnails](./SongDetailed.html) + +[VideoDetailed#thumbnails](./VideoDetailed.html) + +[ArtistDetailed#thumbnails](./ArtistDetailed.html) + +[AlbumDetailed#thumbnails](./AlbumDetailed.html) + +[PlaylistFull#thumbnails](./PlaylistFull.html) diff --git a/docs/references/interfaces/VideoDetailed.md b/docs/references/interfaces/VideoDetailed.md index e69de29..dcb056a 100644 --- a/docs/references/interfaces/VideoDetailed.md +++ b/docs/references/interfaces/VideoDetailed.md @@ -0,0 +1,35 @@ +# VideoDetailed + +## Properties + +| Name | Data Type | Description | +| :--------- | :---------------------------------------- | :------------------------------ | +| type | `"VIDEO"` | Type of data | +| videoId | `string` | YouTube Video ID | +| name | `string` | Name | +| artists | [ArtistBasic](./ArtistBasic.html)`[]` | Channels that created the video | +| views | `number` | View count | +| duration | `number` | Duration in seconds | +| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | + +## TypeScript Source Code + +```ts +interface VideoDetailed { + type: "VIDEO" + videoId: string + name: string + artists: ArtistBasic[] + views: number + duration: number + thumbnails: ThumbnailFull[] +} +``` + +## Usages + +[SearchResult](../types/SearchResult.html) + +[YTMusic#searchVideo](../../guides/usage/searchVideo.html) + +[YTMusic#getPlaylistVideos](../../guides/usage/getPlaylistVideos.html) diff --git a/docs/references/interfaces/VideoFull.md b/docs/references/interfaces/VideoFull.md index e69de29..66eb4ab 100644 --- a/docs/references/interfaces/VideoFull.md +++ b/docs/references/interfaces/VideoFull.md @@ -0,0 +1,41 @@ +# VideoFull + +## Properties + +| Name | Data Type | Description | +| :---------- | :---------------------------------------- | :------------------------------------- | +| type | `"VIDEO"` | Type of data | +| videoId | `string` | YouTube Video ID | +| name | `string` | Name | +| artists | [ArtistBasic](./ArtistBasic.html)`[]` | Channels that created the video | +| views | `number` | View count | +| duration | `number` | Duration in seconds | +| thumbnails | [ThumbnailFull](./ThumbnailFull.html)`[]` | Thumbnails | +| description | `string` | Description | +| unlisted | `boolean` | If the video is unlisted on YouTube | +| familySafe | `boolean` | If the video is family safe on YouTube | +| paid | `boolean` | If the video is paid on YouTube | +| tags | `string[]` | Tags | + +## TypeScript Source Code + +```ts +interface VideoFull { + type: "VIDEO" + videoId: string + name: string + artists: ArtistBasic[] + views: number + duration: number + thumbnails: ThumbnailFull[] + description: string + unlisted: boolean + familySafe: boolean + paid: boolean + tags: string[] +} +``` + +## Usages + +[YTMusic#getVideo](../../guides/usage/getVideo.html) diff --git a/docs/references/types/SearchResult.md b/docs/references/types/SearchResult.md index e69de29..da8f5c3 100644 --- a/docs/references/types/SearchResult.md +++ b/docs/references/types/SearchResult.md @@ -0,0 +1,26 @@ +# SearchResult + +## Value + +Either + +- [SongDetailed](../interfaces/SongDetailed.html) +- [VideoDetailed](../interfaces/VideoDetailed.html) +- [AlbumDetailed](../interfaces/AlbumDetailed.html) +- [ArtistDetailed](../interfaces/ArtistDetailed.html) +- [PlaylistFull](../interfaces/PlaylistFull.html) + +## TypeScript Source Code + +```ts +type SearchResult = + | SongDetailed + | VideoDetailed + | AlbumDetailed + | ArtistDetailed + | PlaylistFull +``` + +## Usages + +[YTMusic#search](../../guides/usage/search.html)