posthog-js 1.428.7 → 1.428.9
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.
- package/LICENSE +64 -0
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.d.ts +1 -0
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/exception-autocapture.js +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/lazy-recorder.js.map +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +1 -0
- package/dist/module.full.d.ts +1 -0
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +1 -0
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.d.ts +1 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.d.ts +1 -0
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.d.ts +577 -653
- package/dist/posthog-recorder.js +1 -1
- package/dist/posthog-recorder.js.map +1 -1
- package/dist/recorder.d.ts +577 -653
- package/dist/rrweb-plugin-console-record.d.ts +436 -500
- package/dist/rrweb-types.d.ts +688 -735
- package/dist/rrweb.d.ts +1303 -1433
- package/dist/src/entrypoints/rrweb-types.es.d.ts +9 -0
- package/dist/src/extensions/replay/types/rrweb-types.d.ts +1 -0
- package/lib/package.json +10 -4
- package/lib/src/entrypoints/rrweb-types.es.d.ts +9 -0
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js +12 -2
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -1
- package/lib/src/extensions/replay/types/rrweb-types.d.ts +1 -0
- package/lib/src/extensions/replay/types/rrweb-types.js.map +1 -1
- package/package.json +16 -10
package/dist/recorder.d.ts
CHANGED
|
@@ -1,663 +1,587 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
declare type RecordPlugin<TOptions = unknown> = {
|
|
393
|
-
name: string;
|
|
394
|
-
observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
|
|
395
|
-
eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
|
|
396
|
-
getMirror?: (mirrors: {
|
|
397
|
-
nodeMirror: IMirror<Node>;
|
|
398
|
-
crossOriginIframeMirror: ICrossOriginIframeMirror;
|
|
399
|
-
crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
|
|
400
|
-
}) => void;
|
|
401
|
-
options: TOptions;
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
declare type removedNodeMutation = {
|
|
405
|
-
parentId: number;
|
|
406
|
-
id: number;
|
|
407
|
-
isShadow?: boolean;
|
|
408
|
-
};
|
|
409
|
-
|
|
410
|
-
declare type SamplingStrategy = Partial<{
|
|
411
|
-
mousemove: boolean | number;
|
|
412
|
-
mousemoveCallback: number;
|
|
413
|
-
mouseInteraction: boolean | Record<string, boolean | undefined>;
|
|
414
|
-
scroll: number;
|
|
415
|
-
media: number;
|
|
416
|
-
input: 'all' | 'last';
|
|
417
|
-
canvas: 'all' | number;
|
|
418
|
-
}>;
|
|
419
|
-
|
|
420
|
-
declare type scrollCallback = (p: scrollPosition) => void;
|
|
421
|
-
|
|
422
|
-
declare type scrollData = {
|
|
423
|
-
source: IncrementalSource.Scroll;
|
|
424
|
-
} & scrollPosition;
|
|
425
|
-
|
|
426
|
-
declare type scrollPosition = {
|
|
427
|
-
id: number;
|
|
428
|
-
x: number;
|
|
429
|
-
y: number;
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
declare type selectionCallback = (p: selectionParam) => void;
|
|
433
|
-
|
|
434
|
-
declare type selectionData = {
|
|
435
|
-
source: IncrementalSource.Selection;
|
|
436
|
-
} & selectionParam;
|
|
437
|
-
|
|
438
|
-
declare type selectionParam = {
|
|
439
|
-
ranges: Array<SelectionRange>;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
declare type SelectionRange = {
|
|
443
|
-
start: number;
|
|
444
|
-
startOffset: number;
|
|
445
|
-
end: number;
|
|
446
|
-
endOffset: number;
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
declare type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
450
|
-
rootId?: number;
|
|
451
|
-
isShadowHost?: boolean;
|
|
452
|
-
isShadow?: boolean;
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
declare type serializedNodeWithId = serializedNode & {
|
|
456
|
-
id: number;
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
declare type styleDeclarationCallback = (s: styleDeclarationParam) => void;
|
|
460
|
-
|
|
461
|
-
declare type styleDeclarationData = {
|
|
462
|
-
source: IncrementalSource.StyleDeclaration;
|
|
463
|
-
} & styleDeclarationParam;
|
|
464
|
-
|
|
465
|
-
declare type styleDeclarationParam = {
|
|
466
|
-
id?: number;
|
|
467
|
-
styleId?: number;
|
|
468
|
-
index: number[];
|
|
469
|
-
set?: {
|
|
470
|
-
property: string;
|
|
471
|
-
value: string | null;
|
|
472
|
-
priority: string | undefined;
|
|
473
|
-
};
|
|
474
|
-
remove?: {
|
|
475
|
-
property: string;
|
|
476
|
-
};
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
declare type styleOMValue = {
|
|
480
|
-
[key: string]: styleValueWithPriority | string | false;
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
declare type styleSheetAddRule = {
|
|
484
|
-
rule: string;
|
|
485
|
-
index?: number | number[];
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
declare type styleSheetDeleteRule = {
|
|
489
|
-
index: number | number[];
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
declare type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
|
|
493
|
-
|
|
494
|
-
declare type styleSheetRuleData = {
|
|
495
|
-
source: IncrementalSource.StyleSheetRule;
|
|
496
|
-
} & styleSheetRuleParam;
|
|
497
|
-
|
|
498
|
-
declare type styleSheetRuleParam = {
|
|
499
|
-
id?: number;
|
|
500
|
-
styleId?: number;
|
|
501
|
-
removes?: styleSheetDeleteRule[];
|
|
502
|
-
adds?: styleSheetAddRule[];
|
|
503
|
-
replace?: string;
|
|
504
|
-
replaceSync?: string;
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
declare type styleValueWithPriority = [string, string];
|
|
508
|
-
|
|
509
|
-
declare type textMutation = {
|
|
510
|
-
id: number;
|
|
511
|
-
value: string | null;
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
declare type textNode = {
|
|
515
|
-
type: NodeType.Text;
|
|
516
|
-
textContent: string;
|
|
517
|
-
isStyle?: true;
|
|
518
|
-
};
|
|
519
|
-
|
|
520
|
-
declare type viewportResizeCallback = (d: viewportResizeDimension) => void;
|
|
521
|
-
|
|
522
|
-
declare type viewportResizeData = {
|
|
523
|
-
source: IncrementalSource.ViewportResize;
|
|
524
|
-
} & viewportResizeDimension;
|
|
525
|
-
|
|
526
|
-
declare type viewportResizeDimension = {
|
|
527
|
-
width: number;
|
|
528
|
-
height: number;
|
|
529
|
-
};
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare enum EventType {
|
|
3
|
+
DomContentLoaded = 0,
|
|
4
|
+
Load = 1,
|
|
5
|
+
FullSnapshot = 2,
|
|
6
|
+
IncrementalSnapshot = 3,
|
|
7
|
+
Meta = 4,
|
|
8
|
+
Custom = 5,
|
|
9
|
+
Plugin = 6
|
|
10
|
+
}
|
|
11
|
+
type domContentLoadedEvent = {
|
|
12
|
+
type: EventType.DomContentLoaded;
|
|
13
|
+
data: unknown;
|
|
14
|
+
};
|
|
15
|
+
type loadedEvent = {
|
|
16
|
+
type: EventType.Load;
|
|
17
|
+
data: unknown;
|
|
18
|
+
};
|
|
19
|
+
type fullSnapshotEvent = {
|
|
20
|
+
type: EventType.FullSnapshot;
|
|
21
|
+
data: {
|
|
22
|
+
node: serializedNodeWithId;
|
|
23
|
+
initialOffset: {
|
|
24
|
+
top: number;
|
|
25
|
+
left: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type incrementalSnapshotEvent = {
|
|
30
|
+
type: EventType.IncrementalSnapshot;
|
|
31
|
+
data: incrementalData;
|
|
32
|
+
};
|
|
33
|
+
type metaEvent = {
|
|
34
|
+
type: EventType.Meta;
|
|
35
|
+
data: {
|
|
36
|
+
href: string;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type customEvent<T = unknown> = {
|
|
42
|
+
type: EventType.Custom;
|
|
43
|
+
data: {
|
|
44
|
+
tag: string;
|
|
45
|
+
payload: T;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
type pluginEvent<T = unknown> = {
|
|
49
|
+
type: EventType.Plugin;
|
|
50
|
+
data: {
|
|
51
|
+
plugin: string;
|
|
52
|
+
payload: T;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
declare enum IncrementalSource {
|
|
56
|
+
Mutation = 0,
|
|
57
|
+
MouseMove = 1,
|
|
58
|
+
MouseInteraction = 2,
|
|
59
|
+
Scroll = 3,
|
|
60
|
+
ViewportResize = 4,
|
|
61
|
+
Input = 5,
|
|
62
|
+
TouchMove = 6,
|
|
63
|
+
MediaInteraction = 7,
|
|
64
|
+
StyleSheetRule = 8,
|
|
65
|
+
CanvasMutation = 9,
|
|
66
|
+
Font = 10,
|
|
67
|
+
Log = 11,
|
|
68
|
+
Drag = 12,
|
|
69
|
+
StyleDeclaration = 13,
|
|
70
|
+
Selection = 14,
|
|
71
|
+
AdoptedStyleSheet = 15,
|
|
72
|
+
CustomElement = 16
|
|
73
|
+
}
|
|
74
|
+
type mutationData = {
|
|
75
|
+
source: IncrementalSource.Mutation;
|
|
76
|
+
} & mutationCallbackParam;
|
|
77
|
+
type mousemoveData = {
|
|
78
|
+
source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
|
|
79
|
+
positions: mousePosition[];
|
|
80
|
+
};
|
|
81
|
+
type mouseInteractionData = {
|
|
82
|
+
source: IncrementalSource.MouseInteraction;
|
|
83
|
+
} & mouseInteractionParam;
|
|
84
|
+
type scrollData = {
|
|
85
|
+
source: IncrementalSource.Scroll;
|
|
86
|
+
} & scrollPosition;
|
|
87
|
+
type viewportResizeData = {
|
|
88
|
+
source: IncrementalSource.ViewportResize;
|
|
89
|
+
} & viewportResizeDimension;
|
|
90
|
+
type inputData = {
|
|
91
|
+
source: IncrementalSource.Input;
|
|
92
|
+
id: number;
|
|
93
|
+
} & inputValue;
|
|
94
|
+
type mediaInteractionData = {
|
|
95
|
+
source: IncrementalSource.MediaInteraction;
|
|
96
|
+
} & mediaInteractionParam;
|
|
97
|
+
type styleSheetRuleData = {
|
|
98
|
+
source: IncrementalSource.StyleSheetRule;
|
|
99
|
+
} & styleSheetRuleParam;
|
|
100
|
+
type styleDeclarationData = {
|
|
101
|
+
source: IncrementalSource.StyleDeclaration;
|
|
102
|
+
} & styleDeclarationParam;
|
|
103
|
+
type canvasMutationData = {
|
|
104
|
+
source: IncrementalSource.CanvasMutation;
|
|
105
|
+
} & canvasMutationParam;
|
|
106
|
+
type fontData = {
|
|
107
|
+
source: IncrementalSource.Font;
|
|
108
|
+
} & fontParam;
|
|
109
|
+
type selectionData = {
|
|
110
|
+
source: IncrementalSource.Selection;
|
|
111
|
+
} & selectionParam;
|
|
112
|
+
type adoptedStyleSheetData = {
|
|
113
|
+
source: IncrementalSource.AdoptedStyleSheet;
|
|
114
|
+
} & adoptedStyleSheetParam;
|
|
115
|
+
type customElementData = {
|
|
116
|
+
source: IncrementalSource.CustomElement;
|
|
117
|
+
} & customElementParam;
|
|
118
|
+
type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData;
|
|
119
|
+
type eventWithoutTime = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
|
|
120
|
+
type eventWithTime = eventWithoutTime & {
|
|
121
|
+
timestamp: number;
|
|
122
|
+
delay?: number;
|
|
123
|
+
};
|
|
124
|
+
type blockClass = string | RegExp;
|
|
125
|
+
type maskTextClass = string | RegExp;
|
|
126
|
+
type SamplingStrategy = Partial<{
|
|
127
|
+
/**
|
|
128
|
+
* false means not to record mouse/touch move events
|
|
129
|
+
* number is the throttle threshold of recording mouse/touch move
|
|
130
|
+
*/
|
|
131
|
+
mousemove: boolean | number;
|
|
132
|
+
/**
|
|
133
|
+
* number is the throttle threshold of mouse/touch move callback
|
|
134
|
+
*/
|
|
135
|
+
mousemoveCallback: number;
|
|
136
|
+
/**
|
|
137
|
+
* false means not to record mouse interaction events
|
|
138
|
+
* can also specify record some kinds of mouse interactions
|
|
139
|
+
*/
|
|
140
|
+
mouseInteraction: boolean | Record<string, boolean | undefined>;
|
|
141
|
+
/**
|
|
142
|
+
* number is the throttle threshold of recording scroll
|
|
143
|
+
*/
|
|
144
|
+
scroll: number;
|
|
145
|
+
/**
|
|
146
|
+
* number is the throttle threshold of recording media interactions
|
|
147
|
+
*/
|
|
148
|
+
media: number;
|
|
149
|
+
/**
|
|
150
|
+
* 'all' will record all the input events
|
|
151
|
+
* 'last' will only record the last input value while input a sequence of chars
|
|
152
|
+
*/
|
|
153
|
+
input: "all" | "last";
|
|
154
|
+
/**
|
|
155
|
+
* 'all' will record every single canvas call
|
|
156
|
+
* number between 1 and 60, will record an image snapshots in a web-worker a (maximum) number of times per second.
|
|
157
|
+
* Number only supported where [`OffscreenCanvas`](http://mdn.io/offscreencanvas) is supported.
|
|
158
|
+
*/
|
|
159
|
+
canvas: "all" | number;
|
|
160
|
+
}>;
|
|
161
|
+
interface ICrossOriginIframeMirror {
|
|
162
|
+
getId(iframe: HTMLIFrameElement, remoteId: number, parentToRemoteMap?: Map<number, number>, remoteToParentMap?: Map<number, number>): number;
|
|
163
|
+
getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];
|
|
164
|
+
getRemoteId(iframe: HTMLIFrameElement, parentId: number, map?: Map<number, number>): number;
|
|
165
|
+
getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];
|
|
166
|
+
reset(iframe?: HTMLIFrameElement): void;
|
|
167
|
+
}
|
|
168
|
+
type RecordPlugin<TOptions = unknown> = {
|
|
169
|
+
name: string;
|
|
170
|
+
observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
|
|
171
|
+
eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
|
|
172
|
+
getMirror?: (mirrors: {
|
|
173
|
+
nodeMirror: IMirror<Node>;
|
|
174
|
+
crossOriginIframeMirror: ICrossOriginIframeMirror;
|
|
175
|
+
crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
|
|
176
|
+
}) => void;
|
|
177
|
+
options: TOptions;
|
|
178
|
+
};
|
|
179
|
+
type hooksParam = {
|
|
180
|
+
mutation?: mutationCallBack;
|
|
181
|
+
mousemove?: mousemoveCallBack;
|
|
182
|
+
mouseInteraction?: mouseInteractionCallBack;
|
|
183
|
+
scroll?: scrollCallback;
|
|
184
|
+
viewportResize?: viewportResizeCallback;
|
|
185
|
+
input?: inputCallback;
|
|
186
|
+
mediaInteaction?: mediaInteractionCallback;
|
|
187
|
+
styleSheetRule?: styleSheetRuleCallback;
|
|
188
|
+
styleDeclaration?: styleDeclarationCallback;
|
|
189
|
+
canvasMutation?: canvasMutationCallback;
|
|
190
|
+
font?: fontCallback;
|
|
191
|
+
selection?: selectionCallback;
|
|
192
|
+
customElement?: customElementCallback;
|
|
193
|
+
};
|
|
194
|
+
type textMutation = {
|
|
195
|
+
id: number;
|
|
196
|
+
value: string | null;
|
|
197
|
+
};
|
|
198
|
+
type styleOMValue = {
|
|
199
|
+
[key: string]: styleValueWithPriority | string | false;
|
|
200
|
+
};
|
|
201
|
+
type styleValueWithPriority = [string, string];
|
|
202
|
+
type attributeMutation = {
|
|
203
|
+
id: number;
|
|
204
|
+
attributes: {
|
|
205
|
+
[key: string]: string | styleOMValue | null;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
type removedNodeMutation = {
|
|
209
|
+
parentId: number;
|
|
210
|
+
id: number;
|
|
211
|
+
isShadow?: boolean;
|
|
212
|
+
};
|
|
213
|
+
type addedNodeMutation = {
|
|
214
|
+
parentId: number;
|
|
215
|
+
previousId?: number | null;
|
|
216
|
+
nextId: number | null;
|
|
217
|
+
node: serializedNodeWithId;
|
|
218
|
+
};
|
|
219
|
+
type mutationCallbackParam = {
|
|
220
|
+
texts: textMutation[];
|
|
221
|
+
attributes: attributeMutation[];
|
|
222
|
+
removes: removedNodeMutation[];
|
|
223
|
+
adds: addedNodeMutation[];
|
|
224
|
+
isAttachIframe?: true;
|
|
225
|
+
};
|
|
226
|
+
type mutationCallBack = (m: mutationCallbackParam) => void;
|
|
227
|
+
type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag) => void;
|
|
228
|
+
type mousePosition = {
|
|
229
|
+
x: number;
|
|
230
|
+
y: number;
|
|
231
|
+
id: number;
|
|
232
|
+
timeOffset: number;
|
|
233
|
+
};
|
|
234
|
+
declare enum MouseInteractions {
|
|
235
|
+
MouseUp = 0,
|
|
236
|
+
MouseDown = 1,
|
|
237
|
+
Click = 2,
|
|
238
|
+
ContextMenu = 3,
|
|
239
|
+
DblClick = 4,
|
|
240
|
+
Focus = 5,
|
|
241
|
+
Blur = 6,
|
|
242
|
+
TouchStart = 7,
|
|
243
|
+
TouchMove_Departed = 8,
|
|
244
|
+
TouchEnd = 9,
|
|
245
|
+
TouchCancel = 10
|
|
246
|
+
}
|
|
247
|
+
declare enum PointerTypes {
|
|
248
|
+
Mouse = 0,
|
|
249
|
+
Pen = 1,
|
|
250
|
+
Touch = 2
|
|
251
|
+
}
|
|
252
|
+
declare enum CanvasContext {
|
|
253
|
+
"2D" = 0,
|
|
254
|
+
WebGL = 1,
|
|
255
|
+
WebGL2 = 2
|
|
256
|
+
}
|
|
257
|
+
type mouseInteractionParam = {
|
|
258
|
+
type: MouseInteractions;
|
|
259
|
+
id: number;
|
|
260
|
+
x?: number;
|
|
261
|
+
y?: number;
|
|
262
|
+
pointerType?: PointerTypes;
|
|
263
|
+
};
|
|
264
|
+
type mouseInteractionCallBack = (d: mouseInteractionParam) => void;
|
|
265
|
+
type scrollPosition = {
|
|
266
|
+
id: number;
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
};
|
|
270
|
+
type scrollCallback = (p: scrollPosition) => void;
|
|
271
|
+
type styleSheetAddRule = {
|
|
272
|
+
rule: string;
|
|
273
|
+
index?: number | number[];
|
|
274
|
+
};
|
|
275
|
+
type styleSheetDeleteRule = {
|
|
276
|
+
index: number | number[];
|
|
277
|
+
};
|
|
278
|
+
type styleSheetRuleParam = {
|
|
279
|
+
id?: number;
|
|
280
|
+
styleId?: number;
|
|
281
|
+
removes?: styleSheetDeleteRule[];
|
|
282
|
+
adds?: styleSheetAddRule[];
|
|
283
|
+
replace?: string;
|
|
284
|
+
replaceSync?: string;
|
|
285
|
+
};
|
|
286
|
+
type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
|
|
287
|
+
type adoptedStyleSheetParam = {
|
|
288
|
+
id: number;
|
|
289
|
+
styles?: {
|
|
290
|
+
styleId: number;
|
|
291
|
+
rules: styleSheetAddRule[];
|
|
292
|
+
}[];
|
|
293
|
+
styleIds: number[];
|
|
294
|
+
};
|
|
295
|
+
type styleDeclarationParam = {
|
|
296
|
+
id?: number;
|
|
297
|
+
styleId?: number;
|
|
298
|
+
index: number[];
|
|
299
|
+
set?: {
|
|
300
|
+
property: string;
|
|
301
|
+
value: string | null;
|
|
302
|
+
priority: string | undefined;
|
|
303
|
+
};
|
|
304
|
+
remove?: {
|
|
305
|
+
property: string;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
type styleDeclarationCallback = (s: styleDeclarationParam) => void;
|
|
309
|
+
type canvasMutationCommand = {
|
|
310
|
+
property: string;
|
|
311
|
+
args: Array<unknown>;
|
|
312
|
+
setter?: true;
|
|
313
|
+
};
|
|
314
|
+
type canvasMutationParam = {
|
|
315
|
+
id: number;
|
|
316
|
+
type: CanvasContext;
|
|
317
|
+
commands: canvasMutationCommand[];
|
|
318
|
+
displayWidth?: number;
|
|
319
|
+
displayHeight?: number;
|
|
320
|
+
} | ({
|
|
321
|
+
id: number;
|
|
322
|
+
type: CanvasContext;
|
|
323
|
+
displayWidth?: number;
|
|
324
|
+
displayHeight?: number;
|
|
325
|
+
} & canvasMutationCommand);
|
|
326
|
+
type canvasMutationCallback = (p: canvasMutationParam) => void;
|
|
327
|
+
type CanvasMaskRegion = {
|
|
328
|
+
x: number;
|
|
329
|
+
y: number;
|
|
330
|
+
width: number;
|
|
331
|
+
height: number;
|
|
332
|
+
};
|
|
333
|
+
type CanvasMasking = {
|
|
334
|
+
regionsFn?: (canvas: HTMLCanvasElement) => CanvasMaskRegion[] | null | undefined;
|
|
335
|
+
configured?: () => boolean;
|
|
336
|
+
};
|
|
337
|
+
type fontParam = {
|
|
338
|
+
family: string;
|
|
339
|
+
fontSource: string;
|
|
340
|
+
buffer: boolean;
|
|
341
|
+
descriptors?: FontFaceDescriptors;
|
|
342
|
+
};
|
|
343
|
+
type fontCallback = (p: fontParam) => void;
|
|
344
|
+
type viewportResizeDimension = {
|
|
345
|
+
width: number;
|
|
346
|
+
height: number;
|
|
347
|
+
};
|
|
348
|
+
type viewportResizeCallback = (d: viewportResizeDimension) => void;
|
|
349
|
+
type inputValue = {
|
|
350
|
+
text: string;
|
|
351
|
+
isChecked: boolean;
|
|
352
|
+
userTriggered?: boolean;
|
|
353
|
+
};
|
|
354
|
+
type inputCallback = (v: inputValue & {
|
|
355
|
+
id: number;
|
|
356
|
+
}) => void;
|
|
357
|
+
declare enum MediaInteractions {
|
|
358
|
+
Play = 0,
|
|
359
|
+
Pause = 1,
|
|
360
|
+
Seeked = 2,
|
|
361
|
+
VolumeChange = 3,
|
|
362
|
+
RateChange = 4
|
|
363
|
+
}
|
|
364
|
+
type mediaInteractionParam = {
|
|
365
|
+
type: MediaInteractions;
|
|
366
|
+
id: number;
|
|
367
|
+
currentTime?: number;
|
|
368
|
+
volume?: number;
|
|
369
|
+
muted?: boolean;
|
|
370
|
+
loop?: boolean;
|
|
371
|
+
playbackRate?: number;
|
|
372
|
+
};
|
|
373
|
+
type mediaInteractionCallback = (p: mediaInteractionParam) => void;
|
|
374
|
+
type SelectionRange = {
|
|
375
|
+
start: number;
|
|
376
|
+
startOffset: number;
|
|
377
|
+
end: number;
|
|
378
|
+
endOffset: number;
|
|
379
|
+
};
|
|
380
|
+
type selectionParam = {
|
|
381
|
+
ranges: Array<SelectionRange>;
|
|
382
|
+
};
|
|
383
|
+
type selectionCallback = (p: selectionParam) => void;
|
|
384
|
+
type customElementParam = {
|
|
385
|
+
define?: {
|
|
386
|
+
name: string;
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
type customElementCallback = (c: customElementParam) => void;
|
|
390
|
+
type listenerHandler = () => void;
|
|
391
|
+
type KeepIframeSrcFn = (src: string) => boolean;
|
|
533
392
|
declare global {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
393
|
+
interface Window {
|
|
394
|
+
FontFace: typeof FontFace;
|
|
395
|
+
}
|
|
537
396
|
}
|
|
538
|
-
|
|
539
|
-
declare
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
397
|
+
type IWindow = Window & typeof globalThis;
|
|
398
|
+
declare enum NodeType {
|
|
399
|
+
Document = 0,
|
|
400
|
+
DocumentType = 1,
|
|
401
|
+
Element = 2,
|
|
402
|
+
Text = 3,
|
|
403
|
+
CDATA = 4,
|
|
404
|
+
Comment = 5
|
|
405
|
+
}
|
|
406
|
+
type documentNode = {
|
|
407
|
+
type: NodeType.Document;
|
|
408
|
+
childNodes: serializedNodeWithId[];
|
|
409
|
+
compatMode?: string;
|
|
410
|
+
};
|
|
411
|
+
type documentTypeNode = {
|
|
412
|
+
type: NodeType.DocumentType;
|
|
413
|
+
name: string;
|
|
414
|
+
publicId: string;
|
|
415
|
+
systemId: string;
|
|
416
|
+
};
|
|
417
|
+
type cssTextKeyAttr = {
|
|
418
|
+
_cssText?: string;
|
|
419
|
+
};
|
|
420
|
+
type attributes = cssTextKeyAttr & {
|
|
421
|
+
[key: string]: string | number | true | null;
|
|
422
|
+
};
|
|
423
|
+
type elementNode = {
|
|
424
|
+
type: NodeType.Element;
|
|
425
|
+
tagName: string;
|
|
426
|
+
attributes: attributes;
|
|
427
|
+
childNodes: serializedNodeWithId[];
|
|
428
|
+
isSVG?: true;
|
|
429
|
+
needBlock?: boolean;
|
|
430
|
+
isCustom?: true;
|
|
431
|
+
};
|
|
432
|
+
type textNode = {
|
|
433
|
+
type: NodeType.Text;
|
|
434
|
+
textContent: string;
|
|
435
|
+
/**
|
|
436
|
+
* @deprecated styles are now always snapshotted against parent <style> element
|
|
437
|
+
* style mutations can still happen via an added textNode, but they don't need this attribute for correct replay
|
|
438
|
+
*/
|
|
439
|
+
isStyle?: true;
|
|
440
|
+
};
|
|
441
|
+
type cdataNode = {
|
|
442
|
+
type: NodeType.CDATA;
|
|
443
|
+
textContent: "";
|
|
444
|
+
};
|
|
445
|
+
type commentNode = {
|
|
446
|
+
type: NodeType.Comment;
|
|
447
|
+
textContent: string;
|
|
448
|
+
};
|
|
449
|
+
type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
450
|
+
rootId?: number;
|
|
451
|
+
isShadowHost?: boolean;
|
|
452
|
+
isShadow?: boolean;
|
|
453
|
+
};
|
|
454
|
+
type serializedNodeWithId = serializedNode & {
|
|
455
|
+
id: number;
|
|
456
|
+
};
|
|
457
|
+
interface IMirror<TNode> {
|
|
458
|
+
getId(n: TNode | undefined | null): number;
|
|
459
|
+
getNode(id: number): TNode | null;
|
|
460
|
+
getIds(): number[];
|
|
461
|
+
getMeta(n: TNode): serializedNodeWithId | null;
|
|
462
|
+
removeNodeFromMap(n: TNode): void;
|
|
463
|
+
has(id: number): boolean;
|
|
464
|
+
hasNode(node: TNode): boolean;
|
|
465
|
+
add(n: TNode, meta: serializedNodeWithId): void;
|
|
466
|
+
replace(id: number, n: TNode): void;
|
|
467
|
+
reset(): void;
|
|
468
|
+
}
|
|
469
|
+
type DataURLOptions = Partial<{
|
|
470
|
+
type: string;
|
|
471
|
+
quality: number;
|
|
472
|
+
maxBase64ImageLength: number;
|
|
591
473
|
}>;
|
|
474
|
+
type PackFn = (event: eventWithTime) => string;
|
|
592
475
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
var takeFullSnapshot: (isCheckout?: boolean) => void;
|
|
644
|
-
var mirror: Mirror;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
declare namespace record {
|
|
649
|
-
var addCustomEvent: <T>(tag: string, payload: T) => void;
|
|
650
|
-
var freezePage: () => void;
|
|
651
|
-
var takeFullSnapshot: (isCheckout?: boolean) => void;
|
|
652
|
-
var mirror: Mirror;
|
|
476
|
+
type MaskInputOptions = Partial<{
|
|
477
|
+
color: boolean;
|
|
478
|
+
date: boolean;
|
|
479
|
+
"datetime-local": boolean;
|
|
480
|
+
email: boolean;
|
|
481
|
+
month: boolean;
|
|
482
|
+
number: boolean;
|
|
483
|
+
range: boolean;
|
|
484
|
+
search: boolean;
|
|
485
|
+
tel: boolean;
|
|
486
|
+
text: boolean;
|
|
487
|
+
time: boolean;
|
|
488
|
+
url: boolean;
|
|
489
|
+
week: boolean;
|
|
490
|
+
textarea: boolean;
|
|
491
|
+
select: boolean;
|
|
492
|
+
password: boolean;
|
|
493
|
+
}>;
|
|
494
|
+
type SlimDOMOptions = Partial<{
|
|
495
|
+
script: boolean;
|
|
496
|
+
comment: boolean;
|
|
497
|
+
headFavicon: boolean;
|
|
498
|
+
headWhitespace: boolean;
|
|
499
|
+
headMetaDescKeywords: boolean;
|
|
500
|
+
headMetaSocial: boolean;
|
|
501
|
+
headMetaRobots: boolean;
|
|
502
|
+
headMetaHttpEquiv: boolean;
|
|
503
|
+
headMetaAuthorship: boolean;
|
|
504
|
+
headMetaVerification: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* blocks title tag 'animations' which can generate a lot of mutations that aren't usually displayed in replayers
|
|
507
|
+
**/
|
|
508
|
+
headTitleMutations: boolean;
|
|
509
|
+
}>;
|
|
510
|
+
type MaskTextFn = (text: string, element: HTMLElement | null) => string;
|
|
511
|
+
type MaskInputFn = (text: string, element: HTMLElement) => string;
|
|
512
|
+
type MaskAttributeFn = (name: string, value: string, element: Element) => string;
|
|
513
|
+
declare class Mirror implements IMirror<Node> {
|
|
514
|
+
private idNodeMap;
|
|
515
|
+
private nodeMetaMap;
|
|
516
|
+
getId(n: Node | undefined | null): number;
|
|
517
|
+
getNode(id: number): Node | null;
|
|
518
|
+
getIds(): number[];
|
|
519
|
+
getMeta(n: Node): serializedNodeWithId | null;
|
|
520
|
+
removeNodeFromMap(n: Node): void;
|
|
521
|
+
has(id: number): boolean;
|
|
522
|
+
hasNode(node: Node): boolean;
|
|
523
|
+
add(n: Node, meta: serializedNodeWithId): void;
|
|
524
|
+
replace(id: number, n: Node): void;
|
|
525
|
+
reset(): void;
|
|
653
526
|
}
|
|
654
527
|
|
|
655
|
-
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/types.d.ts
|
|
530
|
+
type recordOptions<T> = {
|
|
531
|
+
emit?: (e: T, isCheckout?: boolean) => void;
|
|
532
|
+
checkoutEveryNth?: number;
|
|
533
|
+
checkoutEveryNms?: number;
|
|
534
|
+
blockClass?: blockClass;
|
|
535
|
+
blockSelector?: string;
|
|
536
|
+
ignoreClass?: string;
|
|
537
|
+
ignoreSelector?: string;
|
|
538
|
+
maskTextClass?: maskTextClass;
|
|
539
|
+
maskTextSelector?: string;
|
|
540
|
+
maskAllInputs?: boolean;
|
|
541
|
+
maskInputOptions?: MaskInputOptions;
|
|
542
|
+
maskInputFn?: MaskInputFn;
|
|
543
|
+
maskTextFn?: MaskTextFn;
|
|
544
|
+
maskAllElementAttributes?: boolean;
|
|
545
|
+
maskAttributeFn?: MaskAttributeFn;
|
|
546
|
+
slimDOMOptions?: SlimDOMOptions | 'all' | true;
|
|
547
|
+
ignoreCSSAttributes?: Set<string>;
|
|
548
|
+
attributeFilter?: string[];
|
|
549
|
+
inlineStylesheet?: boolean;
|
|
550
|
+
inlineStylesheetBudgetRules?: number;
|
|
551
|
+
hooks?: hooksParam;
|
|
552
|
+
packFn?: PackFn;
|
|
553
|
+
sampling?: SamplingStrategy;
|
|
554
|
+
dataURLOptions?: DataURLOptions;
|
|
555
|
+
canvasResolutionScale?: number;
|
|
556
|
+
canvasMasking?: CanvasMasking;
|
|
557
|
+
recordDOM?: boolean;
|
|
558
|
+
recordCanvas?: boolean;
|
|
559
|
+
recordCrossOriginIframes?: boolean;
|
|
560
|
+
recordAfter?: 'DOMContentLoaded' | 'load';
|
|
561
|
+
userTriggeredOnInput?: boolean;
|
|
562
|
+
collectFonts?: boolean;
|
|
563
|
+
inlineImages?: boolean;
|
|
564
|
+
plugins?: RecordPlugin[];
|
|
565
|
+
mousemoveWait?: number;
|
|
566
|
+
keepIframeSrcFn?: KeepIframeSrcFn;
|
|
567
|
+
errorHandler?: ErrorHandler;
|
|
568
|
+
};
|
|
656
569
|
declare global {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
570
|
+
interface Window {
|
|
571
|
+
FontFace: typeof FontFace;
|
|
572
|
+
Array: typeof Array;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
type ErrorHandlerContext = 'rrweb' | 'host';
|
|
576
|
+
type ErrorHandler = (error: unknown, context?: ErrorHandlerContext) => void | boolean;
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/record/index.d.ts
|
|
579
|
+
declare function record<T = eventWithTime>(options?: recordOptions<T>): listenerHandler | undefined;
|
|
580
|
+
declare namespace record {
|
|
581
|
+
var addCustomEvent: <T>(tag: string, payload: T) => void;
|
|
582
|
+
var freezePage: () => void;
|
|
583
|
+
var takeFullSnapshot: (isCheckout?: boolean) => void;
|
|
584
|
+
var mirror: Mirror;
|
|
661
585
|
}
|
|
662
586
|
|
|
663
587
|
export { record as default };
|