Skip to content

Commit

Permalink
fix(ytmusic): export search filters type
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Mar 7, 2023
1 parent cfc1a18 commit cf8a33c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/Music.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import type { ObservedArray, YTNode } from '../parser/helpers.js';
import type Actions from './Actions.js';
import type Session from './Session.js';

export type SearchFilters = {
type?: 'all' | 'song' | 'video' | 'album' | 'playlist' | 'artist';
};

class Music {
#session: Session;
#actions: Actions;
Expand Down Expand Up @@ -108,9 +112,7 @@ class Music {
* @param query - Search query.
* @param filters - Search filters.
*/
async search(query: string, filters: {
type?: 'all' | 'song' | 'video' | 'album' | 'playlist' | 'artist';
} = {}): Promise<Search> {
async search(query: string, filters: SearchFilters = {}): Promise<Search> {
throwIfMissing({ query });

const payload: {
Expand Down

0 comments on commit cf8a33c

Please sign in to comment.