|
4 | 4 | import { captureException } from '@sentry/core'; |
5 | 5 | import { logger } from '@sentry/utils'; |
6 | 6 |
|
7 | | -import type { EventBuffer, RecordingEvent, WorkerAddEventResponse, WorkerRequest } from './types'; |
| 7 | +import type { AddEventResult, EventBuffer, RecordingEvent, WorkerRequest } from './types'; |
8 | 8 | import workerString from './worker/worker.js'; |
9 | 9 |
|
10 | 10 | interface CreateEventBufferParams { |
@@ -53,7 +53,7 @@ class EventBufferArray implements EventBuffer { |
53 | 53 | this._events = []; |
54 | 54 | } |
55 | 55 |
|
56 | | - public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<void> { |
| 56 | + public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> { |
57 | 57 | if (isCheckout) { |
58 | 58 | this._events = [event]; |
59 | 59 | return; |
@@ -110,7 +110,7 @@ export class EventBufferCompressionWorker implements EventBuffer { |
110 | 110 | * |
111 | 111 | * Returns true if event was successfuly received and processed by worker. |
112 | 112 | */ |
113 | | - public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<WorkerAddEventResponse> { |
| 113 | + public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> { |
114 | 114 | if (isCheckout) { |
115 | 115 | // This event is a checkout, make sure worker buffer is cleared before |
116 | 116 | // proceeding. |
@@ -180,7 +180,7 @@ export class EventBufferCompressionWorker implements EventBuffer { |
180 | 180 | /** |
181 | 181 | * Send the event to the worker. |
182 | 182 | */ |
183 | | - private async _sendEventToWorker(event: RecordingEvent): Promise<WorkerAddEventResponse> { |
| 183 | + private async _sendEventToWorker(event: RecordingEvent): Promise<AddEventResult> { |
184 | 184 | const promise = this._postMessage<void>({ |
185 | 185 | id: this._getAndIncrementId(), |
186 | 186 | method: 'addEvent', |
|
0 commit comments