@@ -34,7 +34,7 @@ const DEFAULT_MAX_BREADCRUMBS = 100;
34
34
/**
35
35
* Holds additional event information.
36
36
*/
37
- export class Scope implements ScopeInterface {
37
+ class ScopeClass implements ScopeInterface {
38
38
/** Flag if notifying is happening. */
39
39
protected _notifyingListeners : boolean ;
40
40
@@ -116,8 +116,8 @@ export class Scope implements ScopeInterface {
116
116
/**
117
117
* @inheritDoc
118
118
*/
119
- public clone ( ) : Scope {
120
- const newScope = new Scope ( ) ;
119
+ public clone ( ) : ScopeClass {
120
+ const newScope = new ScopeClass ( ) ;
121
121
newScope . _breadcrumbs = [ ...this . _breadcrumbs ] ;
122
122
newScope . _tags = { ...this . _tags } ;
123
123
newScope . _extra = { ...this . _extra } ;
@@ -587,6 +587,20 @@ export class Scope implements ScopeInterface {
587
587
}
588
588
}
589
589
590
+ // NOTE: By exporting this here as const & type, instead of doing `export class`,
591
+ // We can get the correct class when importing from `@sentry/core`, but the original type (from `@sentry/types`)
592
+ // This is helpful for interop, e.g. when doing `import type { Scope } from '@sentry/node';` (which re-exports this)
593
+
594
+ /**
595
+ * Holds additional event information.
596
+ */
597
+ export const Scope = ScopeClass ;
598
+
599
+ /**
600
+ * Holds additional event information.
601
+ */
602
+ export type Scope = ScopeInterface ;
603
+
590
604
function generatePropagationContext ( ) : PropagationContext {
591
605
return {
592
606
traceId : uuid4 ( ) ,
0 commit comments