UNPKG

pipebomb.js

Version:

Library for interacting with Pipe Bomb servers

38 lines (37 loc) 1.55 kB
import Playlist from "../collection/Playlist.js"; import CollectionCache from "../collection/CollectionCache.js"; import Context from "../Context.js"; import Track from "../music/Track.js"; import TrackCache from "../music/TrackCache.js"; import ServiceInfo from "../ServiceInfo.js"; import APIVersion from "./APIVersion.js"; import TrackList from "../collection/TrackList.js"; import User from "../User.js"; import ExternalPlaylist from "../collection/ExternalCollection.js"; import ServerInfo from "../ServerInfo.js"; export interface FoundObject { responseType: "found object"; objectType: "playlist" | "track"; id: string; } export interface SearchResults { responseType: "search results"; results: (Track | ExternalPlaylist)[]; } export interface UserProfile { user: User; playlists: Playlist[]; } export default class V1 extends APIVersion { constructor(context: Context, trackCache: TrackCache, collectionCache: CollectionCache); search(service: string, query: string): Promise<FoundObject | SearchResults>; getPlaylists(): Promise<Playlist[]>; getPlaylist(collectionID: string, outOfDateThreshold?: number): Promise<Playlist>; createPlaylist(name: string, trackList?: Track[]): Promise<Playlist>; getExternalPlaylist(playlistID: string): any; getServices(): Promise<ServiceInfo[]>; getCharts(): Promise<TrackList[]>; getChart(chartSlug: string): Promise<TrackList>; getUser(userID: string): Promise<UserProfile>; getRegistryServers(url: string): Promise<ServerInfo[]>; }