UNPKG

1.35 kBTypeScriptView Raw
1import type { Client, Integration, IntegrationClass } from '@sentry/types';
2export type HttpStatusCodeRange = [number, number] | number;
3export type HttpRequestTarget = string | RegExp;
4interface HttpClientOptions {
5 /**
6 * HTTP status codes that should be considered failed.
7 * This array can contain tuples of `[begin, end]` (both inclusive),
8 * single status codes, or a combinations of both
9 *
10 * Example: [[500, 505], 507]
11 * Default: [[500, 599]]
12 */
13 failedRequestStatusCodes: HttpStatusCodeRange[];
14 /**
15 * Targets to track for failed requests.
16 * This array can contain strings or regular expressions.
17 *
18 * Example: ['http://localhost', /api\/.*\/]
19 * Default: [/.*\/]
20 */
21 failedRequestTargets: HttpRequestTarget[];
22}
23export declare const httpClientIntegration: (options?: Partial<HttpClientOptions> | undefined) => import("@sentry/types").IntegrationFnResult;
24/**
25 * Create events for failed client side HTTP requests.
26 * @deprecated Use `httpClientIntegration()` instead.
27 */
28export declare const HttpClient: IntegrationClass<Integration & {
29 setup: (client: Client) => void;
30}> & (new (options?: {
31 failedRequestStatusCodes: HttpStatusCodeRange[];
32 failedRequestTargets: HttpRequestTarget[];
33}) => Integration);
34export {};
35//# sourceMappingURL=httpclient.d.ts.map
\No newline at end of file