import type { StoragePlugin, ErrorCategory, ErrorSeverity, ErrorLogEntry, ErrorLogSummary } from './types.js'; export interface ErrorLogContext { [key: string]: string | number | boolean | null | undefined; } export interface LogParams { severity: ErrorSeverity; category: ErrorCategory; message: string; error?: unknown; context?: ErrorLogContext; } export interface ErrorLoggerOptions { /** Milliseconds to collapse duplicate (category,message) into one row. Default 1000. */ throttleMs?: number; /** Rows older than this are pruned. Default 7 days. */ maxAgeMs?: number; /** Max total rows; oldest trimmed past cap. Default 10000. */ maxRows?: number; /** Prune cadence. Default 5 min. */ pruneIntervalMs?: number; } export declare class ErrorLogger { private storage; private opts; private throttleCache; private pruneTimer; /** Set to false when this logger is superseded or stopped; stale callbacks check this. */ private active; constructor(storage: StoragePlugin, options?: ErrorLoggerOptions); /** * Get or create the active ErrorLogger for a storage instance. * Preferred over `new ErrorLogger(...)` for production code — guarantees a single * active logger per storage. */ static instance(storage: StoragePlugin, options?: ErrorLoggerOptions): ErrorLogger; stop(): void; private truncate; private sanitizeStack; log(params: LogParams): void; error(category: ErrorCategory, err: unknown, context?: ErrorLogContext): void; warn(category: ErrorCategory, message: string, context?: ErrorLogContext): void; query(opts?: { since?: number; severity?: ErrorSeverity | ErrorSeverity[]; category?: ErrorCategory | ErrorCategory[]; limit?: number; }): ErrorLogEntry[]; summary(opts?: { since?: number; limit?: number; }): ErrorLogSummary[]; prune(): void; } //# sourceMappingURL=error-logger.d.ts.map