1
1
import { BaseClient , NewTransport , Scope , SDK_VERSION } from '@sentry/core' ;
2
- import { Event , EventHint , Options , Severity , SeverityLevel , Transport } from '@sentry/types' ;
2
+ import { ClientOptions , Event , EventHint , Options , Severity , SeverityLevel , Transport } from '@sentry/types' ;
3
3
import { getGlobalObject , logger , stackParserFromOptions } from '@sentry/utils' ;
4
4
5
5
import { eventFromException , eventFromMessage } from './eventbuilder' ;
6
6
import { IS_DEBUG_BUILD } from './flags' ;
7
7
import { injectReportDialog , ReportDialogOptions } from './helpers' ;
8
8
import { Breadcrumbs } from './integrations' ;
9
9
10
- /**
11
- * Configuration options for the Sentry Browser SDK.
12
- * @see BrowserClient for more information.
13
- */
14
- export interface BrowserOptions extends Options {
10
+ export interface BaseBrowserOptions {
15
11
/**
16
12
* A pattern for error URLs which should exclusively be sent to Sentry.
17
13
* This is the opposite of {@link Options.denyUrls}.
@@ -27,19 +23,27 @@ export interface BrowserOptions extends Options {
27
23
denyUrls ?: Array < string | RegExp > ;
28
24
}
29
25
26
+ export interface BrowserOptions extends Options , BaseBrowserOptions { }
27
+
28
+ /**
29
+ * Configuration options for the Sentry Browser SDK.
30
+ * @see BrowserClient for more information.
31
+ */
32
+ export interface BrowserClientOptions extends ClientOptions , BaseBrowserOptions { }
33
+
30
34
/**
31
35
* The Sentry Browser SDK Client.
32
36
*
33
37
* @see BrowserOptions for documentation on configuration options.
34
38
* @see SentryClient for usage documentation.
35
39
*/
36
- export class BrowserClient extends BaseClient < BrowserOptions > {
40
+ export class BrowserClient extends BaseClient < BrowserClientOptions > {
37
41
/**
38
42
* Creates a new Browser SDK instance.
39
43
*
40
44
* @param options Configuration options for this SDK.
41
45
*/
42
- public constructor ( options : BrowserOptions = { } , transport : Transport , newTransport ?: NewTransport ) {
46
+ public constructor ( options : BrowserClientOptions , transport : Transport , newTransport ?: NewTransport ) {
43
47
options . _metadata = options . _metadata || { } ;
44
48
options . _metadata . sdk = options . _metadata . sdk || {
45
49
name : 'sentry.javascript.browser' ,
@@ -51,7 +55,6 @@ export class BrowserClient extends BaseClient<BrowserOptions> {
51
55
] ,
52
56
version : SDK_VERSION ,
53
57
} ;
54
-
55
58
super ( options , transport , newTransport ) ;
56
59
}
57
60
0 commit comments