/** * Cost Tracker * * A session-based cost tracker that accumulates usage during processing. * Used by both CLI (for displaying costs) and SaaS (for billing). */ import type { MicroDollars, UsageRecord, UsageSummary } from './types'; /** * Cost tracker for accumulating usage during a processing session. * * Thread-safe design: each method operates atomically on the records array. * * @example * ```typescript * const tracker = new CostTracker() * * // Record AI usage * tracker.recordAI('gpt-4o-mini', 1000, 500) * * // Record geocoding * tracker.recordGeocoding(10) * * // Get summary * const summary = tracker.getSummary() * console.log(`Total cost: $${(summary.totalCostCents / 100).toFixed(2)}`) * ``` */ export declare class CostTracker { private records; /** * Add a usage record. */ addRecord(record: UsageRecord): void; /** * Add multiple usage records. */ addRecords(records: UsageRecord[]): void; /** * Get all usage records. */ getRecords(): readonly UsageRecord[]; /** * Get the total cost in micro-dollars. */ getTotalCostMicros(): MicroDollars; /** * Get the total cost in cents. */ getTotalCostCents(): number; /** * Get a full usage summary. */ getSummary(): UsageSummary; /** * Clear all records. */ clear(): void; /** * Get count of records. */ get recordCount(): number; /** * Check if there are any records. */ get hasRecords(): boolean; /** * Format the current costs for display. */ formatSummary(): string; /** * Create a JSON-serializable representation. */ toJSON(): { totalCostMicros: MicroDollars; totalCostCents: number; records: UsageRecord[]; }; /** * Create a tracker from JSON data. */ static fromJSON(data: { records: Array & { timestamp: string; }>; }): CostTracker; } /** * Create a new cost tracker. */ export declare function createCostTracker(): CostTracker; //# sourceMappingURL=tracker.d.ts.map