/**
 * Usage Aggregator Service
 *
 * Handles multi-instance usage data aggregation and caching.
 * Combines data from default Claude config and all CCS instances.
 */
import type { DailyUsage, HourlyUsage, MonthlyUsage, SessionUsage } from './types';
/**
 * Merge daily usage data from multiple sources
 * Combines entries with same date by aggregating tokens
 */
export declare function mergeDailyData(sources: DailyUsage[][], options?: {
    preserveProfile?: boolean;
}): DailyUsage[];
/**
 * Merge monthly usage data from multiple sources
 */
export declare function mergeMonthlyData(sources: MonthlyUsage[][], options?: {
    preserveProfile?: boolean;
}): MonthlyUsage[];
/**
 * Merge hourly usage data from multiple sources
 * Combines entries with same hour by aggregating tokens
 */
export declare function mergeHourlyData(sources: HourlyUsage[][], options?: {
    preserveProfile?: boolean;
}): HourlyUsage[];
/**
 * Merge session data from multiple sources
 * Deduplicates by sessionId (same session shouldn't appear in multiple instances)
 */
export declare function mergeSessionData(sources: SessionUsage[][]): SessionUsage[];
/** Get timestamp of last successful data fetch */
export declare function getLastFetchTimestamp(): number | null;
export declare function getUsageCacheSize(): number;
/** Cached loader for daily usage data */
export declare function getCachedDailyData(profile?: string): Promise<DailyUsage[]>;
/** Cached loader for monthly usage data */
export declare function getCachedMonthlyData(profile?: string): Promise<MonthlyUsage[]>;
/** Cached loader for session data */
export declare function getCachedSessionData(profile?: string): Promise<SessionUsage[]>;
/** Cached loader for hourly usage data */
export declare function getCachedHourlyData(profile?: string): Promise<HourlyUsage[]>;
/**
 * Clear all cached data (useful for manual refresh)
 */
export declare function clearUsageCache(): void;
/**
 * Pre-warm usage caches on server startup
 *
 * Strategy:
 * 1. Check disk cache - if fresh, use it (instant startup)
 * 2. If stale, use it immediately but trigger background refresh
 * 3. If no cache, return immediately and let first request trigger load
 */
export declare function prewarmUsageCache(): Promise<{
    timestamp: number;
    elapsed: number;
    source: string;
}>;
/**
 * Shutdown usage aggregator cleanly (stops background syncer)
 */
export declare function shutdownUsageAggregator(): void;
/**
 * Force refresh usage cache from all sources.
 * Used by manual refresh endpoint.
 */
export declare function refreshUsageCache(): Promise<void>;
//# sourceMappingURL=aggregator.d.ts.map