@sentry/replay 7.67.0 → 7.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/cjs/index.js +144 -153
  2. package/cjs/index.js.map +1 -1
  3. package/esm/index.js +144 -153
  4. package/esm/index.js.map +1 -1
  5. package/package.json +6 -6
  6. package/types/replay.d.ts +7 -1
  7. package/types/replay.d.ts.map +1 -1
  8. package/types/session/Session.d.ts.map +1 -1
  9. package/types/session/loadOrCreateSession.d.ts +2 -1
  10. package/types/session/loadOrCreateSession.d.ts.map +1 -1
  11. package/types/session/shouldRefreshSession.d.ts +7 -0
  12. package/types/session/shouldRefreshSession.d.ts.map +1 -0
  13. package/types/types/replay.d.ts +0 -5
  14. package/types/types/replay.d.ts.map +1 -1
  15. package/types/util/addEvent.d.ts +13 -0
  16. package/types/util/addEvent.d.ts.map +1 -1
  17. package/types/util/addGlobalListeners.d.ts.map +1 -1
  18. package/types/util/createPerformanceEntries.d.ts.map +1 -1
  19. package/types/util/handleRecordingEmit.d.ts.map +1 -1
  20. package/types-ts3.8/constants.d.ts +25 -0
  21. package/types-ts3.8/coreHandlers/handleAfterSendEvent.d.ts +9 -0
  22. package/types-ts3.8/coreHandlers/handleClick.d.ts +39 -0
  23. package/types-ts3.8/coreHandlers/handleDom.d.ts +13 -0
  24. package/types-ts3.8/coreHandlers/handleFetch.d.ts +9 -0
  25. package/types-ts3.8/coreHandlers/handleGlobalEvent.d.ts +7 -0
  26. package/types-ts3.8/coreHandlers/handleHistory.d.ts +11 -0
  27. package/types-ts3.8/coreHandlers/handleKeyboardEvent.d.ts +7 -0
  28. package/types-ts3.8/coreHandlers/handleNetworkBreadcrumbs.d.ts +17 -0
  29. package/types-ts3.8/coreHandlers/handleScope.d.ts +13 -0
  30. package/types-ts3.8/coreHandlers/handleXhr.d.ts +9 -0
  31. package/types-ts3.8/coreHandlers/performanceObserver.d.ts +6 -0
  32. package/types-ts3.8/coreHandlers/util/addBreadcrumbEvent.d.ts +7 -0
  33. package/types-ts3.8/coreHandlers/util/addNetworkBreadcrumb.d.ts +4 -0
  34. package/types-ts3.8/coreHandlers/util/domUtils.d.ts +19 -0
  35. package/types-ts3.8/coreHandlers/util/fetchUtils.d.ts +23 -0
  36. package/types-ts3.8/coreHandlers/util/getAttributesToRecord.d.ts +5 -0
  37. package/types-ts3.8/coreHandlers/util/networkUtils.d.ts +23 -0
  38. package/types-ts3.8/coreHandlers/util/onWindowOpen.d.ts +8 -0
  39. package/types-ts3.8/coreHandlers/util/shouldSampleForBufferEvent.d.ts +9 -0
  40. package/types-ts3.8/coreHandlers/util/xhrUtils.d.ts +22 -0
  41. package/types-ts3.8/eventBuffer/EventBufferArray.d.ts +28 -0
  42. package/types-ts3.8/eventBuffer/EventBufferCompressionWorker.d.ts +50 -0
  43. package/types-ts3.8/eventBuffer/EventBufferProxy.d.ts +42 -0
  44. package/types-ts3.8/eventBuffer/WorkerHandler.d.ts +27 -0
  45. package/types-ts3.8/eventBuffer/error.d.ts +5 -0
  46. package/types-ts3.8/eventBuffer/index.d.ts +10 -0
  47. package/types-ts3.8/index.d.ts +4 -0
  48. package/types-ts3.8/integration.d.ts +73 -0
  49. package/types-ts3.8/replay.d.ts +314 -0
  50. package/types-ts3.8/session/Session.d.ts +8 -0
  51. package/types-ts3.8/session/clearSession.d.ts +6 -0
  52. package/types-ts3.8/session/createSession.d.ts +14 -0
  53. package/types-ts3.8/session/fetchSession.d.ts +6 -0
  54. package/types-ts3.8/session/index.d.ts +2 -0
  55. package/types-ts3.8/session/loadOrCreateSession.d.ts +12 -0
  56. package/types-ts3.8/session/saveSession.d.ts +6 -0
  57. package/types-ts3.8/session/shouldRefreshSession.d.ts +7 -0
  58. package/types-ts3.8/types/deprecated.d.ts +16 -0
  59. package/types-ts3.8/types/index.d.ts +6 -0
  60. package/types-ts3.8/types/performance.d.ts +124 -0
  61. package/types-ts3.8/types/replay.d.ts +417 -0
  62. package/types-ts3.8/types/replayFrame.d.ts +173 -0
  63. package/types-ts3.8/types/request.d.ts +15 -0
  64. package/types-ts3.8/types/rrweb.d.ts +37 -0
  65. package/types-ts3.8/util/addEvent.d.ts +20 -0
  66. package/types-ts3.8/util/addGlobalListeners.d.ts +6 -0
  67. package/types-ts3.8/util/addMemoryEntry.d.ts +7 -0
  68. package/types-ts3.8/util/createBreadcrumb.d.ts +6 -0
  69. package/types-ts3.8/util/createPerformanceEntries.d.ts +6 -0
  70. package/types-ts3.8/util/createPerformanceSpans.d.ts +6 -0
  71. package/types-ts3.8/util/createReplayEnvelope.d.ts +7 -0
  72. package/types-ts3.8/util/debounce.d.ts +30 -0
  73. package/types-ts3.8/util/dedupePerformanceEntries.d.ts +11 -0
  74. package/types-ts3.8/util/eventUtils.d.ts +8 -0
  75. package/types-ts3.8/util/getPrivacyOptions.d.ts +19 -0
  76. package/types-ts3.8/util/handleRecordingEmit.d.ts +14 -0
  77. package/types-ts3.8/util/hasSessionStorage.d.ts +3 -0
  78. package/types-ts3.8/util/isBrowser.d.ts +5 -0
  79. package/types-ts3.8/util/isExpired.d.ts +6 -0
  80. package/types-ts3.8/util/isRrwebError.d.ts +6 -0
  81. package/types-ts3.8/util/isSampled.d.ts +8 -0
  82. package/types-ts3.8/util/isSessionExpired.d.ts +10 -0
  83. package/types-ts3.8/util/log.d.ts +10 -0
  84. package/types-ts3.8/util/prepareRecordingData.d.ts +9 -0
  85. package/types-ts3.8/util/prepareReplayEvent.d.ts +15 -0
  86. package/types-ts3.8/util/sendReplay.d.ts +9 -0
  87. package/types-ts3.8/util/sendReplayRequest.d.ts +13 -0
  88. package/types-ts3.8/util/shouldFilterRequest.d.ts +7 -0
  89. package/types-ts3.8/util/throttle.d.ts +12 -0
  90. package/types-ts3.8/util/timestamp.d.ts +9 -0
  91. package/types-ts3.8/util/truncateJson/completeJson.d.ts +9 -0
  92. package/types-ts3.8/util/truncateJson/constants.d.ts +12 -0
  93. package/types-ts3.8/util/truncateJson/evaluateJson.d.ts +6 -0
  94. package/types-ts3.8/util/truncateJson/fixJson.d.ts +6 -0
  95. package/types/session/maybeRefreshSession.d.ts +0 -12
  96. package/types/session/maybeRefreshSession.d.ts.map +0 -1
@@ -0,0 +1,124 @@
1
+ import { ReplayNetworkRequestOrResponse } from './request';
2
+ export type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
3
+ export type PerformancePaintTiming = PerformanceEntry;
4
+ export type PerformanceNavigationTiming = PerformanceEntry & PerformanceResourceTiming & {
5
+ type: string;
6
+ transferSize: number;
7
+ /**
8
+ * A DOMHighResTimeStamp representing the time immediately before the user agent
9
+ * sets the document's readyState to "interactive".
10
+ */
11
+ domInteractive: number;
12
+ /**
13
+ * A DOMHighResTimeStamp representing the time immediately before the current
14
+ * document's DOMContentLoaded event handler starts.
15
+ */
16
+ domContentLoadedEventStart: number;
17
+ /**
18
+ * A DOMHighResTimeStamp representing the time immediately after the current
19
+ * document's DOMContentLoaded event handler completes.
20
+ */
21
+ domContentLoadedEventEnd: number;
22
+ /**
23
+ * A DOMHighResTimeStamp representing the time immediately before the current
24
+ * document's load event handler starts.
25
+ */
26
+ loadEventStart: number;
27
+ /**
28
+ * A DOMHighResTimeStamp representing the time immediately after the current
29
+ * document's load event handler completes.
30
+ */
31
+ loadEventEnd: number;
32
+ /**
33
+ * A DOMHighResTimeStamp representing the time immediately before the user agent
34
+ * sets the document's readyState to "complete".
35
+ */
36
+ domComplete: number;
37
+ /**
38
+ * A number representing the number of redirects since the last non-redirect
39
+ * navigation in the current browsing context.
40
+ */
41
+ redirectCount: number;
42
+ };
43
+ export type ExperimentalPerformanceResourceTiming = PerformanceResourceTiming & {
44
+ responseStatus?: number;
45
+ };
46
+ export type PaintData = undefined;
47
+ /**
48
+ * See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
49
+ *
50
+ * Note `navigation.push` will not have any data
51
+ */
52
+ export type NavigationData = Partial<Pick<PerformanceNavigationTiming, 'decodedBodySize' | 'encodedBodySize' | 'duration' | 'domInteractive' | 'domContentLoadedEventEnd' | 'domContentLoadedEventStart' | 'loadEventStart' | 'loadEventEnd' | 'domComplete' | 'redirectCount'>> & {
53
+ /**
54
+ * Transfer size of resource
55
+ */
56
+ size?: number;
57
+ };
58
+ export type ResourceData = Pick<PerformanceResourceTiming, 'decodedBodySize' | 'encodedBodySize'> & {
59
+ /**
60
+ * Transfer size of resource
61
+ */
62
+ size: number;
63
+ /**
64
+ * HTTP status code. Note this is experimental and not available on all browsers.
65
+ */
66
+ statusCode?: number;
67
+ };
68
+ export interface LargestContentfulPaintData {
69
+ /**
70
+ * Render time (in ms) of the LCP
71
+ */
72
+ value: number;
73
+ size: number;
74
+ /**
75
+ * The recording id of the LCP node. -1 if not found
76
+ */
77
+ nodeId?: number;
78
+ }
79
+ /**
80
+ * Entries that come from window.performance
81
+ */
82
+ export type AllPerformanceEntryData = PaintData | NavigationData | ResourceData | LargestContentfulPaintData;
83
+ export interface MemoryData {
84
+ memory: {
85
+ jsHeapSizeLimit: number;
86
+ totalJSHeapSize: number;
87
+ usedJSHeapSize: number;
88
+ };
89
+ }
90
+ export interface NetworkRequestData {
91
+ method?: string;
92
+ statusCode?: number;
93
+ requestBodySize?: number;
94
+ responseBodySize?: number;
95
+ request?: ReplayNetworkRequestOrResponse;
96
+ response?: ReplayNetworkRequestOrResponse;
97
+ }
98
+ export interface HistoryData {
99
+ previous: string;
100
+ }
101
+ export type AllEntryData = AllPerformanceEntryData | MemoryData | NetworkRequestData | HistoryData;
102
+ export interface ReplayPerformanceEntry<T> {
103
+ /**
104
+ * One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
105
+ */
106
+ type: string;
107
+ /**
108
+ * A more specific description of the performance entry
109
+ */
110
+ name: string;
111
+ /**
112
+ * The start timestamp in seconds
113
+ */
114
+ start: number;
115
+ /**
116
+ * The end timestamp in seconds
117
+ */
118
+ end: number;
119
+ /**
120
+ * Additional unstructured data to be included
121
+ */
122
+ data: T;
123
+ }
124
+ //# sourceMappingURL=performance.d.ts.map
@@ -0,0 +1,417 @@
1
+ import { Breadcrumb, FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, Transaction, XhrBreadcrumbHint } from '@sentry/types';
2
+ import { SKIPPED, THROTTLED } from '../util/throttle';
3
+ import { AllPerformanceEntry } from './performance';
4
+ import { ReplayFrameEvent } from './replayFrame';
5
+ import { ReplayNetworkRequestOrResponse } from './request';
6
+ import { ReplayEventWithTime, RrwebRecordOptions } from './rrweb';
7
+ export type RecordingEvent = ReplayFrameEvent | ReplayEventWithTime;
8
+ export type RecordingOptions = RrwebRecordOptions;
9
+ export interface SendReplayData {
10
+ recordingData: ReplayRecordingData;
11
+ replayId: string;
12
+ segmentId: number;
13
+ eventContext: PopEventContext;
14
+ timestamp: number;
15
+ session: Session;
16
+ options: ReplayPluginOptions;
17
+ }
18
+ export interface Timeouts {
19
+ sessionIdlePause: number;
20
+ sessionIdleExpire: number;
21
+ }
22
+ /**
23
+ * The request payload to worker
24
+ */
25
+ export interface WorkerRequest {
26
+ id: number;
27
+ method: 'clear' | 'addEvent' | 'finish';
28
+ arg?: string;
29
+ }
30
+ /**
31
+ * The response from the worker
32
+ */
33
+ export interface WorkerResponse {
34
+ id: number;
35
+ method: string;
36
+ success: boolean;
37
+ response: unknown;
38
+ }
39
+ export type AddEventResult = void;
40
+ export interface BeforeAddRecordingEvent {
41
+ (event: ReplayFrameEvent): ReplayFrameEvent | null | undefined;
42
+ }
43
+ export interface ReplayNetworkOptions {
44
+ /**
45
+ * Capture request/response details for XHR/Fetch requests that match the given URLs.
46
+ * The URLs can be strings or regular expressions.
47
+ * When provided a string, we will match any URL that contains the given string.
48
+ * You can use a Regex to handle exact matches or more complex matching.
49
+ *
50
+ * Only URLs matching these patterns will have bodies & additional headers captured.
51
+ */
52
+ networkDetailAllowUrls: (string | RegExp)[];
53
+ /**
54
+ * Deny request/response details for XHR/Fetch requests that match the given URLs.
55
+ * The URLs can be strings or regular expressions.
56
+ * When provided a string, we will deny any URL that contains the given string.
57
+ * You can use a Regex to handle exact matches or more complex matching.
58
+ * URLs matching these patterns will not have bodies & additional headers captured.
59
+ */
60
+ networkDetailDenyUrls: (string | RegExp)[];
61
+ /**
62
+ * If request & response bodies should be captured.
63
+ * Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
64
+ * Defaults to true.
65
+ */
66
+ networkCaptureBodies: boolean;
67
+ /**
68
+ * Capture the following request headers, in addition to the default ones.
69
+ * Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
70
+ * Any headers defined here will be captured in addition to the default headers.
71
+ */
72
+ networkRequestHeaders: string[];
73
+ /**
74
+ * Capture the following response headers, in addition to the default ones.
75
+ * Only applies to URLs matched by `networkDetailAllowUrls` and not matched by `networkDetailDenyUrls`.
76
+ * Any headers defined here will be captured in addition to the default headers.
77
+ */
78
+ networkResponseHeaders: string[];
79
+ }
80
+ export interface ReplayPluginOptions extends ReplayNetworkOptions {
81
+ /**
82
+ * The sample rate for session-long replays. 1.0 will record all sessions and
83
+ * 0 will record none.
84
+ */
85
+ sessionSampleRate: number;
86
+ /**
87
+ * The sample rate for sessions that has had an error occur. This is
88
+ * independent of `sessionSampleRate`.
89
+ */
90
+ errorSampleRate: number;
91
+ /**
92
+ * If false, will create a new session per pageload. Otherwise, saves session
93
+ * to Session Storage.
94
+ */
95
+ stickySession: boolean;
96
+ /**
97
+ * The amount of time to wait before sending a replay
98
+ */
99
+ flushMinDelay: number;
100
+ /**
101
+ * The max amount of time to wait before sending a replay
102
+ */
103
+ flushMaxDelay: number;
104
+ /**
105
+ * Attempt to use compression when web workers are available
106
+ *
107
+ * (default is true)
108
+ */
109
+ useCompression: boolean;
110
+ /**
111
+ * Block all media (e.g. images, svg, video) in recordings.
112
+ */
113
+ blockAllMedia: boolean;
114
+ /**
115
+ * Mask all inputs in recordings
116
+ */
117
+ maskAllInputs: boolean;
118
+ /**
119
+ * Mask all text in recordings
120
+ */
121
+ maskAllText: boolean;
122
+ /**
123
+ * A high number of DOM mutations (in a single event loop) can cause
124
+ * performance regressions in end-users' browsers. This setting will create
125
+ * a breadcrumb in the recording when the limit has been reached.
126
+ */
127
+ mutationBreadcrumbLimit: number;
128
+ /**
129
+ * A high number of DOM mutations (in a single event loop) can cause
130
+ * performance regressions in end-users' browsers. This setting will cause
131
+ * recording to stop when the limit has been reached.
132
+ */
133
+ mutationLimit: number;
134
+ /**
135
+ * The max. time in ms to wait for a slow click to finish.
136
+ * After this amount of time we stop waiting for actions after a click happened.
137
+ * Set this to 0 to disable slow click capture.
138
+ *
139
+ * Default: 7000ms
140
+ */
141
+ slowClickTimeout: number;
142
+ /**
143
+ * Ignore clicks on elements matching the given selectors for slow click detection.
144
+ */
145
+ slowClickIgnoreSelectors: string[];
146
+ /**
147
+ * The min. duration (in ms) a replay has to have before it is sent to Sentry.
148
+ * Whenever attempting to flush a session that is shorter than this, it will not actually send it to Sentry.
149
+ * Note that this is capped at max. 15s.
150
+ */
151
+ minReplayDuration: number;
152
+ /**
153
+ * The max. duration (in ms) a replay session may be.
154
+ * This is capped at max. 60min.
155
+ */
156
+ maxReplayDuration: number;
157
+ /**
158
+ * Callback before adding a custom recording event
159
+ *
160
+ * Events added by the underlying DOM recording library can *not* be modified,
161
+ * only custom recording events from the Replay integration will trigger the
162
+ * callback listeners. This can be used to scrub certain fields in an event (e.g. URLs from navigation events).
163
+ *
164
+ * Returning a `null` will drop the event completely. Note, dropping a recording
165
+ * event is not the same as dropping the replay, the replay will still exist and
166
+ * continue to function.
167
+ */
168
+ beforeAddRecordingEvent?: BeforeAddRecordingEvent;
169
+ /**
170
+ * _experiments allows users to enable experimental or internal features.
171
+ * We don't consider such features as part of the public API and hence we don't guarantee semver for them.
172
+ * Experimental features can be added, changed or removed at any time.
173
+ *
174
+ * Default: undefined
175
+ */
176
+ _experiments: Partial<{
177
+ captureExceptions: boolean;
178
+ traceInternals: boolean;
179
+ }>;
180
+ }
181
+ /**
182
+ * Session options that are configurable by the integration configuration
183
+ */
184
+ export interface SessionOptions extends Pick<ReplayPluginOptions, 'sessionSampleRate' | 'stickySession'> {
185
+ /**
186
+ * Should buffer recordings to be saved later either by error sampling, or by
187
+ * manually calling `flush()`. This is only a factor if not sampled for a
188
+ * session-based replay.
189
+ */
190
+ allowBuffering: boolean;
191
+ }
192
+ export interface ReplayIntegrationPrivacyOptions {
193
+ /**
194
+ * Mask text content for elements that match the CSS selectors in the list.
195
+ */
196
+ mask?: string[];
197
+ /**
198
+ * Unmask text content for elements that match the CSS selectors in the list.
199
+ */
200
+ unmask?: string[];
201
+ /**
202
+ * Block elements that match the CSS selectors in the list. Blocking replaces
203
+ * the element with an empty placeholder with the same dimensions.
204
+ */
205
+ block?: string[];
206
+ /**
207
+ * Unblock elements that match the CSS selectors in the list. This is useful when using `blockAllMedia`.
208
+ */
209
+ unblock?: string[];
210
+ /**
211
+ * Ignore input events for elements that match the CSS selectors in the list.
212
+ */
213
+ ignore?: string[];
214
+ /**
215
+ * A callback function to customize how your text is masked.
216
+ */
217
+ maskFn?: (s: string) => string;
218
+ }
219
+ type OptionalReplayPluginOptions = Partial<ReplayPluginOptions>;
220
+ export interface DeprecatedPrivacyOptions {
221
+ /**
222
+ * @deprecated Use `block` which accepts an array of CSS selectors
223
+ */
224
+ blockSelector?: RecordingOptions['blockSelector'];
225
+ /**
226
+ * @deprecated Use `block` which accepts an array of CSS selectors
227
+ */
228
+ blockClass?: RecordingOptions['blockClass'];
229
+ /**
230
+ * @deprecated Use `ignore` which accepts an array of CSS selectors
231
+ */
232
+ ignoreClass?: RecordingOptions['ignoreClass'];
233
+ /**
234
+ * @deprecated Use `mask` which accepts an array of CSS selectors
235
+ */
236
+ maskInputOptions?: RecordingOptions['maskInputOptions'];
237
+ /**
238
+ * @deprecated Use `mask` which accepts an array of CSS selectors
239
+ */
240
+ maskTextClass?: RecordingOptions['maskTextClass'];
241
+ /**
242
+ * @deprecated Use `mask` which accepts an array of CSS selectors
243
+ */
244
+ maskTextSelector?: RecordingOptions['maskTextSelector'];
245
+ }
246
+ export interface ReplayConfiguration extends ReplayIntegrationPrivacyOptions, OptionalReplayPluginOptions, DeprecatedPrivacyOptions, Pick<RecordingOptions, 'maskAllText' | 'maskAllInputs'> {
247
+ }
248
+ interface CommonEventContext {
249
+ /**
250
+ * The initial URL of the session
251
+ */
252
+ initialUrl: string;
253
+ /**
254
+ * The initial starting timestamp in ms of the session.
255
+ */
256
+ initialTimestamp: number;
257
+ /**
258
+ * Ordered list of URLs that have been visited during a replay segment
259
+ */
260
+ urls: string[];
261
+ }
262
+ export interface PopEventContext extends CommonEventContext {
263
+ /**
264
+ * List of Sentry error ids that have occurred during a replay segment
265
+ */
266
+ errorIds: Array<string>;
267
+ /**
268
+ * List of Sentry trace ids that have occurred during a replay segment
269
+ */
270
+ traceIds: Array<string>;
271
+ }
272
+ /**
273
+ * Additional context that will be sent w/ `replay_event`
274
+ */
275
+ export interface InternalEventContext extends CommonEventContext {
276
+ /**
277
+ * Set of Sentry error ids that have occurred during a replay segment
278
+ */
279
+ errorIds: Set<string>;
280
+ /**
281
+ * Set of Sentry trace ids that have occurred during a replay segment
282
+ */
283
+ traceIds: Set<string>;
284
+ }
285
+ export type Sampled = false | 'session' | 'buffer';
286
+ export interface Session {
287
+ id: string;
288
+ /**
289
+ * Start time of current session (in ms)
290
+ */
291
+ started: number;
292
+ /**
293
+ * Last known activity of the session (in ms)
294
+ */
295
+ lastActivity: number;
296
+ /**
297
+ * Segment ID for replay events
298
+ */
299
+ segmentId: number;
300
+ /**
301
+ * The ID of the previous session.
302
+ * If this is empty, there was no previous session.
303
+ */
304
+ previousSessionId?: string;
305
+ /**
306
+ * Is the session sampled? `false` if not sampled, otherwise, `session` or `buffer`
307
+ */
308
+ sampled: Sampled;
309
+ }
310
+ export type EventBufferType = 'sync' | 'worker';
311
+ export interface EventBuffer {
312
+ /**
313
+ * If any events have been added to the buffer.
314
+ */
315
+ readonly hasEvents: boolean;
316
+ /**
317
+ * The buffer type
318
+ */
319
+ readonly type: EventBufferType;
320
+ /**
321
+ * If the event buffer contains a checkout event.
322
+ */
323
+ hasCheckout: boolean;
324
+ /**
325
+ * Destroy the event buffer.
326
+ */
327
+ destroy(): void;
328
+ /**
329
+ * Clear the event buffer.
330
+ */
331
+ clear(): void;
332
+ /**
333
+ * Add an event to the event buffer.
334
+ *
335
+ * Returns a promise that resolves if the event was successfully added, else rejects.
336
+ */
337
+ addEvent(event: RecordingEvent): Promise<AddEventResult>;
338
+ /**
339
+ * Clears and returns the contents of the buffer.
340
+ */
341
+ finish(): Promise<ReplayRecordingData>;
342
+ /**
343
+ * Get the earliest timestamp in ms of any event currently in the buffer.
344
+ */
345
+ getEarliestTimestamp(): number | null;
346
+ }
347
+ export type AddUpdateCallback = () => boolean | void;
348
+ export interface SendBufferedReplayOptions {
349
+ continueRecording?: boolean;
350
+ }
351
+ export interface ReplayClickDetector {
352
+ addListeners(): void;
353
+ removeListeners(): void;
354
+ handleClick(breadcrumb: Breadcrumb, node: HTMLElement): void;
355
+ }
356
+ export interface ReplayContainer {
357
+ eventBuffer: EventBuffer | null;
358
+ clickDetector: ReplayClickDetector | undefined;
359
+ performanceEvents: AllPerformanceEntry[];
360
+ session: Session | undefined;
361
+ recordingMode: ReplayRecordingMode;
362
+ timeouts: Timeouts;
363
+ lastTransaction?: Transaction;
364
+ throttledAddEvent: (event: RecordingEvent, isCheckout?: boolean) => typeof THROTTLED | typeof SKIPPED | Promise<AddEventResult | null>;
365
+ isEnabled(): boolean;
366
+ isPaused(): boolean;
367
+ getContext(): InternalEventContext;
368
+ initializeSampling(): void;
369
+ start(): void;
370
+ stop(options?: {
371
+ reason?: string;
372
+ forceflush?: boolean;
373
+ }): Promise<void>;
374
+ pause(): void;
375
+ resume(): void;
376
+ startRecording(): void;
377
+ stopRecording(): boolean;
378
+ sendBufferedReplayOrFlush(options?: SendBufferedReplayOptions): Promise<void>;
379
+ conditionalFlush(): Promise<void>;
380
+ flush(): Promise<void>;
381
+ flushImmediate(): Promise<void>;
382
+ cancelFlush(): void;
383
+ triggerUserActivity(): void;
384
+ updateUserActivity(): void;
385
+ addUpdate(cb: AddUpdateCallback): void;
386
+ getOptions(): ReplayPluginOptions;
387
+ getSessionId(): string | undefined;
388
+ checkAndHandleExpiredSession(): boolean | void;
389
+ setInitialState(): void;
390
+ getCurrentRoute(): string | undefined;
391
+ }
392
+ type RequestBody = null | Blob | BufferSource | FormData | URLSearchParams | string;
393
+ export type XhrHint = XhrBreadcrumbHint & {
394
+ xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;
395
+ input?: RequestBody;
396
+ };
397
+ export type FetchHint = FetchBreadcrumbHint & {
398
+ input: HandlerDataFetch['args'];
399
+ response: Response;
400
+ };
401
+ export type ReplayNetworkRequestData = {
402
+ startTimestamp: number;
403
+ endTimestamp: number;
404
+ url: string;
405
+ method?: string;
406
+ statusCode: number;
407
+ request?: ReplayNetworkRequestOrResponse;
408
+ response?: ReplayNetworkRequestOrResponse;
409
+ };
410
+ export interface SlowClickConfig {
411
+ threshold: number;
412
+ timeout: number;
413
+ scrollTimeout: number;
414
+ ignoreSelector: string;
415
+ }
416
+ export {};
417
+ //# sourceMappingURL=replay.d.ts.map