UNPKG

brickcharts

Version:

A comprehensive library for managing Billboard and Last.FM charts with visualizations and data management

82 lines (81 loc) 2.59 kB
import { ChartClient, ChartData, ChartSource, FetchOptions, DateRange, HistoricalChartData, CacheOptions, ChartAnalytics } from '../types'; export interface BrickChartsConfig { enableCache?: boolean; cacheOptions?: CacheOptions; apiKeys?: { lastfm?: string; spotify?: string; }; defaultSource?: ChartSource; } export declare class BrickCharts { private clients; private dataManager; private config; constructor(config?: BrickChartsConfig); /** * Initialize all available chart clients */ private initializeClients; /** * Get a chart from the specified source */ getChart(chartType: string, source?: ChartSource, options?: FetchOptions): Promise<ChartData>; /** * Get historical chart data */ getHistoricalData(chartType: string, dateRange: DateRange, source?: ChartSource): Promise<HistoricalChartData>; /** * Get available charts from a source */ getAvailableCharts(source?: ChartSource): Promise<string[]>; /** * Compare charts between different dates or sources */ compareCharts(chartType: string, date1: Date, date2: Date, source?: ChartSource): Promise<ChartAnalytics>; /** * Get trending analysis for a chart */ getTrends(chartType: string, source?: ChartSource, weeksBack?: number): Promise<ChartAnalytics>; /** * Search for a specific track across charts */ searchTrack(title: string, artist: string, chartType?: string, source?: ChartSource): Promise<ChartData[]>; /** * Get chart data for multiple sources and merge */ getMultiSourceChart(chartType: string, sources: ChartSource[], options?: FetchOptions): Promise<Map<ChartSource, ChartData>>; /** * Clear cache for specific chart or all */ clearCache(chartType?: string, source?: ChartSource): Promise<void>; /** * Get cache statistics */ getCacheStats(): Promise<any>; /** * Add a custom chart client */ addClient(source: ChartSource, client: ChartClient): void; /** * Remove a chart client */ removeClient(source: ChartSource): void; /** * Get available sources */ getAvailableSources(): ChartSource[]; /** * Update configuration */ updateConfig(newConfig: Partial<BrickChartsConfig>): void; /** * Get client for a specific source */ private getClient; /** * Health check for all clients */ healthCheck(): Promise<Map<ChartSource, boolean>>; } //# sourceMappingURL=BrickCharts.d.ts.map