/** * The (thin) browser glue for crash detection. * * Listens for the two most common crash sources — uncaught errors * (`window.onerror`) and unhandled promise rejections (`unhandledrejection`) — * then runs the pure helpers (stack parse, breadcrumbs, dedup) and hands a * finished report to `send`. * * Everything here is wrapped so error capture can never throw back into the * host app. The interesting logic lives in the pure modules; this file is kept * deliberately small and is exercised by the Playwright browser tests. */ import { BreadcrumbBuffer } from './breadcrumbs'; import { ErrorFilterOptions } from './filters'; import { ErrorMechanism, ErrorReport, RequestContext } from './error-payload'; export interface ErrorCaptureContext { sessionId: string; endUserId: string | null; url: string; release?: string | null; environment?: string | null; commitSha?: string | null; dist?: string | null; sessionStartTimestampMs?: number; requestContext?: RequestContext; automaticProperties?: Record; userProperties?: Record; sessionProperties?: Record; } export interface ErrorCaptureOptions { send: (report: ErrorReport) => void; getContext: () => ErrorCaptureContext; breadcrumbs: BreadcrumbBuffer; /** Host-configurable ignoreErrors / denyUrls / allowUrls (Sentry semantics). */ filters?: ErrorFilterOptions; /** * Capture failed loads of third-party resources (other origins' scripts, * images, ads, trackers). Off by default: adblockers make cross-origin * resource failures overwhelmingly noise the app author cannot fix, so * only first-party (same-origin) resource failures are reported. */ captureThirdPartyResourceErrors?: boolean; } export declare class ErrorCapture { private readonly opts; private readonly deduper; private installed; private onError?; private onRejection?; private onResourceError?; private onCsp?; constructor(opts: ErrorCaptureOptions); install(): void; uninstall(): void; /** * Build and send a report for a thrown value. Public so the manual * `captureException` path can reuse it later. `extra.componentStack` carries * the React component stack from the error boundary. Never throws. */ capture(error: unknown, mechanism: ErrorMechanism, handled: boolean, extra?: { componentStack?: string; }): void; } //# sourceMappingURL=capture.d.ts.map