File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
packages/replay-internal/src Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 11import { getWorkerURL } from '@sentry-internal/replay-worker' ;
22import { DEBUG_BUILD } from '../debug-build' ;
3- import type { EventBuffer } from '../types' ;
3+ import type { EventBuffer , ReplayWorkerURL } from '../types' ;
44import { logger } from '../util/logger' ;
55import { EventBufferArray } from './EventBufferArray' ;
66import { EventBufferProxy } from './EventBufferProxy' ;
77
88interface CreateEventBufferParams {
99 useCompression : boolean ;
10- workerUrl ?: string ;
10+ workerUrl ?: ReplayWorkerURL ;
1111}
1212
1313// Treeshakable guard to remove the code of the included compression worker
@@ -36,7 +36,7 @@ export function createEventBuffer({
3636 return new EventBufferArray ( ) ;
3737}
3838
39- function _loadWorker ( customWorkerUrl ?: string ) : EventBufferProxy | void {
39+ function _loadWorker ( customWorkerUrl ?: ReplayWorkerURL ) : EventBufferProxy | void {
4040 try {
4141 const workerUrl = customWorkerUrl || _getWorkerUrl ( ) ;
4242
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ export interface ReplayNetworkOptions {
9090 networkResponseHeaders : string [ ] ;
9191}
9292
93+ export type ReplayWorkerURL = string | URL ;
94+
9395export interface ReplayPluginOptions extends ReplayNetworkOptions {
9496 /**
9597 * The sample rate for session-long replays. 1.0 will record all sessions and
@@ -130,7 +132,7 @@ export interface ReplayPluginOptions extends ReplayNetworkOptions {
130132 * If defined, use this worker URL instead of the default included one for compression.
131133 * This will only be used if `useCompression` is not false.
132134 */
133- workerUrl ?: string ;
135+ workerUrl ?: ReplayWorkerURL ;
134136
135137 /**
136138 * Block all media (e.g. images, svg, video) in recordings.
You can’t perform that action at this time.
0 commit comments