Finished search

This commit is contained in:
Zechariah 2022-03-30 17:44:54 +08:00
parent afb8147a26
commit bf8ae07b76
3 changed files with 30 additions and 16 deletions

View File

@ -21,22 +21,6 @@ Because of this, I decided to build my own version of a youtube music api with T
- Albums - Albums
- Playlists - Playlists
#### `search`
This function takes in the following parameters
| Name | Data Type | Description |
| :------- | :-------------------------------------------------------------------- | :---------------------------------------------------------------------------------- |
| query | `string` | Search query |
| category | `"SONG" \| "VIDEO" \| "ARTIST" \| "ALBUM" \| "PLAYLIST" \| undefined` | Type of results to search for. If not specified, returns all types of search result |
The function **when nothing is passed as the category** returns a `Promise<`[SearchResult](#SearchResult)`[]>` which are the search results of all categories
```ts
ytmusic.search("Lilac").then(results => {
console.log(results)
})
```
##### `search (category = "SONG")` ##### `search (category = "SONG")`

View File

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

View File

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