Finished search
This commit is contained in:
parent
afb8147a26
commit
bf8ae07b76
16
README.md
16
README.md
|
|
@ -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")`
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
@ -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[]>
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue