import { type ErrorNoiseReason } from "../shared/error-noise.js"; export type ExceptionLevel = "fatal" | "error" | "warning" | "info" | "debug"; export interface CaptureExceptionContext { tags?: Record; extra?: Record; level?: ExceptionLevel; } export interface ExceptionBreadcrumb { timestamp: string; category: string; message: string; level?: ExceptionLevel; } export interface CapturedExceptionEvent { type: string; message: string; stack?: string; handled: boolean; level: ExceptionLevel; occurredAt: string; url?: string; release?: string; environment?: string; sessionId?: string; sessionReplayId?: string; anonymousId?: string; breadcrumbs: ExceptionBreadcrumb[]; tags?: Record; extra?: Record; } export interface InstallErrorCaptureOptions { send: (event: CapturedExceptionEvent) => void; getSessionContext?: () => { sessionId?: string; anonymousId?: string; replayId?: string; }; emitReplayEvent?: (event: CapturedExceptionEvent) => void; release?: string; environment?: string; captureGlobalErrors?: boolean; captureUnhandledRejections?: boolean; maxBreadcrumbs?: number; dedupeWindowMs?: number; /** Events one page session may send in total. Default 20. */ maxEventsPerSession?: number; /** Events one error signature may send per session. Default 3. */ maxEventsPerSignature?: number; /** How long to wait before reporting what the budget dropped. Default 15s. */ budgetSummaryDelayMs?: number; } export interface ErrorCaptureStats { sent: number; budgetDropped: number; noiseSuppressed: Partial>; } export declare function normalizeCapturedError(error: unknown): { type: string; message: string; stack?: string; }; export declare function firstPartyHosts(): string[]; export declare function getErrorCaptureStats(): ErrorCaptureStats; export declare function addErrorBreadcrumb(breadcrumb: { category: string; message: string; level?: ExceptionLevel; }): void; export declare function captureException(error: unknown, context?: CaptureExceptionContext): void; export declare function captureMessage(message: string, level?: ExceptionLevel): void; export declare function installErrorCapture(options: InstallErrorCaptureOptions): () => void; export declare function isErrorCaptureInstalled(): boolean;