import type { Context, MiddlewareHandler } from "hono"; import { type ErrorEvent, type Reporter } from "../observability/reporter.js"; /** * Mints (or honors a trusted inbound) `x-request-id`, exposes it on the * `X-Request-Id` response header and the `requestId` context variable, and runs * the rest of the request inside the async-context store so `getRequestId()` * works anywhere downstream (RFC #1553, primitive 1). */ export declare const requestId: MiddlewareHandler<{ Variables: { requestId?: string; }; }>; export interface HandleApiErrorOptions { /** * Observability sink for unhandled 5xx exceptions (RFC #1553, primitive 2). * Defaults to {@link noopReporter}. */ reporter?: Reporter; /** Logical app name stamped on emitted {@link ErrorEvent}s. Defaults to `"voyant"`. */ appName?: string; } /** * Forwards a normalized {@link ErrorEvent} to the reporter. Best-effort: never * throws, and flushes an async reporter via `waitUntil` so capture doesn't * block the response. Exported so non-`onError` catch points (e.g. the * forwarded auth sub-app, which returns its own Response and never reaches the * outer `onError`) can emit through the same path. */ export declare function reportException(reporter: Reporter, c: Context, event: ErrorEvent): void; export declare function handleApiError(err: unknown, c: Context, options?: HandleApiErrorOptions): Response; export declare const errorBoundary: MiddlewareHandler;