1
1
import { API } from '@sentry/core' ;
2
- import { Event , Response , SentryRequestType , Status , Transport , TransportOptions } from '@sentry/types' ;
2
+ import {
3
+ Event ,
4
+ Response as SentryResponse ,
5
+ SentryRequestType ,
6
+ Status ,
7
+ Transport ,
8
+ TransportOptions ,
9
+ } from '@sentry/types' ;
3
10
import { logger , parseRetryAfterHeader , PromiseBuffer , SentryError } from '@sentry/utils' ;
4
11
5
12
/** Base Transport class implementation */
@@ -13,7 +20,7 @@ export abstract class BaseTransport implements Transport {
13
20
protected readonly _api : API ;
14
21
15
22
/** A simple buffer holding all requests. */
16
- protected readonly _buffer : PromiseBuffer < Response > = new PromiseBuffer ( 30 ) ;
23
+ protected readonly _buffer : PromiseBuffer < SentryResponse > = new PromiseBuffer ( 30 ) ;
17
24
18
25
/** Locks transport after receiving rate limits in a response */
19
26
protected readonly _rateLimits : Record < string , Date > = { } ;
@@ -27,7 +34,7 @@ export abstract class BaseTransport implements Transport {
27
34
/**
28
35
* @inheritDoc
29
36
*/
30
- public sendEvent ( _ : Event ) : PromiseLike < Response > {
37
+ public sendEvent ( _ : Event ) : PromiseLike < SentryResponse > {
31
38
throw new SentryError ( 'Transport Class has to implement `sendEvent` method' ) ;
32
39
}
33
40
@@ -49,9 +56,9 @@ export abstract class BaseTransport implements Transport {
49
56
reject,
50
57
} : {
51
58
requestType : SentryRequestType ;
52
- response : globalThis . Response | XMLHttpRequest ;
59
+ response : Response | XMLHttpRequest ;
53
60
headers : Record < string , string | null > ;
54
- resolve : ( value ?: Response | PromiseLike < Response > | null | undefined ) => void ;
61
+ resolve : ( value ?: SentryResponse | PromiseLike < SentryResponse > | null | undefined ) => void ;
55
62
reject : ( reason ?: unknown ) => void ;
56
63
} ) : void {
57
64
const status = Status . fromHttpCode ( response . status ) ;
0 commit comments