11import type { Breadcrumb , BreadcrumbHint } from './breadcrumb' ;
2- import type { ErrorEvent , Event , EventHint , TransactionEvent } from './event' ;
2+ import type { ErrorEvent , EventHint , TransactionEvent } from './event' ;
33import type { Integration } from './integration' ;
44import type { CaptureContext } from './scope' ;
55import type { SdkMetadata } from './sdkmetadata' ;
@@ -255,7 +255,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
255255 */
256256 tracesSampler ?: ( samplingContext : SamplingContext ) => number | boolean ;
257257
258- // TODO (v8): Narrow the response type to `ErrorEvent` - this is technically a breaking change.
259258 /**
260259 * An event-processing callback for error and message events, guaranteed to be invoked after all other event
261260 * processors, which allows an event to be modified or dropped.
@@ -267,9 +266,8 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
267266 * @param hint Event metadata useful for processing.
268267 * @returns A new event that will be sent | null.
269268 */
270- beforeSend ?: ( event : ErrorEvent , hint : EventHint ) => PromiseLike < Event | null > | Event | null ;
269+ beforeSend ?: ( event : ErrorEvent , hint : EventHint ) => PromiseLike < ErrorEvent | null > | ErrorEvent | null ;
271270
272- // TODO (v8): Narrow the response type to `TransactionEvent` - this is technically a breaking change.
273271 /**
274272 * An event-processing callback for transaction events, guaranteed to be invoked after all other event
275273 * processors. This allows an event to be modified or dropped before it's sent.
@@ -281,7 +279,10 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
281279 * @param hint Event metadata useful for processing.
282280 * @returns A new event that will be sent | null.
283281 */
284- beforeSendTransaction ?: ( event : TransactionEvent , hint : EventHint ) => PromiseLike < Event | null > | Event | null ;
282+ beforeSendTransaction ?: (
283+ event : TransactionEvent ,
284+ hint : EventHint ,
285+ ) => PromiseLike < TransactionEvent | null > | TransactionEvent | null ;
285286
286287 /**
287288 * A callback invoked when adding a breadcrumb, allowing to optionally modify
0 commit comments