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/rrweb-types.d.ts
CHANGED
|
@@ -1,738 +1,691 @@
|
|
|
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
|
-
declare
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
declare
|
|
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
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
id: number;
|
|
547
|
-
isShadow?: boolean;
|
|
548
|
-
};
|
|
549
|
-
|
|
550
|
-
declare enum ReplayerEvents {
|
|
551
|
-
Start = "start",
|
|
552
|
-
Pause = "pause",
|
|
553
|
-
Resume = "resume",
|
|
554
|
-
Resize = "resize",
|
|
555
|
-
Finish = "finish",
|
|
556
|
-
FullsnapshotRebuilded = "fullsnapshot-rebuilded",
|
|
557
|
-
LoadStylesheetStart = "load-stylesheet-start",
|
|
558
|
-
LoadStylesheetEnd = "load-stylesheet-end",
|
|
559
|
-
SkipStart = "skip-start",
|
|
560
|
-
SkipEnd = "skip-end",
|
|
561
|
-
MouseInteraction = "mouse-interaction",
|
|
562
|
-
EventCast = "event-cast",
|
|
563
|
-
CustomEvent = "custom-event",
|
|
564
|
-
Flush = "flush",
|
|
565
|
-
StateChange = "state-change",
|
|
566
|
-
PlayBack = "play-back",
|
|
567
|
-
Destroy = "destroy"
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
declare type SamplingStrategy = Partial<{
|
|
571
|
-
mousemove: boolean | number;
|
|
572
|
-
mousemoveCallback: number;
|
|
573
|
-
mouseInteraction: boolean | Record<string, boolean | undefined>;
|
|
574
|
-
scroll: number;
|
|
575
|
-
media: number;
|
|
576
|
-
input: 'all' | 'last';
|
|
577
|
-
canvas: 'all' | number;
|
|
578
|
-
}>;
|
|
579
|
-
|
|
580
|
-
declare type scrollCallback = (p: scrollPosition) => void;
|
|
581
|
-
|
|
582
|
-
declare type scrollData = {
|
|
583
|
-
source: IncrementalSource.Scroll;
|
|
584
|
-
} & scrollPosition;
|
|
585
|
-
|
|
586
|
-
declare type scrollPosition = {
|
|
587
|
-
id: number;
|
|
588
|
-
x: number;
|
|
589
|
-
y: number;
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
declare type selectionCallback = (p: selectionParam) => void;
|
|
593
|
-
|
|
594
|
-
declare type selectionData = {
|
|
595
|
-
source: IncrementalSource.Selection;
|
|
596
|
-
} & selectionParam;
|
|
597
|
-
|
|
598
|
-
declare type selectionParam = {
|
|
599
|
-
ranges: Array<SelectionRange>;
|
|
600
|
-
};
|
|
601
|
-
|
|
602
|
-
declare type SelectionRange = {
|
|
603
|
-
start: number;
|
|
604
|
-
startOffset: number;
|
|
605
|
-
end: number;
|
|
606
|
-
endOffset: number;
|
|
607
|
-
};
|
|
608
|
-
|
|
609
|
-
declare type SerializedCanvasArg = {
|
|
610
|
-
rr_type: 'ArrayBuffer';
|
|
611
|
-
base64: string;
|
|
612
|
-
} | {
|
|
613
|
-
rr_type: 'Blob';
|
|
614
|
-
data: Array<CanvasArg>;
|
|
615
|
-
type?: string;
|
|
616
|
-
} | {
|
|
617
|
-
rr_type: string;
|
|
618
|
-
src: string;
|
|
619
|
-
} | {
|
|
620
|
-
rr_type: string;
|
|
621
|
-
args: Array<CanvasArg>;
|
|
622
|
-
} | {
|
|
623
|
-
rr_type: string;
|
|
624
|
-
index: number;
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
declare type serializedElementNodeWithId = Extract<serializedNodeWithId, Record<'type', NodeType.Element>>;
|
|
628
|
-
|
|
629
|
-
declare type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
630
|
-
rootId?: number;
|
|
631
|
-
isShadowHost?: boolean;
|
|
632
|
-
isShadow?: boolean;
|
|
633
|
-
};
|
|
634
|
-
|
|
635
|
-
declare type serializedNodeWithId = serializedNode & {
|
|
636
|
-
id: number;
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
declare type styleDeclarationCallback = (s: styleDeclarationParam) => void;
|
|
640
|
-
|
|
641
|
-
declare type styleDeclarationData = {
|
|
642
|
-
source: IncrementalSource.StyleDeclaration;
|
|
643
|
-
} & styleDeclarationParam;
|
|
644
|
-
|
|
645
|
-
declare type styleDeclarationParam = {
|
|
646
|
-
id?: number;
|
|
647
|
-
styleId?: number;
|
|
648
|
-
index: number[];
|
|
649
|
-
set?: {
|
|
650
|
-
property: string;
|
|
651
|
-
value: string | null;
|
|
652
|
-
priority: string | undefined;
|
|
653
|
-
};
|
|
654
|
-
remove?: {
|
|
655
|
-
property: string;
|
|
656
|
-
};
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
declare type styleOMValue = {
|
|
660
|
-
[key: string]: styleValueWithPriority | string | false;
|
|
661
|
-
};
|
|
662
|
-
|
|
663
|
-
declare type styleSheetAddRule = {
|
|
664
|
-
rule: string;
|
|
665
|
-
index?: number | number[];
|
|
666
|
-
};
|
|
667
|
-
|
|
668
|
-
declare type styleSheetDeleteRule = {
|
|
669
|
-
index: number | number[];
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
declare type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
|
|
673
|
-
|
|
674
|
-
declare type styleSheetRuleData = {
|
|
675
|
-
source: IncrementalSource.StyleSheetRule;
|
|
676
|
-
} & styleSheetRuleParam;
|
|
677
|
-
|
|
678
|
-
declare type styleSheetRuleParam = {
|
|
679
|
-
id?: number;
|
|
680
|
-
styleId?: number;
|
|
681
|
-
removes?: styleSheetDeleteRule[];
|
|
682
|
-
adds?: styleSheetAddRule[];
|
|
683
|
-
replace?: string;
|
|
684
|
-
replaceSync?: string;
|
|
685
|
-
};
|
|
686
|
-
|
|
687
|
-
declare type styleValueWithPriority = [string, string];
|
|
688
|
-
|
|
689
|
-
declare type TakeTypedKeyValues<Obj extends object, Type> = Pick<Obj, TakeTypeHelper<Obj, Type>[keyof TakeTypeHelper<Obj, Type>]>;
|
|
690
|
-
|
|
691
|
-
declare type TakeTypeHelper<Obj extends object, ValueType> = {
|
|
692
|
-
[K in keyof Obj]: Obj[K] extends ValueType ? K : never;
|
|
693
|
-
};
|
|
694
|
-
|
|
695
|
-
declare type textCursor = {
|
|
696
|
-
node: Node;
|
|
697
|
-
value: string | null;
|
|
698
|
-
};
|
|
699
|
-
|
|
700
|
-
declare type textMutation = {
|
|
701
|
-
id: number;
|
|
702
|
-
value: string | null;
|
|
703
|
-
};
|
|
704
|
-
|
|
705
|
-
declare type textNode = {
|
|
706
|
-
type: NodeType.Text;
|
|
707
|
-
textContent: string;
|
|
708
|
-
isStyle?: true;
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
declare type throttleOptions = {
|
|
712
|
-
leading?: boolean;
|
|
713
|
-
trailing?: boolean;
|
|
714
|
-
};
|
|
715
|
-
|
|
716
|
-
declare type UnpackFn = (raw: string) => eventWithTime;
|
|
717
|
-
|
|
718
|
-
declare type viewportResizeCallback = (d: viewportResizeDimension) => void;
|
|
719
|
-
|
|
720
|
-
declare type viewportResizeData = {
|
|
721
|
-
source: IncrementalSource.ViewportResize;
|
|
722
|
-
} & viewportResizeDimension;
|
|
723
|
-
|
|
724
|
-
declare type viewportResizeDimension = {
|
|
725
|
-
width: number;
|
|
726
|
-
height: number;
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
declare enum EventType$1 {
|
|
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$1.DomContentLoaded;
|
|
13
|
+
data: unknown;
|
|
14
|
+
};
|
|
15
|
+
type loadedEvent = {
|
|
16
|
+
type: EventType$1.Load;
|
|
17
|
+
data: unknown;
|
|
18
|
+
};
|
|
19
|
+
type fullSnapshotEvent = {
|
|
20
|
+
type: EventType$1.FullSnapshot;
|
|
21
|
+
data: {
|
|
22
|
+
node: serializedNodeWithId;
|
|
23
|
+
initialOffset: {
|
|
24
|
+
top: number;
|
|
25
|
+
left: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
type incrementalSnapshotEvent = {
|
|
30
|
+
type: EventType$1.IncrementalSnapshot;
|
|
31
|
+
data: incrementalData;
|
|
32
|
+
};
|
|
33
|
+
type metaEvent = {
|
|
34
|
+
type: EventType$1.Meta;
|
|
35
|
+
data: {
|
|
36
|
+
href: string;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type customEvent$2<T = unknown> = {
|
|
42
|
+
type: EventType$1.Custom;
|
|
43
|
+
data: {
|
|
44
|
+
tag: string;
|
|
45
|
+
payload: T;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Reserved custom-event tag emitted by the recorder when an element enters or
|
|
50
|
+
* exits the native Fullscreen API. Native fullscreen is rendered by the UA
|
|
51
|
+
* `:fullscreen` pseudo-class with no DOM mutation, so rrweb captures nothing —
|
|
52
|
+
* this event lets the replayer re-apply fullscreen layout on playback.
|
|
53
|
+
*/
|
|
54
|
+
declare const FullscreenCustomEventTag = "rrweb/fullscreen";
|
|
55
|
+
type fullscreenEventPayload = {
|
|
56
|
+
/** mirror id of the element that went fullscreen */
|
|
57
|
+
id: number;
|
|
58
|
+
enter: boolean;
|
|
59
|
+
};
|
|
60
|
+
type pluginEvent<T = unknown> = {
|
|
61
|
+
type: EventType$1.Plugin;
|
|
62
|
+
data: {
|
|
63
|
+
plugin: string;
|
|
64
|
+
payload: T;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
declare enum IncrementalSource {
|
|
68
|
+
Mutation = 0,
|
|
69
|
+
MouseMove = 1,
|
|
70
|
+
MouseInteraction = 2,
|
|
71
|
+
Scroll = 3,
|
|
72
|
+
ViewportResize = 4,
|
|
73
|
+
Input = 5,
|
|
74
|
+
TouchMove = 6,
|
|
75
|
+
MediaInteraction = 7,
|
|
76
|
+
StyleSheetRule = 8,
|
|
77
|
+
CanvasMutation = 9,
|
|
78
|
+
Font = 10,
|
|
79
|
+
Log = 11,
|
|
80
|
+
Drag = 12,
|
|
81
|
+
StyleDeclaration = 13,
|
|
82
|
+
Selection = 14,
|
|
83
|
+
AdoptedStyleSheet = 15,
|
|
84
|
+
CustomElement = 16
|
|
85
|
+
}
|
|
86
|
+
type mutationData = {
|
|
87
|
+
source: IncrementalSource.Mutation;
|
|
88
|
+
} & mutationCallbackParam;
|
|
89
|
+
type mousemoveData = {
|
|
90
|
+
source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
|
|
91
|
+
positions: mousePosition[];
|
|
92
|
+
};
|
|
93
|
+
type mouseInteractionData = {
|
|
94
|
+
source: IncrementalSource.MouseInteraction;
|
|
95
|
+
} & mouseInteractionParam;
|
|
96
|
+
type scrollData = {
|
|
97
|
+
source: IncrementalSource.Scroll;
|
|
98
|
+
} & scrollPosition;
|
|
99
|
+
type viewportResizeData = {
|
|
100
|
+
source: IncrementalSource.ViewportResize;
|
|
101
|
+
} & viewportResizeDimension;
|
|
102
|
+
type inputData = {
|
|
103
|
+
source: IncrementalSource.Input;
|
|
104
|
+
id: number;
|
|
105
|
+
} & inputValue;
|
|
106
|
+
type mediaInteractionData = {
|
|
107
|
+
source: IncrementalSource.MediaInteraction;
|
|
108
|
+
} & mediaInteractionParam;
|
|
109
|
+
type styleSheetRuleData = {
|
|
110
|
+
source: IncrementalSource.StyleSheetRule;
|
|
111
|
+
} & styleSheetRuleParam;
|
|
112
|
+
type styleDeclarationData = {
|
|
113
|
+
source: IncrementalSource.StyleDeclaration;
|
|
114
|
+
} & styleDeclarationParam;
|
|
115
|
+
type canvasMutationData = {
|
|
116
|
+
source: IncrementalSource.CanvasMutation;
|
|
117
|
+
} & canvasMutationParam;
|
|
118
|
+
type fontData = {
|
|
119
|
+
source: IncrementalSource.Font;
|
|
120
|
+
} & fontParam;
|
|
121
|
+
type selectionData = {
|
|
122
|
+
source: IncrementalSource.Selection;
|
|
123
|
+
} & selectionParam;
|
|
124
|
+
type adoptedStyleSheetData = {
|
|
125
|
+
source: IncrementalSource.AdoptedStyleSheet;
|
|
126
|
+
} & adoptedStyleSheetParam;
|
|
127
|
+
type customElementData = {
|
|
128
|
+
source: IncrementalSource.CustomElement;
|
|
129
|
+
} & customElementParam;
|
|
130
|
+
type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData;
|
|
131
|
+
type eventWithoutTime$1 = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent$2 | pluginEvent;
|
|
132
|
+
type eventWithTime$1 = eventWithoutTime$1 & {
|
|
133
|
+
timestamp: number;
|
|
134
|
+
delay?: number;
|
|
135
|
+
};
|
|
136
|
+
type canvasEventWithTime = eventWithTime$1 & {
|
|
137
|
+
type: EventType$1.IncrementalSnapshot;
|
|
138
|
+
data: canvasMutationData;
|
|
139
|
+
};
|
|
140
|
+
type blockClass = string | RegExp;
|
|
141
|
+
type maskTextClass = string | RegExp;
|
|
142
|
+
type SamplingStrategy = Partial<{
|
|
143
|
+
/**
|
|
144
|
+
* false means not to record mouse/touch move events
|
|
145
|
+
* number is the throttle threshold of recording mouse/touch move
|
|
146
|
+
*/
|
|
147
|
+
mousemove: boolean | number;
|
|
148
|
+
/**
|
|
149
|
+
* number is the throttle threshold of mouse/touch move callback
|
|
150
|
+
*/
|
|
151
|
+
mousemoveCallback: number;
|
|
152
|
+
/**
|
|
153
|
+
* false means not to record mouse interaction events
|
|
154
|
+
* can also specify record some kinds of mouse interactions
|
|
155
|
+
*/
|
|
156
|
+
mouseInteraction: boolean | Record<string, boolean | undefined>;
|
|
157
|
+
/**
|
|
158
|
+
* number is the throttle threshold of recording scroll
|
|
159
|
+
*/
|
|
160
|
+
scroll: number;
|
|
161
|
+
/**
|
|
162
|
+
* number is the throttle threshold of recording media interactions
|
|
163
|
+
*/
|
|
164
|
+
media: number;
|
|
165
|
+
/**
|
|
166
|
+
* 'all' will record all the input events
|
|
167
|
+
* 'last' will only record the last input value while input a sequence of chars
|
|
168
|
+
*/
|
|
169
|
+
input: "all" | "last";
|
|
170
|
+
/**
|
|
171
|
+
* 'all' will record every single canvas call
|
|
172
|
+
* number between 1 and 60, will record an image snapshots in a web-worker a (maximum) number of times per second.
|
|
173
|
+
* Number only supported where [`OffscreenCanvas`](http://mdn.io/offscreencanvas) is supported.
|
|
174
|
+
*/
|
|
175
|
+
canvas: "all" | number;
|
|
176
|
+
}>;
|
|
177
|
+
interface ICrossOriginIframeMirror {
|
|
178
|
+
getId(iframe: HTMLIFrameElement, remoteId: number, parentToRemoteMap?: Map<number, number>, remoteToParentMap?: Map<number, number>): number;
|
|
179
|
+
getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];
|
|
180
|
+
getRemoteId(iframe: HTMLIFrameElement, parentId: number, map?: Map<number, number>): number;
|
|
181
|
+
getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];
|
|
182
|
+
reset(iframe?: HTMLIFrameElement): void;
|
|
183
|
+
}
|
|
184
|
+
type RecordPlugin<TOptions = unknown> = {
|
|
185
|
+
name: string;
|
|
186
|
+
observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
|
|
187
|
+
eventProcessor?: <TExtend>(event: eventWithTime$1) => eventWithTime$1 & TExtend;
|
|
188
|
+
getMirror?: (mirrors: {
|
|
189
|
+
nodeMirror: IMirror<Node>;
|
|
190
|
+
crossOriginIframeMirror: ICrossOriginIframeMirror;
|
|
191
|
+
crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
|
|
192
|
+
}) => void;
|
|
193
|
+
options: TOptions;
|
|
194
|
+
};
|
|
195
|
+
type hooksParam = {
|
|
196
|
+
mutation?: mutationCallBack;
|
|
197
|
+
mousemove?: mousemoveCallBack;
|
|
198
|
+
mouseInteraction?: mouseInteractionCallBack;
|
|
199
|
+
scroll?: scrollCallback;
|
|
200
|
+
viewportResize?: viewportResizeCallback;
|
|
201
|
+
input?: inputCallback;
|
|
202
|
+
mediaInteaction?: mediaInteractionCallback;
|
|
203
|
+
styleSheetRule?: styleSheetRuleCallback;
|
|
204
|
+
styleDeclaration?: styleDeclarationCallback;
|
|
205
|
+
canvasMutation?: canvasMutationCallback;
|
|
206
|
+
font?: fontCallback;
|
|
207
|
+
selection?: selectionCallback;
|
|
208
|
+
customElement?: customElementCallback;
|
|
209
|
+
};
|
|
210
|
+
type mutationRecord = Readonly<{
|
|
211
|
+
type: string;
|
|
212
|
+
target: Node;
|
|
213
|
+
oldValue: string | null;
|
|
214
|
+
addedNodes: NodeList;
|
|
215
|
+
removedNodes: NodeList;
|
|
216
|
+
attributeName: string | null;
|
|
217
|
+
attributeNamespace?: string | null;
|
|
218
|
+
}>;
|
|
219
|
+
type textCursor = {
|
|
220
|
+
node: Node;
|
|
221
|
+
value: string | null;
|
|
222
|
+
};
|
|
223
|
+
type textMutation = {
|
|
224
|
+
id: number;
|
|
225
|
+
value: string | null;
|
|
226
|
+
};
|
|
227
|
+
type styleOMValue = {
|
|
228
|
+
[key: string]: styleValueWithPriority | string | false;
|
|
229
|
+
};
|
|
230
|
+
type styleValueWithPriority = [string, string];
|
|
231
|
+
type attributeCursor = {
|
|
232
|
+
node: Node;
|
|
233
|
+
attributes: {
|
|
234
|
+
[key: string]: string | styleOMValue | null;
|
|
235
|
+
};
|
|
236
|
+
styleDiff: styleOMValue;
|
|
237
|
+
_unchangedStyles: styleOMValue;
|
|
238
|
+
};
|
|
239
|
+
type attributeMutation = {
|
|
240
|
+
id: number;
|
|
241
|
+
attributes: {
|
|
242
|
+
[key: string]: string | styleOMValue | null;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
type removedNodeMutation = {
|
|
246
|
+
parentId: number;
|
|
247
|
+
id: number;
|
|
248
|
+
isShadow?: boolean;
|
|
249
|
+
};
|
|
250
|
+
type addedNodeMutation = {
|
|
251
|
+
parentId: number;
|
|
252
|
+
previousId?: number | null;
|
|
253
|
+
nextId: number | null;
|
|
254
|
+
node: serializedNodeWithId;
|
|
255
|
+
};
|
|
256
|
+
type mutationCallbackParam = {
|
|
257
|
+
texts: textMutation[];
|
|
258
|
+
attributes: attributeMutation[];
|
|
259
|
+
removes: removedNodeMutation[];
|
|
260
|
+
adds: addedNodeMutation[];
|
|
261
|
+
isAttachIframe?: true;
|
|
262
|
+
};
|
|
263
|
+
type mutationCallBack = (m: mutationCallbackParam) => void;
|
|
264
|
+
type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag) => void;
|
|
265
|
+
type mousePosition = {
|
|
266
|
+
x: number;
|
|
267
|
+
y: number;
|
|
268
|
+
id: number;
|
|
269
|
+
timeOffset: number;
|
|
270
|
+
};
|
|
271
|
+
type mouseMovePos = {
|
|
272
|
+
x: number;
|
|
273
|
+
y: number;
|
|
274
|
+
id: number;
|
|
275
|
+
debugData: incrementalData;
|
|
276
|
+
};
|
|
277
|
+
declare enum MouseInteractions {
|
|
278
|
+
MouseUp = 0,
|
|
279
|
+
MouseDown = 1,
|
|
280
|
+
Click = 2,
|
|
281
|
+
ContextMenu = 3,
|
|
282
|
+
DblClick = 4,
|
|
283
|
+
Focus = 5,
|
|
284
|
+
Blur = 6,
|
|
285
|
+
TouchStart = 7,
|
|
286
|
+
TouchMove_Departed = 8,
|
|
287
|
+
TouchEnd = 9,
|
|
288
|
+
TouchCancel = 10
|
|
289
|
+
}
|
|
290
|
+
declare enum PointerTypes {
|
|
291
|
+
Mouse = 0,
|
|
292
|
+
Pen = 1,
|
|
293
|
+
Touch = 2
|
|
294
|
+
}
|
|
295
|
+
declare enum CanvasContext {
|
|
296
|
+
"2D" = 0,
|
|
297
|
+
WebGL = 1,
|
|
298
|
+
WebGL2 = 2
|
|
299
|
+
}
|
|
300
|
+
type SerializedCanvasArg = {
|
|
301
|
+
rr_type: "ArrayBuffer";
|
|
302
|
+
base64: string;
|
|
303
|
+
} | {
|
|
304
|
+
rr_type: "Blob";
|
|
305
|
+
data: Array<CanvasArg>;
|
|
306
|
+
type?: string;
|
|
307
|
+
} | {
|
|
308
|
+
rr_type: string;
|
|
309
|
+
src: string;
|
|
310
|
+
} | {
|
|
311
|
+
rr_type: string;
|
|
312
|
+
args: Array<CanvasArg>;
|
|
313
|
+
} | {
|
|
314
|
+
rr_type: string;
|
|
315
|
+
index: number;
|
|
316
|
+
};
|
|
317
|
+
type CanvasArg = SerializedCanvasArg | string | number | boolean | null | CanvasArg[];
|
|
318
|
+
type mouseInteractionParam = {
|
|
319
|
+
type: MouseInteractions;
|
|
320
|
+
id: number;
|
|
321
|
+
x?: number;
|
|
322
|
+
y?: number;
|
|
323
|
+
pointerType?: PointerTypes;
|
|
324
|
+
};
|
|
325
|
+
type mouseInteractionCallBack = (d: mouseInteractionParam) => void;
|
|
326
|
+
type scrollPosition = {
|
|
327
|
+
id: number;
|
|
328
|
+
x: number;
|
|
329
|
+
y: number;
|
|
330
|
+
};
|
|
331
|
+
type scrollCallback = (p: scrollPosition) => void;
|
|
332
|
+
type styleSheetAddRule = {
|
|
333
|
+
rule: string;
|
|
334
|
+
index?: number | number[];
|
|
335
|
+
};
|
|
336
|
+
type styleSheetDeleteRule = {
|
|
337
|
+
index: number | number[];
|
|
338
|
+
};
|
|
339
|
+
type styleSheetRuleParam = {
|
|
340
|
+
id?: number;
|
|
341
|
+
styleId?: number;
|
|
342
|
+
removes?: styleSheetDeleteRule[];
|
|
343
|
+
adds?: styleSheetAddRule[];
|
|
344
|
+
replace?: string;
|
|
345
|
+
replaceSync?: string;
|
|
346
|
+
};
|
|
347
|
+
type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
|
|
348
|
+
type adoptedStyleSheetParam = {
|
|
349
|
+
id: number;
|
|
350
|
+
styles?: {
|
|
351
|
+
styleId: number;
|
|
352
|
+
rules: styleSheetAddRule[];
|
|
353
|
+
}[];
|
|
354
|
+
styleIds: number[];
|
|
355
|
+
};
|
|
356
|
+
type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;
|
|
357
|
+
type styleDeclarationParam = {
|
|
358
|
+
id?: number;
|
|
359
|
+
styleId?: number;
|
|
360
|
+
index: number[];
|
|
361
|
+
set?: {
|
|
362
|
+
property: string;
|
|
363
|
+
value: string | null;
|
|
364
|
+
priority: string | undefined;
|
|
365
|
+
};
|
|
366
|
+
remove?: {
|
|
367
|
+
property: string;
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
type styleDeclarationCallback = (s: styleDeclarationParam) => void;
|
|
371
|
+
type canvasMutationCommand = {
|
|
372
|
+
property: string;
|
|
373
|
+
args: Array<unknown>;
|
|
374
|
+
setter?: true;
|
|
375
|
+
};
|
|
376
|
+
type canvasMutationParam = {
|
|
377
|
+
id: number;
|
|
378
|
+
type: CanvasContext;
|
|
379
|
+
commands: canvasMutationCommand[];
|
|
380
|
+
displayWidth?: number;
|
|
381
|
+
displayHeight?: number;
|
|
382
|
+
} | ({
|
|
383
|
+
id: number;
|
|
384
|
+
type: CanvasContext;
|
|
385
|
+
displayWidth?: number;
|
|
386
|
+
displayHeight?: number;
|
|
387
|
+
} & canvasMutationCommand);
|
|
388
|
+
type canvasMutationWithType = {
|
|
389
|
+
type: CanvasContext;
|
|
390
|
+
} & canvasMutationCommand;
|
|
391
|
+
type canvasMutationCallback = (p: canvasMutationParam) => void;
|
|
392
|
+
type canvasManagerMutationCallback = (target: HTMLCanvasElement, p: canvasMutationWithType) => void;
|
|
393
|
+
type CanvasMaskRegion = {
|
|
394
|
+
x: number;
|
|
395
|
+
y: number;
|
|
396
|
+
width: number;
|
|
397
|
+
height: number;
|
|
398
|
+
};
|
|
399
|
+
type CanvasMasking = {
|
|
400
|
+
regionsFn?: (canvas: HTMLCanvasElement) => CanvasMaskRegion[] | null | undefined;
|
|
401
|
+
configured?: () => boolean;
|
|
402
|
+
};
|
|
403
|
+
type ImageBitmapDataURLWorkerParams = {
|
|
404
|
+
id: number;
|
|
405
|
+
bitmap: ImageBitmap;
|
|
406
|
+
width: number;
|
|
407
|
+
height: number;
|
|
408
|
+
displayWidth: number;
|
|
409
|
+
displayHeight: number;
|
|
410
|
+
dataURLOptions: DataURLOptions;
|
|
411
|
+
maskRegions?: CanvasMaskRegion[];
|
|
412
|
+
};
|
|
413
|
+
type ImageBitmapDataURLWorkerResetParams = {
|
|
414
|
+
resetFrameDedup: true;
|
|
415
|
+
};
|
|
416
|
+
type ImageBitmapDataURLWorkerMessage = ImageBitmapDataURLWorkerParams | ImageBitmapDataURLWorkerResetParams;
|
|
417
|
+
type ImageBitmapDataURLWorkerResponse = {
|
|
418
|
+
id: number;
|
|
419
|
+
} | {
|
|
420
|
+
id: number;
|
|
421
|
+
type: string;
|
|
422
|
+
base64: string;
|
|
423
|
+
displayWidth: number;
|
|
424
|
+
displayHeight: number;
|
|
425
|
+
};
|
|
426
|
+
type fontParam = {
|
|
427
|
+
family: string;
|
|
428
|
+
fontSource: string;
|
|
429
|
+
buffer: boolean;
|
|
430
|
+
descriptors?: FontFaceDescriptors;
|
|
431
|
+
};
|
|
432
|
+
type fontCallback = (p: fontParam) => void;
|
|
433
|
+
type viewportResizeDimension = {
|
|
434
|
+
width: number;
|
|
435
|
+
height: number;
|
|
436
|
+
};
|
|
437
|
+
type viewportResizeCallback = (d: viewportResizeDimension) => void;
|
|
438
|
+
type inputValue = {
|
|
439
|
+
text: string;
|
|
440
|
+
isChecked: boolean;
|
|
441
|
+
userTriggered?: boolean;
|
|
442
|
+
};
|
|
443
|
+
type inputCallback = (v: inputValue & {
|
|
444
|
+
id: number;
|
|
445
|
+
}) => void;
|
|
446
|
+
declare enum MediaInteractions {
|
|
447
|
+
Play = 0,
|
|
448
|
+
Pause = 1,
|
|
449
|
+
Seeked = 2,
|
|
450
|
+
VolumeChange = 3,
|
|
451
|
+
RateChange = 4
|
|
452
|
+
}
|
|
453
|
+
type mediaInteractionParam = {
|
|
454
|
+
type: MediaInteractions;
|
|
455
|
+
id: number;
|
|
456
|
+
currentTime?: number;
|
|
457
|
+
volume?: number;
|
|
458
|
+
muted?: boolean;
|
|
459
|
+
loop?: boolean;
|
|
460
|
+
playbackRate?: number;
|
|
461
|
+
};
|
|
462
|
+
type mediaInteractionCallback = (p: mediaInteractionParam) => void;
|
|
463
|
+
type DocumentDimension = {
|
|
464
|
+
x: number;
|
|
465
|
+
y: number;
|
|
466
|
+
relativeScale: number;
|
|
467
|
+
absoluteScale: number;
|
|
468
|
+
};
|
|
469
|
+
type SelectionRange = {
|
|
470
|
+
start: number;
|
|
471
|
+
startOffset: number;
|
|
472
|
+
end: number;
|
|
473
|
+
endOffset: number;
|
|
474
|
+
};
|
|
475
|
+
type selectionParam = {
|
|
476
|
+
ranges: Array<SelectionRange>;
|
|
477
|
+
};
|
|
478
|
+
type selectionCallback = (p: selectionParam) => void;
|
|
479
|
+
type customElementParam = {
|
|
480
|
+
define?: {
|
|
481
|
+
name: string;
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
type customElementCallback = (c: customElementParam) => void;
|
|
485
|
+
/**
|
|
486
|
+
* @deprecated
|
|
487
|
+
*/
|
|
488
|
+
interface INode extends Node {
|
|
489
|
+
__sn: serializedNodeWithId;
|
|
490
|
+
}
|
|
491
|
+
type DeprecatedMirror = {
|
|
492
|
+
map: {
|
|
493
|
+
[key: number]: INode;
|
|
494
|
+
};
|
|
495
|
+
getId: (n: Node) => number;
|
|
496
|
+
getNode: (id: number) => INode | null;
|
|
497
|
+
removeNodeFromMap: (n: Node) => void;
|
|
498
|
+
has: (id: number) => boolean;
|
|
499
|
+
reset: () => void;
|
|
500
|
+
};
|
|
501
|
+
type throttleOptions = {
|
|
502
|
+
leading?: boolean;
|
|
503
|
+
trailing?: boolean;
|
|
504
|
+
};
|
|
505
|
+
type listenerHandler = () => void;
|
|
506
|
+
type hookResetter = () => void;
|
|
507
|
+
type playerMetaData = {
|
|
508
|
+
startTime: number;
|
|
509
|
+
endTime: number;
|
|
510
|
+
totalTime: number;
|
|
511
|
+
};
|
|
512
|
+
type actionWithDelay = {
|
|
513
|
+
doAction: () => void;
|
|
514
|
+
delay: number;
|
|
515
|
+
};
|
|
516
|
+
type Handler = (event?: unknown) => void;
|
|
517
|
+
type Emitter = {
|
|
518
|
+
on(type: string, handler: Handler): void;
|
|
519
|
+
emit(type: string, event?: unknown): void;
|
|
520
|
+
off(type: string, handler: Handler): void;
|
|
521
|
+
};
|
|
522
|
+
type Arguments<T> = T extends ((...payload: infer U) => unknown) ? U : unknown;
|
|
523
|
+
declare enum ReplayerEvents {
|
|
524
|
+
Start = "start",
|
|
525
|
+
Pause = "pause",
|
|
526
|
+
/**
|
|
527
|
+
* @deprecated use Play instead
|
|
528
|
+
*/
|
|
529
|
+
Resume = "resume",
|
|
530
|
+
Resize = "resize",
|
|
531
|
+
Finish = "finish",
|
|
532
|
+
FullsnapshotRebuilded = "fullsnapshot-rebuilded",
|
|
533
|
+
LoadStylesheetStart = "load-stylesheet-start",
|
|
534
|
+
LoadStylesheetEnd = "load-stylesheet-end",
|
|
535
|
+
SkipStart = "skip-start",
|
|
536
|
+
SkipEnd = "skip-end",
|
|
537
|
+
MouseInteraction = "mouse-interaction",
|
|
538
|
+
EventCast = "event-cast",
|
|
539
|
+
CustomEvent = "custom-event",
|
|
540
|
+
Flush = "flush",
|
|
541
|
+
StateChange = "state-change",
|
|
542
|
+
PlayBack = "play-back",
|
|
543
|
+
Destroy = "destroy"
|
|
544
|
+
}
|
|
545
|
+
type KeepIframeSrcFn = (src: string) => boolean;
|
|
731
546
|
declare global {
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
547
|
+
interface Window {
|
|
548
|
+
FontFace: typeof FontFace;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
type IWindow = Window & typeof globalThis;
|
|
552
|
+
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
553
|
+
type GetTypedKeys<Obj extends object, ValueType> = TakeTypeHelper<Obj, ValueType>[keyof TakeTypeHelper<Obj, ValueType>];
|
|
554
|
+
type TakeTypeHelper<Obj extends object, ValueType> = { [K in keyof Obj]: Obj[K] extends ValueType ? K : never; };
|
|
555
|
+
type TakeTypedKeyValues<Obj extends object, Type> = Pick<Obj, TakeTypeHelper<Obj, Type>[keyof TakeTypeHelper<Obj, Type>]>;
|
|
556
|
+
declare enum NodeType {
|
|
557
|
+
Document = 0,
|
|
558
|
+
DocumentType = 1,
|
|
559
|
+
Element = 2,
|
|
560
|
+
Text = 3,
|
|
561
|
+
CDATA = 4,
|
|
562
|
+
Comment = 5
|
|
735
563
|
}
|
|
564
|
+
type documentNode = {
|
|
565
|
+
type: NodeType.Document;
|
|
566
|
+
childNodes: serializedNodeWithId[];
|
|
567
|
+
compatMode?: string;
|
|
568
|
+
};
|
|
569
|
+
type documentTypeNode = {
|
|
570
|
+
type: NodeType.DocumentType;
|
|
571
|
+
name: string;
|
|
572
|
+
publicId: string;
|
|
573
|
+
systemId: string;
|
|
574
|
+
};
|
|
575
|
+
type cssTextKeyAttr = {
|
|
576
|
+
_cssText?: string;
|
|
577
|
+
};
|
|
578
|
+
type attributes = cssTextKeyAttr & {
|
|
579
|
+
[key: string]: string | number | true | null;
|
|
580
|
+
};
|
|
581
|
+
type legacyAttributes = {
|
|
582
|
+
/**
|
|
583
|
+
* @deprecated old bug in rrweb was causing these to always be set
|
|
584
|
+
* @see https://github.com/rrweb-io/rrweb/pull/651
|
|
585
|
+
*/
|
|
586
|
+
selected: false;
|
|
587
|
+
};
|
|
588
|
+
type mediaAttributes = {
|
|
589
|
+
rr_mediaState: "played" | "paused";
|
|
590
|
+
rr_mediaCurrentTime: number;
|
|
591
|
+
/**
|
|
592
|
+
* for backwards compatibility this is optional but should always be set
|
|
593
|
+
*/
|
|
594
|
+
rr_mediaPlaybackRate?: number;
|
|
595
|
+
/**
|
|
596
|
+
* for backwards compatibility this is optional but should always be set
|
|
597
|
+
*/
|
|
598
|
+
rr_mediaMuted?: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* for backwards compatibility this is optional but should always be set
|
|
601
|
+
*/
|
|
602
|
+
rr_mediaLoop?: boolean;
|
|
603
|
+
/**
|
|
604
|
+
* for backwards compatibility this is optional but should always be set
|
|
605
|
+
*/
|
|
606
|
+
rr_mediaVolume?: number;
|
|
607
|
+
};
|
|
608
|
+
type elementNode = {
|
|
609
|
+
type: NodeType.Element;
|
|
610
|
+
tagName: string;
|
|
611
|
+
attributes: attributes;
|
|
612
|
+
childNodes: serializedNodeWithId[];
|
|
613
|
+
isSVG?: true;
|
|
614
|
+
needBlock?: boolean;
|
|
615
|
+
isCustom?: true;
|
|
616
|
+
};
|
|
617
|
+
type textNode = {
|
|
618
|
+
type: NodeType.Text;
|
|
619
|
+
textContent: string;
|
|
620
|
+
/**
|
|
621
|
+
* @deprecated styles are now always snapshotted against parent <style> element
|
|
622
|
+
* style mutations can still happen via an added textNode, but they don't need this attribute for correct replay
|
|
623
|
+
*/
|
|
624
|
+
isStyle?: true;
|
|
625
|
+
};
|
|
626
|
+
type cdataNode = {
|
|
627
|
+
type: NodeType.CDATA;
|
|
628
|
+
textContent: "";
|
|
629
|
+
};
|
|
630
|
+
type commentNode = {
|
|
631
|
+
type: NodeType.Comment;
|
|
632
|
+
textContent: string;
|
|
633
|
+
};
|
|
634
|
+
type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
|
|
635
|
+
rootId?: number;
|
|
636
|
+
isShadowHost?: boolean;
|
|
637
|
+
isShadow?: boolean;
|
|
638
|
+
};
|
|
639
|
+
type serializedNodeWithId = serializedNode & {
|
|
640
|
+
id: number;
|
|
641
|
+
};
|
|
642
|
+
type serializedElementNodeWithId = Extract<serializedNodeWithId, Record<"type", NodeType.Element>>;
|
|
643
|
+
interface IMirror<TNode> {
|
|
644
|
+
getId(n: TNode | undefined | null): number;
|
|
645
|
+
getNode(id: number): TNode | null;
|
|
646
|
+
getIds(): number[];
|
|
647
|
+
getMeta(n: TNode): serializedNodeWithId | null;
|
|
648
|
+
removeNodeFromMap(n: TNode): void;
|
|
649
|
+
has(id: number): boolean;
|
|
650
|
+
hasNode(node: TNode): boolean;
|
|
651
|
+
add(n: TNode, meta: serializedNodeWithId): void;
|
|
652
|
+
replace(id: number, n: TNode): void;
|
|
653
|
+
reset(): void;
|
|
654
|
+
}
|
|
655
|
+
type DataURLOptions = Partial<{
|
|
656
|
+
type: string;
|
|
657
|
+
quality: number;
|
|
658
|
+
maxBase64ImageLength: number;
|
|
659
|
+
}>;
|
|
660
|
+
type PackFn = (event: eventWithTime$1) => string;
|
|
661
|
+
type UnpackFn = (raw: string) => eventWithTime$1;
|
|
662
|
+
|
|
663
|
+
declare const EventType: {
|
|
664
|
+
readonly DomContentLoaded: 0;
|
|
665
|
+
readonly Load: 1;
|
|
666
|
+
readonly FullSnapshot: 2;
|
|
667
|
+
readonly IncrementalSnapshot: 3;
|
|
668
|
+
readonly Meta: 4;
|
|
669
|
+
readonly Custom: 5;
|
|
670
|
+
readonly Plugin: 6;
|
|
671
|
+
};
|
|
672
|
+
type EventType = (typeof EventType)[keyof typeof EventType];
|
|
673
|
+
type customEvent$1<T = unknown> = {
|
|
674
|
+
type: typeof EventType.Custom;
|
|
675
|
+
data: {
|
|
676
|
+
tag: string;
|
|
677
|
+
payload: T;
|
|
678
|
+
href?: string;
|
|
679
|
+
};
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
type WithJsonLdUrl<T> = T extends customEvent$2 ? T & {
|
|
683
|
+
data: Pick<customEvent$1['data'], 'href'>;
|
|
684
|
+
} : T;
|
|
685
|
+
type customEvent<T = unknown> = WithJsonLdUrl<customEvent$2<T>>;
|
|
686
|
+
type eventWithoutTime = WithJsonLdUrl<eventWithoutTime$1>;
|
|
687
|
+
type event = eventWithoutTime;
|
|
688
|
+
type eventWithTime = WithJsonLdUrl<eventWithTime$1>;
|
|
736
689
|
|
|
737
|
-
export { CanvasContext, EventType, FullscreenCustomEventTag, IncrementalSource, MediaInteractions, MouseInteractions, NodeType, PointerTypes, ReplayerEvents };
|
|
738
|
-
export type { Arguments, CanvasArg, CanvasMaskRegion, CanvasMasking, DataURLOptions, DeprecatedMirror, DocumentDimension, Emitter, GetTypedKeys, Handler, ICrossOriginIframeMirror, IMirror, IWindow, ImageBitmapDataURLWorkerMessage, ImageBitmapDataURLWorkerParams, ImageBitmapDataURLWorkerResetParams, ImageBitmapDataURLWorkerResponse, KeepIframeSrcFn, Optional, PackFn, RecordPlugin, SamplingStrategy, SelectionRange, SerializedCanvasArg, TakeTypeHelper, TakeTypedKeyValues, UnpackFn, actionWithDelay, addedNodeMutation, adoptedStyleSheetCallback, adoptedStyleSheetData, adoptedStyleSheetParam, attributeCursor, attributeMutation, attributes, blockClass, canvasEventWithTime, canvasManagerMutationCallback, canvasMutationCallback, canvasMutationCommand, canvasMutationData, canvasMutationParam, canvasMutationWithType, cdataNode, commentNode, customElementCallback, customElementData, customElementParam, customEvent, documentNode, documentTypeNode, domContentLoadedEvent, elementNode,
|
|
690
|
+
export { CanvasContext, EventType$1 as EventType, FullscreenCustomEventTag, IncrementalSource, MediaInteractions, MouseInteractions, NodeType, PointerTypes, ReplayerEvents };
|
|
691
|
+
export type { Arguments, CanvasArg, CanvasMaskRegion, CanvasMasking, DataURLOptions, DeprecatedMirror, DocumentDimension, Emitter, GetTypedKeys, Handler, ICrossOriginIframeMirror, IMirror, IWindow, ImageBitmapDataURLWorkerMessage, ImageBitmapDataURLWorkerParams, ImageBitmapDataURLWorkerResetParams, ImageBitmapDataURLWorkerResponse, KeepIframeSrcFn, Optional, PackFn, RecordPlugin, SamplingStrategy, SelectionRange, SerializedCanvasArg, TakeTypeHelper, TakeTypedKeyValues, UnpackFn, actionWithDelay, addedNodeMutation, adoptedStyleSheetCallback, adoptedStyleSheetData, adoptedStyleSheetParam, attributeCursor, attributeMutation, attributes, blockClass, canvasEventWithTime, canvasManagerMutationCallback, canvasMutationCallback, canvasMutationCommand, canvasMutationData, canvasMutationParam, canvasMutationWithType, cdataNode, commentNode, customElementCallback, customElementData, customElementParam, customEvent, documentNode, documentTypeNode, domContentLoadedEvent, elementNode, event, eventWithTime, eventWithoutTime, fontCallback, fontData, fontParam, fullSnapshotEvent, fullscreenEventPayload, hookResetter, hooksParam, incrementalData, incrementalSnapshotEvent, inputCallback, inputData, inputValue, legacyAttributes, listenerHandler, loadedEvent, maskTextClass, mediaAttributes, mediaInteractionCallback, mediaInteractionData, mediaInteractionParam, metaEvent, mouseInteractionCallBack, mouseInteractionData, mouseMovePos, mousePosition, mousemoveCallBack, mousemoveData, mutationCallBack, mutationCallbackParam, mutationData, mutationRecord, playerMetaData, pluginEvent, removedNodeMutation, scrollCallback, scrollData, scrollPosition, selectionCallback, selectionData, selectionParam, serializedElementNodeWithId, serializedNode, serializedNodeWithId, styleDeclarationCallback, styleDeclarationData, styleDeclarationParam, styleOMValue, styleSheetAddRule, styleSheetDeleteRule, styleSheetRuleCallback, styleSheetRuleData, styleSheetRuleParam, styleValueWithPriority, textCursor, textMutation, textNode, throttleOptions, viewportResizeCallback, viewportResizeData, viewportResizeDimension };
|