From bf8ae07b7644a74994a3345099898dbf9f248fc9 Mon Sep 17 00:00:00 2001 From: Zechariah Date: Wed, 30 Mar 2022 17:44:54 +0800 Subject: [PATCH] Finished search --- README.md | 16 ---------------- docs/guides/usage/search.md | 11 +++++++++++ docs/references/ytmusic-methods/search.md | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 2cba63b..200c3e4 100644 --- a/README.md +++ b/README.md @@ -21,22 +21,6 @@ Because of this, I decided to build my own version of a youtube music api with T - Albums - 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")` diff --git a/docs/guides/usage/search.md b/docs/guides/usage/search.md index e69de29..49d0df2 100644 --- a/docs/guides/usage/search.md +++ b/docs/guides/usage/search.md @@ -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. diff --git a/docs/references/ytmusic-methods/search.md b/docs/references/ytmusic-methods/search.md index e69de29..4f22814 100644 --- a/docs/references/ytmusic-methods/search.md +++ b/docs/references/ytmusic-methods/search.md @@ -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 +```