/** * Uncaught-exception auto-tracker. Chains a handler onto the global * `ErrorUtils` so every uncaught throw emits an ERROR_MSG event * before the host's pre-existing handler runs. The original handler * is preserved end-to-end: services like Sentry / Bugsnag that * registered before our `attach()` still receive every error. * * Detach is "polite": it only restores the previous handler when the * current global is still THIS tracker's wrapper. Another tracker * (foreign, or a second ErrorTracker instance) that chained on top * after us keeps its patch in place - we never reach past it. * * Message format is `"Caught exception {message} at {stack}"` (see * `formatErrorMessage.ts`). Long error messages and stack traces pass * through unchanged - the dispatcher's string event has no length cap * and ERROR_MSG bypasses the 256-char truncation so crash context * survives intact. */ import type { KeewanoTracker } from '../types/config'; import type { ErrorTrackerArgs } from './types/ErrorTracker'; declare class ErrorTracker implements KeewanoTracker { readonly name = "ErrorTracker"; private readonly args; constructor(args: ErrorTrackerArgs); /** * Chain a handler onto the global ErrorUtils. Returns a no-op * detach when ErrorUtils is absent (web host / Node test runner * without the RN global). */ attach(): () => void; /** * Stamp the dispatcher frame timestamp with wall-clock seconds and * emit a single ERROR_MSG event carrying the formatted exception. * Any throw from the dispatcher path is swallowed so a misbehaving * dispatcher cannot break the host's crash-reporter chain. */ private emitErrorEvent; } export type { ErrorTrackerArgs } from './types/ErrorTracker'; export { formatErrorMessage } from './formatErrorMessage'; export { ErrorTracker };