@@ -34,7 +34,7 @@ const DEFAULT_MAX_BREADCRUMBS = 100;
3434/**
3535 * Holds additional event information.
3636 */
37- export class Scope implements ScopeInterface {
37+ class ScopeClass implements ScopeInterface {
3838 /** Flag if notifying is happening. */
3939 protected _notifyingListeners : boolean ;
4040
@@ -116,8 +116,8 @@ export class Scope implements ScopeInterface {
116116 /**
117117 * @inheritDoc
118118 */
119- public clone ( ) : Scope {
120- const newScope = new Scope ( ) ;
119+ public clone ( ) : ScopeClass {
120+ const newScope = new ScopeClass ( ) ;
121121 newScope . _breadcrumbs = [ ...this . _breadcrumbs ] ;
122122 newScope . _tags = { ...this . _tags } ;
123123 newScope . _extra = { ...this . _extra } ;
@@ -587,6 +587,20 @@ export class Scope implements ScopeInterface {
587587 }
588588}
589589
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+
590604function generatePropagationContext ( ) : PropagationContext {
591605 return {
592606 traceId : uuid4 ( ) ,
0 commit comments