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 1
1
import { getWorkerURL } from '@sentry-internal/replay-worker' ;
2
2
import { DEBUG_BUILD } from '../debug-build' ;
3
- import type { EventBuffer } from '../types' ;
3
+ import type { EventBuffer , ReplayWorkerURL } from '../types' ;
4
4
import { logger } from '../util/logger' ;
5
5
import { EventBufferArray } from './EventBufferArray' ;
6
6
import { EventBufferProxy } from './EventBufferProxy' ;
7
7
8
8
interface CreateEventBufferParams {
9
9
useCompression : boolean ;
10
- workerUrl ?: string ;
10
+ workerUrl ?: ReplayWorkerURL ;
11
11
}
12
12
13
13
// Treeshakable guard to remove the code of the included compression worker
@@ -36,7 +36,7 @@ export function createEventBuffer({
36
36
return new EventBufferArray ( ) ;
37
37
}
38
38
39
- function _loadWorker ( customWorkerUrl ?: string ) : EventBufferProxy | void {
39
+ function _loadWorker ( customWorkerUrl ?: ReplayWorkerURL ) : EventBufferProxy | void {
40
40
try {
41
41
const workerUrl = customWorkerUrl || _getWorkerUrl ( ) ;
42
42
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ export interface ReplayNetworkOptions {
90
90
networkResponseHeaders : string [ ] ;
91
91
}
92
92
93
+ export type ReplayWorkerURL = string | URL ;
94
+
93
95
export interface ReplayPluginOptions extends ReplayNetworkOptions {
94
96
/**
95
97
* The sample rate for session-long replays. 1.0 will record all sessions and
@@ -130,7 +132,7 @@ export interface ReplayPluginOptions extends ReplayNetworkOptions {
130
132
* If defined, use this worker URL instead of the default included one for compression.
131
133
* This will only be used if `useCompression` is not false.
132
134
*/
133
- workerUrl ?: string ;
135
+ workerUrl ?: ReplayWorkerURL ;
134
136
135
137
/**
136
138
* Block all media (e.g. images, svg, video) in recordings.
You can’t perform that action at this time.
0 commit comments