UNPKG

andrade-soulseek-downloader

Version:

Simple, safe Soulseek download library with built-in rate limiting to prevent bans

42 lines 1.33 kB
/** * API handler for Soulseek downloader. * Manages singleton connection and provides simple API. */ export declare class APIHandler { private static instance; private downloader; private constructor(); /** * Gets singleton instance of API handler. * @returns APIHandler instance */ static getInstance(): APIHandler; /** * Creates download configuration from environment. * @returns Download configuration */ private createConfig; /** * Ensures downloader instance is initialized. */ private ensureDownloader; /** * Downloads a track from Soulseek network. * @param artist - Artist name * @param title - Track title * @param folderName - Optional subfolder name within SOULSEEK_DOWNLOAD_DIR * @param customFileName - Optional custom filename (without extension) * @returns Path to downloaded file or null if failed */ download(artist: string, title: string, folderName?: string, customFileName?: string): Promise<string | null>; /** * Disconnects from Soulseek and cleans up resources. */ disconnect(): Promise<void>; /** * Resets the singleton instance. * Useful for testing or forced reconnection. */ static reset(): void; } //# sourceMappingURL=api-handler.d.ts.map