Wrote docs for all search methods

This commit is contained in:
Zechariah 2022-03-30 18:07:17 +08:00
parent ce98351d06
commit 647c6ca0de
11 changed files with 150 additions and 61 deletions

View File

@ -21,67 +21,6 @@ Because of this, I decided to build my own version of a youtube music api with T
- Albums - Albums
- Playlists - Playlists
##### `search (category = "SONG")`
When you pass in `"SONG"` as the category,
The function returns a `Promise<`[SongDetailed](#SongDetailed)`[]>` which are the song results
```ts
ytmusic.search("Lilac", "SONG").then(songs => {
console.log(songs)
})
```
##### `search (category = "VIDEO")`
When you pass in `"VIDEO"` as the category,
The function returns a `Promise<`[VideoDetailed](#VideoDetailed)`[]>` which are the video results
```ts
ytmusic.search("Lilac", "VIDEO").then(videos => {
console.log(videos)
})
```
##### `search (category = "ARTIST")`
When you pass in `"ARTIST"` as the category
The function returns a `Promise<`[ArtistDetailed](#ArtistDetailed)`[]>` which are the artist results
```ts
ytmusic.search("Lilac", "ARTIST").then(artists => {
console.log(artists)
})
```
##### `search (category = "ALBUM")`
When you pass in `"ALBUM"` as the category,
The function returns a `Promise<`[AlbumDetailed](#AlbumDetailed)`[]>` which are the album results
```ts
ytmusic.search("Lilac", "ALBUM").then(albums => {
console.log(albums)
})
```
##### `search (category = "PLAYLIST")`
When you pass in `"PLAYLIST"` as the category,
The function returns a `Promise<`[PlaylistFull](#PlaylistFull)`[]>` which are the playlist results
```ts
ytmusic.search("Lilac", "PLAYLIST").then(playlists => {
console.log(playlists)
})
```
#### `getSong` #### `getSong`
This function takes in the following parameters This function takes in the following parameters

View File

@ -0,0 +1,11 @@
# Searching for albums
`searchAlbums()` will search YTMusic for album results.
```ts
ytmusic.searchAlbums("Lilac").then(albums => {
console.log(albums)
})
```
See the [reference](../../references/ytmusic-methods/searchAlbums.html) for information.

View File

@ -0,0 +1,11 @@
# Searching for artists
`searchArtists()` will search YTMusic for artist results.
```ts
ytmusic.searchArtists("Lilac").then(artists => {
console.log(artists)
})
```
See the [reference](../../references/ytmusic-methods/searchArtists.html) for information.

View File

@ -0,0 +1,11 @@
# Searching for playlists
`searchPlaylists()` will search YTMusic for playlist results.
```ts
ytmusic.searchPlaylists("Lilac").then(playlists => {
console.log(playlists)
})
```
See the [reference](../../references/ytmusic-methods/searchPlaylists.html) for information.

View File

@ -0,0 +1,11 @@
# Searching for songs
`searchSongs()` will search YTMusic for song results.
```ts
ytmusic.searchSongs("Lilac").then(songs => {
console.log(songs)
})
```
See the [reference](../../references/ytmusic-methods/searchSongs.html) for information.

View File

@ -0,0 +1,11 @@
# Searching for songs
`searchVideos()` will search YTMusic for video results.
```ts
ytmusic.searchVideos("Lilac").then(videos => {
console.log(videos)
})
```
See the [reference](../../references/ytmusic-methods/searchVideos.html) for information.

View File

@ -0,0 +1,19 @@
# searchAlbums
See the [guide](../../guides/usage/searchAlbums.html) for information on how to use this.
## Properties
| Name | Data Type | Description |
| :------ | :-------- | :----------- |
| `query` | `string` | Search query |
## Returns
`Promise<`[AlbumDetailed](../interfaces/AlbumDetailed.html)`[]>`
## TypeScript Source Code
```ts
public async searchAlbums(query: string): Promise<AlbumDetailed[]>
```

View File

@ -0,0 +1,19 @@
# searchArtists
See the [guide](../../guides/usage/searchArtists.html) for information on how to use this.
## Properties
| Name | Data Type | Description |
| :------ | :-------- | :----------- |
| `query` | `string` | Search query |
## Returns
`Promise<`[ArtistDetailed](../interfaces/ArtistDetailed.html)`[]>`
## TypeScript Source Code
```ts
public async searchArtists(query: string): Promise<ArtistDetailed[]>
```

View File

@ -0,0 +1,19 @@
# searchPlaylists
See the [guide](../../guides/usage/searchPlaylists.html) for information on how to use this.
## Properties
| Name | Data Type | Description |
| :------ | :-------- | :----------- |
| `query` | `string` | Search query |
## Returns
`Promise<`[PlaylistFull](../interfaces/PlaylistFull.html)`[]>`
## TypeScript Source Code
```ts
public async searchPlaylists(query: string): Promise<PlaylistFull[]>
```

View File

@ -0,0 +1,19 @@
# searchSongs
See the [guide](../../guides/usage/searchSongs.html) for information on how to use this.
## Properties
| Name | Data Type | Description |
| :------ | :-------- | :----------- |
| `query` | `string` | Search query |
## Returns
`Promise<`[SongDetailed](../interfaces/SongDetailed.html)`[]>`
## TypeScript Source Code
```ts
public async searchSongs(query: string): Promise<SongDetailed[]>
```

View File

@ -0,0 +1,19 @@
# searchVideos
See the [guide](../../guides/usage/searchVideos.html) for information on how to use this.
## Properties
| Name | Data Type | Description |
| :------ | :-------- | :----------- |
| `query` | `string` | Search query |
## Returns
`Promise<`[VideoDetailed](../interfaces/VideoDetailed.html)`[]>`
## TypeScript Source Code
```ts
public async searchVideos(query: string): Promise<VideoDetailed[]>
```