UNPKG

bandcamp-fetch

Version:
60 lines 2.89 kB
import { type ImageFormat } from '../types/Image.js'; import { type SearchResultAlbum, type SearchResultAny, type SearchResultArtist, type SearchResultFan, type SearchResultLabel, type SearchResultTrack, type SearchResults } from '../types/Search.js'; import type Limiter from '../utils/Limiter.js'; import BaseAPIWithImageSupport, { type BaseAPIWithImageSupportParams } from '../common/BaseAPIWithImageSupport.js'; export declare enum SearchItemType { All = "All", ArtistsAndLabels = "ArtistsAndLabels", Albums = "Albums", Tracks = "Tracks", Fans = "Fans" } export interface SearchAPISearchParams { query: string; page?: number; albumImageFormat?: string | number | ImageFormat; artistImageFormat?: string | number | ImageFormat; } export default class SearchAPI extends BaseAPIWithImageSupport { all(params: SearchAPISearchParams): Promise<SearchResults<SearchResultAny>>; artistsAndLabels(params: SearchAPISearchParams): Promise<SearchResults<SearchResultArtist | SearchResultLabel>>; albums(params: SearchAPISearchParams): Promise<SearchResults<SearchResultAlbum>>; tracks(params: SearchAPISearchParams): Promise<SearchResults<SearchResultTrack>>; fans(params: SearchAPISearchParams): Promise<SearchResults<SearchResultFan>>; /** * @internal */ protected search(params: SearchAPISearchParams & { itemType: SearchItemType.ArtistsAndLabels; }): Promise<SearchResults<SearchResultArtist | SearchResultLabel>>; protected search(params: SearchAPISearchParams & { itemType: SearchItemType.Albums; }): Promise<SearchResults<SearchResultAlbum>>; protected search(params: SearchAPISearchParams & { itemType: SearchItemType.Tracks; }): Promise<SearchResults<SearchResultTrack>>; protected search(params: SearchAPISearchParams & { itemType: SearchItemType.Fans; }): Promise<SearchResults<SearchResultFan>>; protected search(params: SearchAPISearchParams & { itemType: SearchItemType.All; }): Promise<SearchResults<SearchResultAny>>; /** * @internal */ protected static getSearchUrl(params: SearchAPISearchParams & { itemType: SearchItemType; }): string; } export declare class LimiterSearchAPI extends SearchAPI { #private; constructor(params: BaseAPIWithImageSupportParams & { limiter: Limiter; }); all(params: SearchAPISearchParams): Promise<SearchResults<SearchResultAny>>; artistsAndLabels(params: SearchAPISearchParams): Promise<SearchResults<SearchResultArtist | SearchResultLabel>>; albums(params: SearchAPISearchParams): Promise<SearchResults<SearchResultAlbum>>; tracks(params: SearchAPISearchParams): Promise<SearchResults<SearchResultTrack>>; fans(params: SearchAPISearchParams): Promise<SearchResults<SearchResultFan>>; } //# sourceMappingURL=SearchAPI.d.ts.map