import { CaptureErrorContext } from "./internal/types.cjs"; //#region src/capture.d.ts /** * Reports an error to Interfere. Safe to call from anywhere — no-op when the * SDK is not configured (`INTERFERE_PUBLIC_KEY` unset). * * Internally opens a short OTel span and records the error as an `exception` * event on it. The span ships through the same `OTLPTraceExporter` wired up * in `init()`, so error capture inherits the OTel transport (batch, retry, * traceparent propagation) without a separate fetch path. The collector's * `mapTracesToSpanEvents` lifts the OTel-semconv `exception.*` attrs plus * our `interfere.exception.*` taxonomy into the `span_events` datasource. * * Pass the request (a `Request`, a Node `IncomingMessage`-like object, or * any object with `headers`/`method`/`url`) so the span carries request * context. If there's an active OTel context (e.g. an HTTP handler span), * the exception attaches to it as a child; otherwise it becomes a * root span. */ export declare function captureError(error: unknown, request?: unknown, errorContext?: CaptureErrorContext): void; /** * Reports a string message as an error event. */ export declare function captureMessage(message: string, request?: unknown, errorContext?: CaptureErrorContext): void; /** * Wraps a function in an OTel span. Thrown errors are recorded on the span * and rethrown. Without an active provider (i.e. before `init()`), still * runs `fn` but produces no telemetry. */ export declare function withSpan(name: string, fn: () => Promise | T): Promise; //#endregion export type { CaptureErrorContext };