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.
Files changed (60) hide show
  1. package/LICENSE +64 -0
  2. package/dist/all-external-dependencies.js +1 -1
  3. package/dist/all-external-dependencies.js.map +1 -1
  4. package/dist/array.full.es5.js +1 -1
  5. package/dist/array.full.es5.js.map +1 -1
  6. package/dist/array.full.js +1 -1
  7. package/dist/array.full.js.map +1 -1
  8. package/dist/array.full.no-external.js +1 -1
  9. package/dist/array.full.no-external.js.map +1 -1
  10. package/dist/array.js +1 -1
  11. package/dist/array.js.map +1 -1
  12. package/dist/array.no-external.js +1 -1
  13. package/dist/array.no-external.js.map +1 -1
  14. package/dist/customizations.d.ts +1 -0
  15. package/dist/customizations.full.js +1 -1
  16. package/dist/customizations.js +1 -1
  17. package/dist/default-extensions.js +1 -1
  18. package/dist/default-extensions.js.map +1 -1
  19. package/dist/exception-autocapture.js +1 -1
  20. package/dist/exception-autocapture.js.map +1 -1
  21. package/dist/extension-bundles.js +1 -1
  22. package/dist/extension-bundles.js.map +1 -1
  23. package/dist/lazy-recorder.js +1 -1
  24. package/dist/lazy-recorder.js.map +1 -1
  25. package/dist/main.d.ts +1 -0
  26. package/dist/main.js +1 -1
  27. package/dist/main.js.map +1 -1
  28. package/dist/module.d.ts +1 -0
  29. package/dist/module.full.d.ts +1 -0
  30. package/dist/module.full.js +1 -1
  31. package/dist/module.full.js.map +1 -1
  32. package/dist/module.full.no-external.d.ts +1 -0
  33. package/dist/module.full.no-external.js +1 -1
  34. package/dist/module.full.no-external.js.map +1 -1
  35. package/dist/module.js +1 -1
  36. package/dist/module.js.map +1 -1
  37. package/dist/module.mjs +1 -1
  38. package/dist/module.mjs.map +1 -1
  39. package/dist/module.no-external.d.ts +1 -0
  40. package/dist/module.no-external.js +1 -1
  41. package/dist/module.no-external.js.map +1 -1
  42. package/dist/module.slim.js +1 -1
  43. package/dist/module.slim.no-external.d.ts +1 -0
  44. package/dist/module.slim.no-external.js +1 -1
  45. package/dist/posthog-recorder.d.ts +577 -653
  46. package/dist/posthog-recorder.js +1 -1
  47. package/dist/posthog-recorder.js.map +1 -1
  48. package/dist/recorder.d.ts +577 -653
  49. package/dist/rrweb-plugin-console-record.d.ts +436 -500
  50. package/dist/rrweb-types.d.ts +688 -735
  51. package/dist/rrweb.d.ts +1303 -1433
  52. package/dist/src/entrypoints/rrweb-types.es.d.ts +9 -0
  53. package/dist/src/extensions/replay/types/rrweb-types.d.ts +1 -0
  54. package/lib/package.json +10 -4
  55. package/lib/src/entrypoints/rrweb-types.es.d.ts +9 -0
  56. package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js +12 -2
  57. package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -1
  58. package/lib/src/extensions/replay/types/rrweb-types.d.ts +1 -0
  59. package/lib/src/extensions/replay/types/rrweb-types.js.map +1 -1
  60. package/package.json +16 -10
@@ -1,738 +1,691 @@
1
- declare type actionWithDelay = {
2
- doAction: () => void;
3
- delay: number;
4
- };
5
-
6
- declare type addedNodeMutation = {
7
- parentId: number;
8
- previousId?: number | null;
9
- nextId: number | null;
10
- node: serializedNodeWithId;
11
- };
12
-
13
- declare type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;
14
-
15
- declare type adoptedStyleSheetData = {
16
- source: IncrementalSource.AdoptedStyleSheet;
17
- } & adoptedStyleSheetParam;
18
-
19
- declare type adoptedStyleSheetParam = {
20
- id: number;
21
- styles?: {
22
- styleId: number;
23
- rules: styleSheetAddRule[];
24
- }[];
25
- styleIds: number[];
26
- };
27
-
28
- declare type Arguments<T> = T extends (...payload: infer U) => unknown ? U : unknown;
29
-
30
- declare type attributeCursor = {
31
- node: Node;
32
- attributes: {
33
- [key: string]: string | styleOMValue | null;
34
- };
35
- styleDiff: styleOMValue;
36
- _unchangedStyles: styleOMValue;
37
- };
38
-
39
- declare type attributeMutation = {
40
- id: number;
41
- attributes: {
42
- [key: string]: string | styleOMValue | null;
43
- };
44
- };
45
-
46
- declare type attributes = cssTextKeyAttr & {
47
- [key: string]: string | number | true | null;
48
- };
49
-
50
- declare type blockClass = string | RegExp;
51
-
52
- declare type CanvasArg = SerializedCanvasArg | string | number | boolean | null | CanvasArg[];
53
-
54
- declare enum CanvasContext {
55
- '2D' = 0,
56
- WebGL = 1,
57
- WebGL2 = 2
58
- }
59
-
60
- declare type canvasEventWithTime = eventWithTime & {
61
- type: EventType.IncrementalSnapshot;
62
- data: canvasMutationData;
63
- };
64
-
65
- declare type canvasManagerMutationCallback = (target: HTMLCanvasElement, p: canvasMutationWithType) => void;
66
-
67
- declare type CanvasMasking = {
68
- regionsFn?: (canvas: HTMLCanvasElement) => CanvasMaskRegion[] | null | undefined;
69
- configured?: () => boolean;
70
- };
71
-
72
- declare type CanvasMaskRegion = {
73
- x: number;
74
- y: number;
75
- width: number;
76
- height: number;
77
- };
78
-
79
- declare type canvasMutationCallback = (p: canvasMutationParam) => void;
80
-
81
- declare type canvasMutationCommand = {
82
- property: string;
83
- args: Array<unknown>;
84
- setter?: true;
85
- };
86
-
87
- declare type canvasMutationData = {
88
- source: IncrementalSource.CanvasMutation;
89
- } & canvasMutationParam;
90
-
91
- declare type canvasMutationParam = {
92
- id: number;
93
- type: CanvasContext;
94
- commands: canvasMutationCommand[];
95
- displayWidth?: number;
96
- displayHeight?: number;
97
- } | ({
98
- id: number;
99
- type: CanvasContext;
100
- displayWidth?: number;
101
- displayHeight?: number;
102
- } & canvasMutationCommand);
103
-
104
- declare type canvasMutationWithType = {
105
- type: CanvasContext;
106
- } & canvasMutationCommand;
107
-
108
- declare type cdataNode = {
109
- type: NodeType.CDATA;
110
- textContent: '';
111
- };
112
-
113
- declare type commentNode = {
114
- type: NodeType.Comment;
115
- textContent: string;
116
- };
117
-
118
- declare type cssTextKeyAttr = {
119
- _cssText?: string;
120
- };
121
-
122
- declare type customElementCallback = (c: customElementParam) => void;
123
-
124
- declare type customElementData = {
125
- source: IncrementalSource.CustomElement;
126
- } & customElementParam;
127
-
128
- declare type customElementParam = {
129
- define?: {
130
- name: string;
131
- };
132
- };
133
-
134
- declare type customEvent<T = unknown> = {
135
- type: EventType.Custom;
136
- data: {
137
- tag: string;
138
- payload: T;
139
- };
140
- };
141
-
142
- declare type DataURLOptions = Partial<{
143
- type: string;
144
- quality: number;
145
- maxBase64ImageLength: number;
146
- }>;
147
-
148
- declare type DeprecatedMirror = {
149
- map: {
150
- [key: number]: INode;
151
- };
152
- getId: (n: Node) => number;
153
- getNode: (id: number) => INode | null;
154
- removeNodeFromMap: (n: Node) => void;
155
- has: (id: number) => boolean;
156
- reset: () => void;
157
- };
158
-
159
- declare type DocumentDimension = {
160
- x: number;
161
- y: number;
162
- relativeScale: number;
163
- absoluteScale: number;
164
- };
165
-
166
- declare type documentNode = {
167
- type: NodeType.Document;
168
- childNodes: serializedNodeWithId[];
169
- compatMode?: string;
170
- };
171
-
172
- declare type documentTypeNode = {
173
- type: NodeType.DocumentType;
174
- name: string;
175
- publicId: string;
176
- systemId: string;
177
- };
178
-
179
- declare type domContentLoadedEvent = {
180
- type: EventType.DomContentLoaded;
181
- data: unknown;
182
- };
183
-
184
- declare type elementNode = {
185
- type: NodeType.Element;
186
- tagName: string;
187
- attributes: attributes;
188
- childNodes: serializedNodeWithId[];
189
- isSVG?: true;
190
- needBlock?: boolean;
191
- isCustom?: true;
192
- };
193
-
194
- declare type Emitter = {
195
- on(type: string, handler: Handler): void;
196
- emit(type: string, event?: unknown): void;
197
- off(type: string, handler: Handler): void;
198
- };
199
-
200
- declare type event_2 = eventWithoutTime;
201
-
202
-
203
- declare enum EventType {
204
- DomContentLoaded = 0,
205
- Load = 1,
206
- FullSnapshot = 2,
207
- IncrementalSnapshot = 3,
208
- Meta = 4,
209
- Custom = 5,
210
- Plugin = 6
211
- }
212
-
213
- declare type eventWithoutTime = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
214
-
215
- declare type eventWithTime = eventWithoutTime & {
216
- timestamp: number;
217
- delay?: number;
218
- };
219
-
220
- declare type fontCallback = (p: fontParam) => void;
221
-
222
- declare type fontData = {
223
- source: IncrementalSource.Font;
224
- } & fontParam;
225
-
226
- declare type fontParam = {
227
- family: string;
228
- fontSource: string;
229
- buffer: boolean;
230
- descriptors?: FontFaceDescriptors;
231
- };
232
-
233
- declare const FullscreenCustomEventTag = "rrweb/fullscreen";
234
-
235
- declare type fullscreenEventPayload = {
236
- id: number;
237
- enter: boolean;
238
- };
239
-
240
- declare type fullSnapshotEvent = {
241
- type: EventType.FullSnapshot;
242
- data: {
243
- node: serializedNodeWithId;
244
- initialOffset: {
245
- top: number;
246
- left: number;
247
- };
248
- };
249
- };
250
-
251
- declare type GetTypedKeys<Obj extends object, ValueType> = TakeTypeHelper<Obj, ValueType>[keyof TakeTypeHelper<Obj, ValueType>];
252
-
253
- declare type Handler = (event?: unknown) => void;
254
-
255
- declare type hookResetter = () => void;
256
-
257
- declare type hooksParam = {
258
- mutation?: mutationCallBack;
259
- mousemove?: mousemoveCallBack;
260
- mouseInteraction?: mouseInteractionCallBack;
261
- scroll?: scrollCallback;
262
- viewportResize?: viewportResizeCallback;
263
- input?: inputCallback;
264
- mediaInteaction?: mediaInteractionCallback;
265
- styleSheetRule?: styleSheetRuleCallback;
266
- styleDeclaration?: styleDeclarationCallback;
267
- canvasMutation?: canvasMutationCallback;
268
- font?: fontCallback;
269
- selection?: selectionCallback;
270
- customElement?: customElementCallback;
271
- };
272
-
273
- declare interface ICrossOriginIframeMirror {
274
- getId(iframe: HTMLIFrameElement, remoteId: number, parentToRemoteMap?: Map<number, number>, remoteToParentMap?: Map<number, number>): number;
275
- getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];
276
- getRemoteId(iframe: HTMLIFrameElement, parentId: number, map?: Map<number, number>): number;
277
- getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];
278
- reset(iframe?: HTMLIFrameElement): void;
279
- }
280
-
281
- declare type ImageBitmapDataURLWorkerMessage = ImageBitmapDataURLWorkerParams | ImageBitmapDataURLWorkerResetParams;
282
-
283
- declare type ImageBitmapDataURLWorkerParams = {
284
- id: number;
285
- bitmap: ImageBitmap;
286
- width: number;
287
- height: number;
288
- displayWidth: number;
289
- displayHeight: number;
290
- dataURLOptions: DataURLOptions;
291
- maskRegions?: CanvasMaskRegion[];
292
- };
293
-
294
- declare type ImageBitmapDataURLWorkerResetParams = {
295
- resetFrameDedup: true;
296
- };
297
-
298
- declare type ImageBitmapDataURLWorkerResponse = {
299
- id: number;
300
- } | {
301
- id: number;
302
- type: string;
303
- base64: string;
304
- displayWidth: number;
305
- displayHeight: number;
306
- };
307
-
308
- declare interface IMirror<TNode> {
309
- getId(n: TNode | undefined | null): number;
310
- getNode(id: number): TNode | null;
311
- getIds(): number[];
312
- getMeta(n: TNode): serializedNodeWithId | null;
313
- removeNodeFromMap(n: TNode): void;
314
- has(id: number): boolean;
315
- hasNode(node: TNode): boolean;
316
- add(n: TNode, meta: serializedNodeWithId): void;
317
- replace(id: number, n: TNode): void;
318
- reset(): void;
319
- }
320
-
321
- declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData;
322
-
323
- declare type incrementalSnapshotEvent = {
324
- type: EventType.IncrementalSnapshot;
325
- data: incrementalData;
326
- };
327
-
328
- declare enum IncrementalSource {
329
- Mutation = 0,
330
- MouseMove = 1,
331
- MouseInteraction = 2,
332
- Scroll = 3,
333
- ViewportResize = 4,
334
- Input = 5,
335
- TouchMove = 6,
336
- MediaInteraction = 7,
337
- StyleSheetRule = 8,
338
- CanvasMutation = 9,
339
- Font = 10,
340
- Log = 11,
341
- Drag = 12,
342
- StyleDeclaration = 13,
343
- Selection = 14,
344
- AdoptedStyleSheet = 15,
345
- CustomElement = 16
346
- }
347
-
348
- declare interface INode extends Node {
349
- __sn: serializedNodeWithId;
350
- }
351
-
352
- declare type inputCallback = (v: inputValue & {
353
- id: number;
354
- }) => void;
355
-
356
- declare type inputData = {
357
- source: IncrementalSource.Input;
358
- id: number;
359
- } & inputValue;
360
-
361
- declare type inputValue = {
362
- text: string;
363
- isChecked: boolean;
364
- userTriggered?: boolean;
365
- };
366
-
367
- declare type IWindow = Window & typeof globalThis;
368
-
369
- declare type KeepIframeSrcFn = (src: string) => boolean;
370
-
371
- declare type legacyAttributes = {
372
- selected: false;
373
- };
374
-
375
- declare type listenerHandler = () => void;
376
-
377
- declare type loadedEvent = {
378
- type: EventType.Load;
379
- data: unknown;
380
- };
381
-
382
- declare type maskTextClass = string | RegExp;
383
-
384
- declare type mediaAttributes = {
385
- rr_mediaState: 'played' | 'paused';
386
- rr_mediaCurrentTime: number;
387
- rr_mediaPlaybackRate?: number;
388
- rr_mediaMuted?: boolean;
389
- rr_mediaLoop?: boolean;
390
- rr_mediaVolume?: number;
391
- };
392
-
393
- declare type mediaInteractionCallback = (p: mediaInteractionParam) => void;
394
-
395
- declare type mediaInteractionData = {
396
- source: IncrementalSource.MediaInteraction;
397
- } & mediaInteractionParam;
398
-
399
- declare type mediaInteractionParam = {
400
- type: MediaInteractions;
401
- id: number;
402
- currentTime?: number;
403
- volume?: number;
404
- muted?: boolean;
405
- loop?: boolean;
406
- playbackRate?: number;
407
- };
408
-
409
- declare enum MediaInteractions {
410
- Play = 0,
411
- Pause = 1,
412
- Seeked = 2,
413
- VolumeChange = 3,
414
- RateChange = 4
415
- }
416
-
417
- declare type metaEvent = {
418
- type: EventType.Meta;
419
- data: {
420
- href: string;
421
- width: number;
422
- height: number;
423
- };
424
- };
425
-
426
- declare type mouseInteractionCallBack = (d: mouseInteractionParam) => void;
427
-
428
- declare type mouseInteractionData = {
429
- source: IncrementalSource.MouseInteraction;
430
- } & mouseInteractionParam;
431
-
432
- declare type mouseInteractionParam = {
433
- type: MouseInteractions;
434
- id: number;
435
- x?: number;
436
- y?: number;
437
- pointerType?: PointerTypes;
438
- };
439
-
440
- declare enum MouseInteractions {
441
- MouseUp = 0,
442
- MouseDown = 1,
443
- Click = 2,
444
- ContextMenu = 3,
445
- DblClick = 4,
446
- Focus = 5,
447
- Blur = 6,
448
- TouchStart = 7,
449
- TouchMove_Departed = 8,
450
- TouchEnd = 9,
451
- TouchCancel = 10
452
- }
453
-
454
- declare type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag) => void;
455
-
456
- declare type mousemoveData = {
457
- source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
458
- positions: mousePosition[];
459
- };
460
-
461
- declare type mouseMovePos = {
462
- x: number;
463
- y: number;
464
- id: number;
465
- debugData: incrementalData;
466
- };
467
-
468
- declare type mousePosition = {
469
- x: number;
470
- y: number;
471
- id: number;
472
- timeOffset: number;
473
- };
474
-
475
- declare type mutationCallBack = (m: mutationCallbackParam) => void;
476
-
477
- declare type mutationCallbackParam = {
478
- texts: textMutation[];
479
- attributes: attributeMutation[];
480
- removes: removedNodeMutation[];
481
- adds: addedNodeMutation[];
482
- isAttachIframe?: true;
483
- };
484
-
485
- declare type mutationData = {
486
- source: IncrementalSource.Mutation;
487
- } & mutationCallbackParam;
488
-
489
- declare type mutationRecord = Readonly<{
490
- type: string;
491
- target: Node;
492
- oldValue: string | null;
493
- addedNodes: NodeList;
494
- removedNodes: NodeList;
495
- attributeName: string | null;
496
- attributeNamespace?: string | null;
497
- }>;
498
-
499
- declare enum NodeType {
500
- Document = 0,
501
- DocumentType = 1,
502
- Element = 2,
503
- Text = 3,
504
- CDATA = 4,
505
- Comment = 5
506
- }
507
-
508
- declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
509
-
510
- declare type PackFn = (event: eventWithTime) => string;
511
-
512
- declare type playerMetaData = {
513
- startTime: number;
514
- endTime: number;
515
- totalTime: number;
516
- };
517
-
518
- declare type pluginEvent<T = unknown> = {
519
- type: EventType.Plugin;
520
- data: {
521
- plugin: string;
522
- payload: T;
523
- };
524
- };
525
-
526
- declare enum PointerTypes {
527
- Mouse = 0,
528
- Pen = 1,
529
- Touch = 2
530
- }
531
-
532
- declare type RecordPlugin<TOptions = unknown> = {
533
- name: string;
534
- observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
535
- eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
536
- getMirror?: (mirrors: {
537
- nodeMirror: IMirror<Node>;
538
- crossOriginIframeMirror: ICrossOriginIframeMirror;
539
- crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
540
- }) => void;
541
- options: TOptions;
542
- };
543
-
544
- declare type removedNodeMutation = {
545
- parentId: number;
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
- interface Window {
733
- FontFace: typeof FontFace;
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, event_2 as 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 };
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 };