diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts index 820e41858135..96ab7080e8c6 100644 --- a/packages/core/src/scope.ts +++ b/packages/core/src/scope.ts @@ -121,7 +121,7 @@ export class Scope implements ScopeInterface { } /** - * Clone this scope instance. + * @inheritDoc */ public clone(): Scope { const newScope = new Scope(); @@ -145,23 +145,22 @@ export class Scope implements ScopeInterface { return newScope; } - /** Update the client on the scope. */ + /** + * @inheritDoc + */ public setClient(client: Client | undefined): void { this._client = client; } /** - * Get the client assigned to this scope. - * - * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing. + * @inheritDoc */ public getClient(): C | undefined { return this._client as C | undefined; } /** - * Add internal on change listener. Used for sub SDKs that need to store the scope. - * @hidden + * @inheritDoc */ public addScopeListener(callback: (scope: Scope) => void): void { this._scopeListeners.push(callback); @@ -542,7 +541,7 @@ export class Scope implements ScopeInterface { } /** - * Add data which will be accessible during event processing but won't get sent to Sentry + * @inheritDoc */ public setSDKProcessingMetadata(newData: { [key: string]: unknown }): this { this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData }; @@ -566,11 +565,7 @@ export class Scope implements ScopeInterface { } /** - * Capture an exception for this scope. - * - * @param exception The exception to capture. - * @param hint Optinal additional data to attach to the Sentry event. - * @returns the id of the captured Sentry event. + * @inheritDoc */ public captureException(exception: unknown, hint?: EventHint): string { const eventId = hint && hint.event_id ? hint.event_id : uuid4(); @@ -597,12 +592,7 @@ export class Scope implements ScopeInterface { } /** - * Capture a message for this scope. - * - * @param message The message to capture. - * @param level An optional severity level to report the message with. - * @param hint Optional additional data to attach to the Sentry event. - * @returns the id of the captured message. + * @inheritDoc */ public captureMessage(message: string, level?: SeverityLevel, hint?: EventHint): string { const eventId = hint && hint.event_id ? hint.event_id : uuid4(); @@ -630,11 +620,7 @@ export class Scope implements ScopeInterface { } /** - * Captures a manually created event for this scope and sends it to Sentry. - * - * @param exception The event to capture. - * @param hint Optional additional data to attach to the Sentry event. - * @returns the id of the captured event. + * @inheritDoc */ public captureEvent(event: Event, hint?: EventHint): string { const eventId = hint && hint.event_id ? hint.event_id : uuid4(); diff --git a/packages/types/src/scope.ts b/packages/types/src/scope.ts index 39e93f8ac1df..c5a5daa25241 100644 --- a/packages/types/src/scope.ts +++ b/packages/types/src/scope.ts @@ -61,6 +61,12 @@ export interface Scope { */ getClient(): C | undefined; + /** + * Add internal on change listener. Used for sub SDKs that need to store the scope. + * @hidden + */ + addScopeListener(callback: (scope: Scope) => void): void; + /** Add new event processor that will be called during event processing. */ addEventProcessor(callback: EventProcessor): this;