/**
 * Usage Route Handlers
 *
 * Contains all route handler logic for usage analytics endpoints.
 * Separated from routes for better testability and organization.
 */
import type { Request, Response } from 'express';
import type { DailyUsage, Anomaly, AnomalySummary, TokenBreakdown } from './types';
/** Query parameters for usage endpoints */
export interface UsageQuery {
    since?: string;
    until?: string;
    profile?: string;
    limit?: string;
    offset?: string;
}
/**
 * Validate date string in YYYYMMDD format
 */
export declare function validateDate(dateString?: string): string | undefined;
export declare function validateLimit(limit?: string): number;
export declare function validateOffset(offset?: string): number;
export declare function validateDateRangeOrder(since?: string, until?: string): void;
export declare function filterByDateRange<T extends {
    date?: string;
    month?: string;
    lastActivity?: string;
}>(data: T[] | undefined, since?: string, until?: string): T[];
export declare function errorResponse(res: Response, error: unknown, defaultMessage: string): void;
export declare function calculateTokenBreakdownCosts(dailyData: DailyUsage[]): TokenBreakdown;
export declare function fillHourlyGaps(data: Array<{
    hour: string;
    tokens: number;
    inputTokens: number;
    outputTokens: number;
    cacheTokens: number;
    cost: number;
    modelsUsed: number;
    requests: number;
}>, since?: string, until?: string): typeof data;
export declare function detectAnomalies(dailyData: DailyUsage[]): Anomaly[];
export declare function summarizeAnomalies(anomalies: Anomaly[]): AnomalySummary;
export declare function handleSummary(req: Request<object, object, object, UsageQuery>, res: Response): Promise<void>;
export declare function handleDaily(req: Request<object, object, object, UsageQuery>, res: Response): Promise<void>;
export declare function handleHourly(req: Request<object, object, object, UsageQuery>, res: Response): Promise<void>;
export declare function handleModels(req: Request<object, object, object, UsageQuery>, res: Response): Promise<void>;
export declare function handleSessions(req: Request<object, object, object, UsageQuery>, res: Response): Promise<void>;
export declare function handleMonthly(req: Request<object, object, object, UsageQuery>, res: Response): Promise<void>;
export declare function handleRefresh(_req: Request, res: Response): Promise<void>;
export declare function handleStatus(_req: Request, res: Response): void;
export declare function handleInsights(req: Request<object, object, object, UsageQuery>, res: Response): Promise<void>;
//# sourceMappingURL=handlers.d.ts.map