UNPKG

@sentry/remix

Version:
40 lines • 1.56 kB
import type { Hub } from '@sentry/node'; import type { Transaction, TransactionSource } from '@sentry/types'; import type { ReactRouterDomPkg, ServerBuild, ServerRoute, ServerRouteManifest } from './types'; export declare let isRequestHandlerWrapped: boolean; export declare type JsonFunction = <Data>(data: Data, init?: number | ResponseInit) => Response; /** * Creates routes from the server route manifest * * @param manifest * @param parentId */ export declare function createRoutes(manifest: ServerRouteManifest, parentId?: string): ServerRoute[]; /** * Starts a new transaction for the given request to be used by different `RequestHandler` wrappers. * * @param request * @param routes * @param pkg */ export declare function startRequestHandlerTransaction(hub: Hub, name: string, source: TransactionSource, request: { headers: { 'sentry-trace': string; baggage: string; }; method: string; }): Transaction; /** * Get transaction name from routes and url */ export declare function getTransactionName(routes: ServerRoute[], url: URL, pkg?: ReactRouterDomPkg): [string, TransactionSource]; /** * Instruments `remix` ServerBuild for performance tracing and error tracking. */ export declare function instrumentBuild(build: ServerBuild): ServerBuild; /** * Monkey-patch Remix's `createRequestHandler` from `@remix-run/server-runtime` * which Remix Adapters (https://remix.run/docs/en/v1/api/remix) use underneath. */ export declare function instrumentServer(): void; //# sourceMappingURL=instrumentServer.d.ts.map