import { N as NextlyError } from './nextly-error.d-WlStqaV9.d.ts'; /** * Observability hook fired by withErrorHandler / withAction / instrumentation * after a NextlyError has been classified and logged. * * Intended for plugging Sentry, Datadog, Better Stack, or OpenTelemetry. The * hook receives the NextlyError plus a discriminated context describing the * boundary that caught it. * * Hook implementations run in try/catch so a failing hook never poisons the * response or action result. */ type OnErrorHook = (err: NextlyError, ctx: { kind: "route-handler"; requestId: string; route?: string; method?: string; request: Request; } | { kind: "server-action"; requestId: string; } | { kind: "framework"; requestId: string; }) => void | Promise; /** * Register a process-wide onError hook. Typically called inside * `createNextlyInstrumentation({ onError })` from the developer's * `app/instrumentation.ts`. A per-call hook on `withErrorHandler` / * `withAction` runs before this one for that boundary. */ declare function setGlobalOnError(hook: OnErrorHook | undefined): void; /** The currently registered global onError hook (or undefined). */ declare function getGlobalOnError(): OnErrorHook | undefined; export { getGlobalOnError as g, setGlobalOnError as s }; export type { OnErrorHook as O };