Skip to content

Commit d311826

Browse files
committed
ref: PR feedback
1 parent fffe589 commit d311826

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/types/src/event.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ export interface Event {
6161
/** JSDoc */
6262
export type EventType = 'transaction' | 'profile';
6363

64-
export type ErrorEvent = Event & { type: undefined };
65-
export type TransactionEvent = Event & { type: 'transaction' };
64+
export interface ErrorEvent extends Event {
65+
type: undefined;
66+
}
67+
export interface TransactionEvent extends Event {
68+
type: 'transaction';
69+
}
6670

6771
/** JSDoc */
6872
export interface EventHint {

packages/types/src/options.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,30 +222,28 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
222222
*/
223223
tracesSampler?: (samplingContext: SamplingContext) => number | boolean;
224224

225+
// TODO v8: Narrow the response type to `ErrorEvent` - this is technically a breaking change.
225226
/**
226227
* An event-processing callback for error and message events, guaranteed to be invoked after all other event
227228
* processors, which allows an event to be modified or dropped.
228229
*
229230
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
230231
* it at the end. Returning `null` will cause the event to be dropped.
231232
*
232-
* TODO v8: Narrow the response type to `ErrorEvent` - this is technically a breaking change.
233-
*
234233
* @param event The error or message event generated by the SDK.
235234
* @param hint Event metadata useful for processing.
236235
* @returns A new event that will be sent | null.
237236
*/
238237
beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<Event | null> | Event | null;
239238

239+
// TODO v8: Narrow the response type to `TransactionEvent` - this is technically a breaking change.
240240
/**
241241
* An event-processing callback for transaction events, guaranteed to be invoked after all other event
242242
* processors. This allows an event to be modified or dropped before it's sent.
243243
*
244244
* Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
245245
* it at the end. Returning `null` will cause the event to be dropped.
246246
*
247-
* TODO v8: Narrow the response type to `TransactionEvent` - this is technically a breaking change.
248-
*
249247
* @param event The error or message event generated by the SDK.
250248
* @param hint Event metadata useful for processing.
251249
* @returns A new event that will be sent | null.

0 commit comments

Comments
 (0)