1 |
|
2 | import type * as http from 'node:http';
|
3 | export declare const instrumentExpress: ((options?: unknown) => void) & {
|
4 | id: string;
|
5 | };
|
6 | /**
|
7 | * Adds Sentry tracing instrumentation for [Express](https:
|
8 | *
|
9 | * If you also want to capture errors, you need to call `setupExpressErrorHandler(app)` after you set up your Express server.
|
10 | *
|
11 | * For more information, see the [express documentation](https:
|
12 | *
|
13 | * @example
|
14 | * ```javascript
|
15 | * const Sentry = require('@sentry/node');
|
16 | *
|
17 | * Sentry.init({
|
18 | * integrations: [Sentry.expressIntegration()],
|
19 | * })
|
20 | * ```
|
21 | */
|
22 | export declare const expressIntegration: () => import("@sentry/core").Integration;
|
23 | interface MiddlewareError extends Error {
|
24 | status?: number | string;
|
25 | statusCode?: number | string;
|
26 | status_code?: number | string;
|
27 | output?: {
|
28 | statusCode?: number | string;
|
29 | };
|
30 | }
|
31 | type ExpressMiddleware = (req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void;
|
32 | type ExpressErrorMiddleware = (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
|
33 | interface ExpressHandlerOptions {
|
34 | |
35 |
|
36 |
|
37 |
|
38 | shouldHandleError?(this: void, error: MiddlewareError): boolean;
|
39 | }
|
40 |
|
41 |
|
42 |
|
43 | export declare function expressErrorHandler(options?: ExpressHandlerOptions): ExpressErrorMiddleware;
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 | export declare function setupExpressErrorHandler(app: {
|
69 | use: (middleware: ExpressMiddleware | ExpressErrorMiddleware) => unknown;
|
70 | }, options?: ExpressHandlerOptions): void;
|
71 | export {};
|
72 |
|
\ | No newline at end of file |