@sprig-technologies/sprig-browser 2.24.7 → 2.24.8

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/dist/index.d.ts CHANGED
@@ -1,3 +1,1635 @@
1
+ declare enum NodeType {
2
+ Document = 0,
3
+ DocumentType = 1,
4
+ Element = 2,
5
+ Text = 3,
6
+ CDATA = 4,
7
+ Comment = 5
8
+ }
9
+ type documentNode = {
10
+ type: NodeType.Document;
11
+ childNodes: serializedNodeWithId[];
12
+ compatMode?: string;
13
+ };
14
+ type documentTypeNode = {
15
+ type: NodeType.DocumentType;
16
+ name: string;
17
+ publicId: string;
18
+ systemId: string;
19
+ };
20
+ type attributes = {
21
+ [key: string]: string | number | true | null;
22
+ };
23
+ type elementNode = {
24
+ type: NodeType.Element;
25
+ tagName: string;
26
+ attributes: attributes;
27
+ childNodes: serializedNodeWithId[];
28
+ isSVG?: true;
29
+ needBlock?: boolean;
30
+ };
31
+ type textNode = {
32
+ type: NodeType.Text;
33
+ textContent: string;
34
+ isStyle?: true;
35
+ };
36
+ type cdataNode = {
37
+ type: NodeType.CDATA;
38
+ textContent: '';
39
+ };
40
+ type commentNode = {
41
+ type: NodeType.Comment;
42
+ textContent: string;
43
+ };
44
+ type serializedNode = (documentNode | documentTypeNode | elementNode | textNode | cdataNode | commentNode) & {
45
+ rootId?: number;
46
+ isShadowHost?: boolean;
47
+ isShadow?: boolean;
48
+ };
49
+ type serializedNodeWithId = serializedNode & {
50
+ id: number;
51
+ };
52
+ interface INode extends Node {
53
+ __sn: serializedNodeWithId;
54
+ }
55
+ interface IMirror<TNode> {
56
+ getId(n: TNode | undefined | null): number;
57
+ getNode(id: number): TNode | null;
58
+ getIds(): number[];
59
+ getMeta(n: TNode): serializedNodeWithId | null;
60
+ removeNodeFromMap(n: TNode): void;
61
+ has(id: number): boolean;
62
+ hasNode(node: TNode): boolean;
63
+ add(n: TNode, meta: serializedNodeWithId): void;
64
+ replace(id: number, n: TNode): void;
65
+ reset(): void;
66
+ }
67
+ type MaskInputOptions = Partial<{
68
+ color: boolean;
69
+ date: boolean;
70
+ 'datetime-local': boolean;
71
+ email: boolean;
72
+ month: boolean;
73
+ number: boolean;
74
+ range: boolean;
75
+ search: boolean;
76
+ tel: boolean;
77
+ text: boolean;
78
+ time: boolean;
79
+ url: boolean;
80
+ week: boolean;
81
+ textarea: boolean;
82
+ select: boolean;
83
+ password: boolean;
84
+ }>;
85
+ type SlimDOMOptions = Partial<{
86
+ script: boolean;
87
+ comment: boolean;
88
+ headFavicon: boolean;
89
+ headWhitespace: boolean;
90
+ headMetaDescKeywords: boolean;
91
+ headMetaSocial: boolean;
92
+ headMetaRobots: boolean;
93
+ headMetaHttpEquiv: boolean;
94
+ headMetaAuthorship: boolean;
95
+ headMetaVerification: boolean;
96
+ }>;
97
+ type DataURLOptions = Partial<{
98
+ type: string;
99
+ quality: number;
100
+ }>;
101
+ type MaskTextFn = (text: string) => string;
102
+ type MaskInputFn = (text: string, element: HTMLElement) => string;
103
+
104
+ declare class Mirror$1 implements IMirror<Node> {
105
+ private idNodeMap;
106
+ private nodeMetaMap;
107
+ getId(n: Node | undefined | null): number;
108
+ getNode(id: number): Node | null;
109
+ getIds(): number[];
110
+ getMeta(n: Node): serializedNodeWithId | null;
111
+ removeNodeFromMap(n: Node): void;
112
+ has(id: number): boolean;
113
+ hasNode(node: Node): boolean;
114
+ add(n: Node, meta: serializedNodeWithId): void;
115
+ replace(id: number, n: Node): void;
116
+ reset(): void;
117
+ }
118
+
119
+ declare enum EventType {
120
+ DomContentLoaded = 0,
121
+ Load = 1,
122
+ FullSnapshot = 2,
123
+ IncrementalSnapshot = 3,
124
+ Meta = 4,
125
+ Custom = 5,
126
+ Plugin = 6
127
+ }
128
+ type domContentLoadedEvent = {
129
+ type: EventType.DomContentLoaded;
130
+ data: unknown;
131
+ };
132
+ type loadedEvent = {
133
+ type: EventType.Load;
134
+ data: unknown;
135
+ };
136
+ type fullSnapshotEvent = {
137
+ type: EventType.FullSnapshot;
138
+ data: {
139
+ node: serializedNodeWithId;
140
+ initialOffset: {
141
+ top: number;
142
+ left: number;
143
+ };
144
+ };
145
+ };
146
+ type incrementalSnapshotEvent = {
147
+ type: EventType.IncrementalSnapshot;
148
+ data: incrementalData;
149
+ };
150
+ type metaEvent = {
151
+ type: EventType.Meta;
152
+ data: {
153
+ href: string;
154
+ width: number;
155
+ height: number;
156
+ };
157
+ };
158
+ type customEvent<T = unknown> = {
159
+ type: EventType.Custom;
160
+ data: {
161
+ tag: string;
162
+ payload: T;
163
+ };
164
+ };
165
+ type pluginEvent<T = unknown> = {
166
+ type: EventType.Plugin;
167
+ data: {
168
+ plugin: string;
169
+ payload: T;
170
+ };
171
+ };
172
+ declare enum IncrementalSource {
173
+ Mutation = 0,
174
+ MouseMove = 1,
175
+ MouseInteraction = 2,
176
+ Scroll = 3,
177
+ ViewportResize = 4,
178
+ Input = 5,
179
+ TouchMove = 6,
180
+ MediaInteraction = 7,
181
+ StyleSheetRule = 8,
182
+ CanvasMutation = 9,
183
+ Font = 10,
184
+ Log = 11,
185
+ Drag = 12,
186
+ StyleDeclaration = 13,
187
+ Selection = 14,
188
+ AdoptedStyleSheet = 15
189
+ }
190
+ type mutationData = {
191
+ source: IncrementalSource.Mutation;
192
+ } & mutationCallbackParam;
193
+ type mousemoveData = {
194
+ source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag;
195
+ positions: mousePosition[];
196
+ };
197
+ type mouseInteractionData = {
198
+ source: IncrementalSource.MouseInteraction;
199
+ } & mouseInteractionParam;
200
+ type scrollData = {
201
+ source: IncrementalSource.Scroll;
202
+ } & scrollPosition;
203
+ type viewportResizeData = {
204
+ source: IncrementalSource.ViewportResize;
205
+ } & viewportResizeDimension;
206
+ type inputData = {
207
+ source: IncrementalSource.Input;
208
+ id: number;
209
+ } & inputValue;
210
+ type mediaInteractionData = {
211
+ source: IncrementalSource.MediaInteraction;
212
+ } & mediaInteractionParam;
213
+ type styleSheetRuleData = {
214
+ source: IncrementalSource.StyleSheetRule;
215
+ } & styleSheetRuleParam;
216
+ type styleDeclarationData = {
217
+ source: IncrementalSource.StyleDeclaration;
218
+ } & styleDeclarationParam;
219
+ type canvasMutationData = {
220
+ source: IncrementalSource.CanvasMutation;
221
+ } & canvasMutationParam;
222
+ type fontData = {
223
+ source: IncrementalSource.Font;
224
+ } & fontParam;
225
+ type selectionData = {
226
+ source: IncrementalSource.Selection;
227
+ } & selectionParam;
228
+ type adoptedStyleSheetData = {
229
+ source: IncrementalSource.AdoptedStyleSheet;
230
+ } & adoptedStyleSheetParam;
231
+ type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData;
232
+ type event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent | pluginEvent;
233
+ type eventWithTime = event & {
234
+ timestamp: number;
235
+ delay?: number;
236
+ };
237
+ type canvasEventWithTime = eventWithTime & {
238
+ type: EventType.IncrementalSnapshot;
239
+ data: canvasMutationData;
240
+ };
241
+ type blockClass = string | RegExp;
242
+ type maskTextClass = string | RegExp;
243
+ type SamplingStrategy = Partial<{
244
+ mousemove: boolean | number;
245
+ mousemoveCallback: number;
246
+ mouseInteraction: boolean | Record<string, boolean | undefined>;
247
+ scroll: number;
248
+ media: number;
249
+ input: 'all' | 'last';
250
+ canvas: 'all' | number;
251
+ }>;
252
+ interface ICrossOriginIframeMirror {
253
+ getId(iframe: HTMLIFrameElement, remoteId: number, parentToRemoteMap?: Map<number, number>, remoteToParentMap?: Map<number, number>): number;
254
+ getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];
255
+ getRemoteId(iframe: HTMLIFrameElement, parentId: number, map?: Map<number, number>): number;
256
+ getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];
257
+ reset(iframe?: HTMLIFrameElement): void;
258
+ }
259
+ type RecordPlugin<TOptions = unknown> = {
260
+ name: string;
261
+ observer?: (cb: (...args: Array<unknown>) => void, win: IWindow, options: TOptions) => listenerHandler;
262
+ eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;
263
+ getMirror?: (mirrors: {
264
+ nodeMirror: Mirror$1;
265
+ crossOriginIframeMirror: ICrossOriginIframeMirror;
266
+ crossOriginIframeStyleMirror: ICrossOriginIframeMirror;
267
+ }) => void;
268
+ options: TOptions;
269
+ };
270
+ type hooksParam = {
271
+ mutation?: mutationCallBack;
272
+ mousemove?: mousemoveCallBack;
273
+ mouseInteraction?: mouseInteractionCallBack;
274
+ scroll?: scrollCallback;
275
+ viewportResize?: viewportResizeCallback;
276
+ input?: inputCallback;
277
+ mediaInteaction?: mediaInteractionCallback;
278
+ styleSheetRule?: styleSheetRuleCallback;
279
+ styleDeclaration?: styleDeclarationCallback;
280
+ canvasMutation?: canvasMutationCallback;
281
+ font?: fontCallback;
282
+ selection?: selectionCallback;
283
+ };
284
+ type textMutation = {
285
+ id: number;
286
+ value: string | null;
287
+ };
288
+ type styleOMValue = {
289
+ [key: string]: styleValueWithPriority | string | false;
290
+ };
291
+ type styleValueWithPriority = [string, string];
292
+ type attributeMutation = {
293
+ id: number;
294
+ attributes: {
295
+ [key: string]: string | styleOMValue | null;
296
+ };
297
+ };
298
+ type removedNodeMutation = {
299
+ parentId: number;
300
+ id: number;
301
+ isShadow?: boolean;
302
+ };
303
+ type addedNodeMutation = {
304
+ parentId: number;
305
+ previousId?: number | null;
306
+ nextId: number | null;
307
+ node: serializedNodeWithId;
308
+ };
309
+ type mutationCallbackParam = {
310
+ texts: textMutation[];
311
+ attributes: attributeMutation[];
312
+ removes: removedNodeMutation[];
313
+ adds: addedNodeMutation[];
314
+ isAttachIframe?: true;
315
+ };
316
+ type mutationCallBack = (m: mutationCallbackParam) => void;
317
+ type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove | IncrementalSource.Drag) => void;
318
+ type mousePosition = {
319
+ x: number;
320
+ y: number;
321
+ id: number;
322
+ timeOffset: number;
323
+ };
324
+ declare enum MouseInteractions {
325
+ MouseUp = 0,
326
+ MouseDown = 1,
327
+ Click = 2,
328
+ ContextMenu = 3,
329
+ DblClick = 4,
330
+ Focus = 5,
331
+ Blur = 6,
332
+ TouchStart = 7,
333
+ TouchMove_Departed = 8,
334
+ TouchEnd = 9,
335
+ TouchCancel = 10
336
+ }
337
+ declare enum PointerTypes {
338
+ Mouse = 0,
339
+ Pen = 1,
340
+ Touch = 2
341
+ }
342
+ declare enum CanvasContext {
343
+ '2D' = 0,
344
+ WebGL = 1,
345
+ WebGL2 = 2
346
+ }
347
+ type mouseInteractionParam = {
348
+ type: MouseInteractions;
349
+ id: number;
350
+ x: number;
351
+ y: number;
352
+ pointerType?: PointerTypes;
353
+ };
354
+ type mouseInteractionCallBack = (d: mouseInteractionParam) => void;
355
+ type scrollPosition = {
356
+ id: number;
357
+ x: number;
358
+ y: number;
359
+ };
360
+ type scrollCallback = (p: scrollPosition) => void;
361
+ type styleSheetAddRule = {
362
+ rule: string;
363
+ index?: number | number[];
364
+ };
365
+ type styleSheetDeleteRule = {
366
+ index: number | number[];
367
+ };
368
+ type styleSheetRuleParam = {
369
+ id?: number;
370
+ styleId?: number;
371
+ removes?: styleSheetDeleteRule[];
372
+ adds?: styleSheetAddRule[];
373
+ replace?: string;
374
+ replaceSync?: string;
375
+ };
376
+ type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
377
+ type adoptedStyleSheetParam = {
378
+ id: number;
379
+ styles?: {
380
+ styleId: number;
381
+ rules: styleSheetAddRule[];
382
+ }[];
383
+ styleIds: number[];
384
+ };
385
+ type styleDeclarationParam = {
386
+ id?: number;
387
+ styleId?: number;
388
+ index: number[];
389
+ set?: {
390
+ property: string;
391
+ value: string | null;
392
+ priority: string | undefined;
393
+ };
394
+ remove?: {
395
+ property: string;
396
+ };
397
+ };
398
+ type styleDeclarationCallback = (s: styleDeclarationParam) => void;
399
+ type canvasMutationCommand = {
400
+ property: string;
401
+ args: Array<unknown>;
402
+ setter?: true;
403
+ };
404
+ type canvasMutationParam = {
405
+ id: number;
406
+ type: CanvasContext;
407
+ commands: canvasMutationCommand[];
408
+ } | ({
409
+ id: number;
410
+ type: CanvasContext;
411
+ } & canvasMutationCommand);
412
+ type canvasMutationCallback = (p: canvasMutationParam) => void;
413
+ type fontParam = {
414
+ family: string;
415
+ fontSource: string;
416
+ buffer: boolean;
417
+ descriptors?: FontFaceDescriptors;
418
+ };
419
+ type fontCallback = (p: fontParam) => void;
420
+ type viewportResizeDimension = {
421
+ width: number;
422
+ height: number;
423
+ };
424
+ type viewportResizeCallback = (d: viewportResizeDimension) => void;
425
+ type inputValue = {
426
+ text: string;
427
+ isChecked: boolean;
428
+ userTriggered?: boolean;
429
+ };
430
+ type inputCallback = (v: inputValue & {
431
+ id: number;
432
+ }) => void;
433
+ declare const enum MediaInteractions {
434
+ Play = 0,
435
+ Pause = 1,
436
+ Seeked = 2,
437
+ VolumeChange = 3,
438
+ RateChange = 4
439
+ }
440
+ type mediaInteractionParam = {
441
+ type: MediaInteractions;
442
+ id: number;
443
+ currentTime?: number;
444
+ volume?: number;
445
+ muted?: boolean;
446
+ playbackRate?: number;
447
+ };
448
+ type mediaInteractionCallback = (p: mediaInteractionParam) => void;
449
+ type DocumentDimension = {
450
+ x: number;
451
+ y: number;
452
+ relativeScale: number;
453
+ absoluteScale: number;
454
+ };
455
+ type SelectionRange = {
456
+ start: number;
457
+ startOffset: number;
458
+ end: number;
459
+ endOffset: number;
460
+ };
461
+ type selectionParam = {
462
+ ranges: Array<SelectionRange>;
463
+ };
464
+ type selectionCallback = (p: selectionParam) => void;
465
+ type DeprecatedMirror = {
466
+ map: {
467
+ [key: number]: INode;
468
+ };
469
+ getId: (n: Node) => number;
470
+ getNode: (id: number) => INode | null;
471
+ removeNodeFromMap: (n: Node) => void;
472
+ has: (id: number) => boolean;
473
+ reset: () => void;
474
+ };
475
+ type throttleOptions = {
476
+ leading?: boolean;
477
+ trailing?: boolean;
478
+ };
479
+ type listenerHandler = () => void;
480
+ type hookResetter = () => void;
481
+ type playerMetaData = {
482
+ startTime: number;
483
+ endTime: number;
484
+ totalTime: number;
485
+ };
486
+ type actionWithDelay = {
487
+ doAction: () => void;
488
+ delay: number;
489
+ };
490
+ type Handler = (event?: unknown) => void;
491
+ type Emitter$1 = {
492
+ on(type: string, handler: Handler): void;
493
+ emit(type: string, event?: unknown): void;
494
+ off(type: string, handler: Handler): void;
495
+ };
496
+ declare enum ReplayerEvents {
497
+ Start = "start",
498
+ Pause = "pause",
499
+ Resume = "resume",
500
+ Resize = "resize",
501
+ Finish = "finish",
502
+ FullsnapshotRebuilded = "fullsnapshot-rebuilded",
503
+ LoadStylesheetStart = "load-stylesheet-start",
504
+ LoadStylesheetEnd = "load-stylesheet-end",
505
+ SkipStart = "skip-start",
506
+ SkipEnd = "skip-end",
507
+ MouseInteraction = "mouse-interaction",
508
+ EventCast = "event-cast",
509
+ CustomEvent = "custom-event",
510
+ Flush = "flush",
511
+ StateChange = "state-change",
512
+ PlayBack = "play-back",
513
+ Destroy = "destroy"
514
+ }
515
+ type KeepIframeSrcFn = (src: string) => boolean;
516
+ declare global {
517
+ interface Window {
518
+ FontFace: typeof FontFace;
519
+ }
520
+ }
521
+ type IWindow = Window & typeof globalThis;
522
+
523
+ type PackFn = (event: eventWithTime) => string;
524
+ type UnpackFn = (raw: string) => eventWithTime;
525
+
526
+ interface IRRNode {
527
+ parentElement: IRRNode | null;
528
+ parentNode: IRRNode | null;
529
+ ownerDocument: IRRDocument;
530
+ readonly childNodes: IRRNode[];
531
+ readonly ELEMENT_NODE: number;
532
+ readonly TEXT_NODE: number;
533
+ readonly nodeType: number;
534
+ readonly nodeName: string;
535
+ readonly RRNodeType: NodeType;
536
+ firstChild: IRRNode | null;
537
+ lastChild: IRRNode | null;
538
+ previousSibling: IRRNode | null;
539
+ nextSibling: IRRNode | null;
540
+ textContent: string | null;
541
+ contains(node: IRRNode): boolean;
542
+ appendChild(newChild: IRRNode): IRRNode;
543
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
544
+ removeChild(node: IRRNode): IRRNode;
545
+ toString(): string;
546
+ }
547
+ interface IRRDocument extends IRRNode {
548
+ documentElement: IRRElement | null;
549
+ body: IRRElement | null;
550
+ head: IRRElement | null;
551
+ implementation: IRRDocument;
552
+ firstElementChild: IRRElement | null;
553
+ readonly nodeName: '#document';
554
+ compatMode: 'BackCompat' | 'CSS1Compat';
555
+ createDocument(_namespace: string | null, _qualifiedName: string | null, _doctype?: DocumentType | null): IRRDocument;
556
+ createDocumentType(qualifiedName: string, publicId: string, systemId: string): IRRDocumentType;
557
+ createElement(tagName: string): IRRElement;
558
+ createElementNS(_namespaceURI: string, qualifiedName: string): IRRElement;
559
+ createTextNode(data: string): IRRText;
560
+ createComment(data: string): IRRComment;
561
+ createCDATASection(data: string): IRRCDATASection;
562
+ open(): void;
563
+ close(): void;
564
+ write(content: string): void;
565
+ }
566
+ interface IRRElement extends IRRNode {
567
+ tagName: string;
568
+ attributes: Record<string, string>;
569
+ shadowRoot: IRRElement | null;
570
+ scrollLeft?: number;
571
+ scrollTop?: number;
572
+ id: string;
573
+ className: string;
574
+ classList: ClassList;
575
+ style: CSSStyleDeclaration;
576
+ attachShadow(init: ShadowRootInit): IRRElement;
577
+ getAttribute(name: string): string | null;
578
+ setAttribute(name: string, attribute: string): void;
579
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
580
+ removeAttribute(name: string): void;
581
+ dispatchEvent(event: Event): boolean;
582
+ }
583
+ interface IRRDocumentType extends IRRNode {
584
+ readonly name: string;
585
+ readonly publicId: string;
586
+ readonly systemId: string;
587
+ }
588
+ interface IRRText extends IRRNode {
589
+ readonly nodeName: '#text';
590
+ data: string;
591
+ }
592
+ interface IRRComment extends IRRNode {
593
+ readonly nodeName: '#comment';
594
+ data: string;
595
+ }
596
+ interface IRRCDATASection extends IRRNode {
597
+ readonly nodeName: '#cdata-section';
598
+ data: string;
599
+ }
600
+ declare class BaseRRNode implements IRRNode {
601
+ parentElement: IRRNode | null;
602
+ parentNode: IRRNode | null;
603
+ ownerDocument: IRRDocument;
604
+ firstChild: IRRNode | null;
605
+ lastChild: IRRNode | null;
606
+ previousSibling: IRRNode | null;
607
+ nextSibling: IRRNode | null;
608
+ textContent: string | null;
609
+ readonly ELEMENT_NODE: number;
610
+ readonly TEXT_NODE: number;
611
+ readonly nodeType: number;
612
+ readonly nodeName: string;
613
+ readonly RRNodeType: NodeType;
614
+ constructor(..._args: any[]);
615
+ get childNodes(): IRRNode[];
616
+ contains(node: IRRNode): boolean;
617
+ appendChild(_newChild: IRRNode): IRRNode;
618
+ insertBefore(_newChild: IRRNode, _refChild: IRRNode | null): IRRNode;
619
+ removeChild(_node: IRRNode): IRRNode;
620
+ toString(): string;
621
+ }
622
+ declare class ClassList {
623
+ private onChange;
624
+ classes: string[];
625
+ constructor(classText?: string, onChange?: ((newClassText: string) => void) | undefined);
626
+ add: (...classNames: string[]) => void;
627
+ remove: (...classNames: string[]) => void;
628
+ }
629
+ type CSSStyleDeclaration = Record<string, string> & {
630
+ setProperty: (name: string, value: string | null, priority?: string | null) => void;
631
+ removeProperty: (name: string) => string;
632
+ };
633
+
634
+ declare const RRDocument_base: {
635
+ new (...args: any[]): {
636
+ readonly nodeType: number;
637
+ readonly nodeName: "#document";
638
+ readonly compatMode: "BackCompat" | "CSS1Compat";
639
+ readonly RRNodeType: NodeType.Document;
640
+ readonly documentElement: IRRElement | null;
641
+ readonly body: IRRElement | null;
642
+ readonly head: IRRElement | null;
643
+ readonly implementation: IRRDocument;
644
+ readonly firstElementChild: IRRElement | null;
645
+ appendChild(newChild: IRRNode): IRRNode;
646
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
647
+ removeChild(node: IRRNode): IRRNode;
648
+ open(): void;
649
+ close(): void;
650
+ write(content: string): void;
651
+ createDocument(_namespace: string | null, _qualifiedName: string | null, _doctype?: DocumentType | null | undefined): IRRDocument;
652
+ createDocumentType(qualifiedName: string, publicId: string, systemId: string): IRRDocumentType;
653
+ createElement(tagName: string): IRRElement;
654
+ createElementNS(_namespaceURI: string, qualifiedName: string): IRRElement;
655
+ createTextNode(data: string): IRRText;
656
+ createComment(data: string): IRRComment;
657
+ createCDATASection(data: string): IRRCDATASection;
658
+ toString(): string;
659
+ parentElement: IRRNode | null;
660
+ parentNode: IRRNode | null;
661
+ ownerDocument: IRRDocument;
662
+ readonly childNodes: IRRNode[];
663
+ readonly ELEMENT_NODE: number;
664
+ readonly TEXT_NODE: number;
665
+ firstChild: IRRNode | null;
666
+ lastChild: IRRNode | null;
667
+ previousSibling: IRRNode | null;
668
+ nextSibling: IRRNode | null;
669
+ textContent: string | null;
670
+ contains(node: IRRNode): boolean;
671
+ };
672
+ } & typeof BaseRRNode;
673
+ declare class RRDocument extends RRDocument_base {
674
+ private UNSERIALIZED_STARTING_ID;
675
+ private _unserializedId;
676
+ get unserializedId(): number;
677
+ mirror: Mirror;
678
+ scrollData: scrollData | null;
679
+ constructor(mirror?: Mirror);
680
+ createDocument(_namespace: string | null, _qualifiedName: string | null, _doctype?: DocumentType | null): RRDocument;
681
+ createDocumentType(qualifiedName: string, publicId: string, systemId: string): {
682
+ readonly nodeType: number;
683
+ readonly RRNodeType: NodeType.DocumentType;
684
+ readonly nodeName: string;
685
+ readonly name: string;
686
+ readonly publicId: string;
687
+ readonly systemId: string;
688
+ toString(): string;
689
+ parentElement: IRRNode | null;
690
+ parentNode: IRRNode | null;
691
+ ownerDocument: IRRDocument;
692
+ readonly childNodes: IRRNode[];
693
+ readonly ELEMENT_NODE: number;
694
+ readonly TEXT_NODE: number;
695
+ firstChild: IRRNode | null;
696
+ lastChild: IRRNode | null;
697
+ previousSibling: IRRNode | null;
698
+ nextSibling: IRRNode | null;
699
+ textContent: string | null;
700
+ contains(node: IRRNode): boolean;
701
+ appendChild(newChild: IRRNode): IRRNode;
702
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
703
+ removeChild(node: IRRNode): IRRNode;
704
+ } & BaseRRNode;
705
+ createElement<K extends keyof HTMLElementTagNameMap>(tagName: K): RRElementType<K>;
706
+ createElement(tagName: string): RRElement;
707
+ createComment(data: string): {
708
+ readonly nodeType: number;
709
+ readonly nodeName: "#comment";
710
+ readonly RRNodeType: NodeType.Comment;
711
+ data: string;
712
+ textContent: string;
713
+ toString(): string;
714
+ parentElement: IRRNode | null;
715
+ parentNode: IRRNode | null;
716
+ ownerDocument: IRRDocument;
717
+ readonly childNodes: IRRNode[];
718
+ readonly ELEMENT_NODE: number;
719
+ readonly TEXT_NODE: number;
720
+ firstChild: IRRNode | null;
721
+ lastChild: IRRNode | null;
722
+ previousSibling: IRRNode | null;
723
+ nextSibling: IRRNode | null;
724
+ contains(node: IRRNode): boolean;
725
+ appendChild(newChild: IRRNode): IRRNode;
726
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
727
+ removeChild(node: IRRNode): IRRNode;
728
+ } & BaseRRNode;
729
+ createCDATASection(data: string): {
730
+ readonly nodeName: "#cdata-section";
731
+ readonly nodeType: number;
732
+ readonly RRNodeType: NodeType.CDATA;
733
+ data: string;
734
+ textContent: string;
735
+ toString(): string;
736
+ parentElement: IRRNode | null;
737
+ parentNode: IRRNode | null;
738
+ ownerDocument: IRRDocument;
739
+ readonly childNodes: IRRNode[];
740
+ readonly ELEMENT_NODE: number;
741
+ readonly TEXT_NODE: number;
742
+ firstChild: IRRNode | null;
743
+ lastChild: IRRNode | null;
744
+ previousSibling: IRRNode | null;
745
+ nextSibling: IRRNode | null;
746
+ contains(node: IRRNode): boolean;
747
+ appendChild(newChild: IRRNode): IRRNode;
748
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
749
+ removeChild(node: IRRNode): IRRNode;
750
+ } & BaseRRNode;
751
+ createTextNode(data: string): {
752
+ readonly nodeType: number;
753
+ readonly nodeName: "#text";
754
+ readonly RRNodeType: NodeType.Text;
755
+ data: string;
756
+ textContent: string;
757
+ toString(): string;
758
+ parentElement: IRRNode | null;
759
+ parentNode: IRRNode | null;
760
+ ownerDocument: IRRDocument;
761
+ readonly childNodes: IRRNode[];
762
+ readonly ELEMENT_NODE: number;
763
+ readonly TEXT_NODE: number;
764
+ firstChild: IRRNode | null;
765
+ lastChild: IRRNode | null;
766
+ previousSibling: IRRNode | null;
767
+ nextSibling: IRRNode | null;
768
+ contains(node: IRRNode): boolean;
769
+ appendChild(newChild: IRRNode): IRRNode;
770
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
771
+ removeChild(node: IRRNode): IRRNode;
772
+ } & BaseRRNode;
773
+ destroyTree(): void;
774
+ open(): void;
775
+ }
776
+ declare const RRElement_base: {
777
+ new (tagName: string): {
778
+ readonly nodeType: number;
779
+ readonly RRNodeType: NodeType.Element;
780
+ readonly nodeName: string;
781
+ tagName: string;
782
+ attributes: Record<string, string>;
783
+ shadowRoot: IRRElement | null;
784
+ scrollLeft?: number | undefined;
785
+ scrollTop?: number | undefined;
786
+ textContent: string;
787
+ readonly classList: ClassList;
788
+ readonly id: string;
789
+ readonly className: string;
790
+ readonly style: CSSStyleDeclaration;
791
+ getAttribute(name: string): string | null;
792
+ setAttribute(name: string, attribute: string): void;
793
+ setAttributeNS(_namespace: string | null, qualifiedName: string, value: string): void;
794
+ removeAttribute(name: string): void;
795
+ appendChild(newChild: IRRNode): IRRNode;
796
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
797
+ removeChild(node: IRRNode): IRRNode;
798
+ attachShadow(_init: ShadowRootInit): IRRElement;
799
+ dispatchEvent(_event: Event): boolean;
800
+ toString(): string;
801
+ parentElement: IRRNode | null;
802
+ parentNode: IRRNode | null;
803
+ ownerDocument: IRRDocument;
804
+ readonly childNodes: IRRNode[];
805
+ readonly ELEMENT_NODE: number;
806
+ readonly TEXT_NODE: number;
807
+ firstChild: IRRNode | null;
808
+ lastChild: IRRNode | null;
809
+ previousSibling: IRRNode | null;
810
+ nextSibling: IRRNode | null;
811
+ contains(node: IRRNode): boolean;
812
+ };
813
+ } & typeof BaseRRNode;
814
+ declare class RRElement extends RRElement_base {
815
+ inputData: inputData | null;
816
+ scrollData: scrollData | null;
817
+ }
818
+ declare const RRMediaElement_base: {
819
+ new (...args: any[]): {
820
+ currentTime?: number | undefined;
821
+ volume?: number | undefined;
822
+ paused?: boolean | undefined;
823
+ muted?: boolean | undefined;
824
+ playbackRate?: number | undefined;
825
+ attachShadow(_init: ShadowRootInit): IRRElement;
826
+ play(): void;
827
+ pause(): void;
828
+ tagName: string;
829
+ attributes: Record<string, string>;
830
+ shadowRoot: IRRElement | null;
831
+ scrollLeft?: number | undefined;
832
+ scrollTop?: number | undefined;
833
+ id: string;
834
+ className: string;
835
+ classList: ClassList;
836
+ style: CSSStyleDeclaration;
837
+ getAttribute(name: string): string | null;
838
+ setAttribute(name: string, attribute: string): void;
839
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
840
+ removeAttribute(name: string): void;
841
+ dispatchEvent(event: Event): boolean;
842
+ parentElement: IRRNode | null;
843
+ parentNode: IRRNode | null;
844
+ ownerDocument: IRRDocument;
845
+ readonly childNodes: IRRNode[];
846
+ readonly ELEMENT_NODE: number;
847
+ readonly TEXT_NODE: number;
848
+ readonly nodeType: number;
849
+ readonly nodeName: string;
850
+ readonly RRNodeType: NodeType;
851
+ firstChild: IRRNode | null;
852
+ lastChild: IRRNode | null;
853
+ previousSibling: IRRNode | null;
854
+ nextSibling: IRRNode | null;
855
+ textContent: string | null;
856
+ contains(node: IRRNode): boolean;
857
+ appendChild(newChild: IRRNode): IRRNode;
858
+ insertBefore(newChild: IRRNode, refChild: IRRNode | null): IRRNode;
859
+ removeChild(node: IRRNode): IRRNode;
860
+ toString(): string;
861
+ };
862
+ } & typeof RRElement;
863
+ declare class RRMediaElement extends RRMediaElement_base {
864
+ }
865
+ declare class RRCanvasElement extends RRElement implements IRRElement {
866
+ rr_dataURL: string | null;
867
+ canvasMutations: {
868
+ event: canvasEventWithTime;
869
+ mutation: canvasMutationData;
870
+ }[];
871
+ getContext(): RenderingContext | null;
872
+ }
873
+ declare class RRStyleElement extends RRElement {
874
+ rules: (styleSheetRuleData | styleDeclarationData)[];
875
+ }
876
+ declare class RRIFrameElement extends RRElement {
877
+ contentDocument: RRDocument;
878
+ constructor(upperTagName: string, mirror: Mirror);
879
+ }
880
+ interface RRElementTagNameMap {
881
+ audio: RRMediaElement;
882
+ canvas: RRCanvasElement;
883
+ iframe: RRIFrameElement;
884
+ style: RRStyleElement;
885
+ video: RRMediaElement;
886
+ }
887
+ type RRElementType<K extends keyof HTMLElementTagNameMap> = K extends keyof RRElementTagNameMap ? RRElementTagNameMap[K] : RRElement;
888
+ declare class Mirror implements IMirror<BaseRRNode> {
889
+ private idNodeMap;
890
+ private nodeMetaMap;
891
+ getId(n: BaseRRNode | undefined | null): number;
892
+ getNode(id: number): BaseRRNode | null;
893
+ getIds(): number[];
894
+ getMeta(n: BaseRRNode): serializedNodeWithId | null;
895
+ removeNodeFromMap(n: BaseRRNode): void;
896
+ has(id: number): boolean;
897
+ hasNode(node: BaseRRNode): boolean;
898
+ add(n: BaseRRNode, meta: serializedNodeWithId): void;
899
+ replace(id: number, n: BaseRRNode): void;
900
+ reset(): void;
901
+ }
902
+
903
+ declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
904
+ declare let _mirror: DeprecatedMirror;
905
+ declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (...args: T[]) => void;
906
+ declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
907
+ declare function patch(source: {
908
+ [key: string]: any;
909
+ }, name: string, replacement: (...args: unknown[]) => unknown): () => void;
910
+ declare let nowTimestamp: () => number;
911
+
912
+ declare function getWindowScroll(win: Window): {
913
+ left: number;
914
+ top: number;
915
+ };
916
+ declare function getWindowHeight(): number;
917
+ declare function getWindowWidth(): number;
918
+ declare function isBlocked(node: Node | null, blockClass: blockClass, blockSelector: string | null, checkAncestors: boolean): boolean;
919
+ declare function isSerialized(n: Node, mirror: Mirror$1): boolean;
920
+ declare function isIgnored(n: Node, mirror: Mirror$1): boolean;
921
+ declare function isAncestorRemoved(target: Node, mirror: Mirror$1): boolean;
922
+ declare function legacy_isTouchEvent(event: MouseEvent | TouchEvent | PointerEvent): event is TouchEvent;
923
+ declare function polyfill(win?: Window & typeof globalThis): void;
924
+ type ResolveTree = {
925
+ value: addedNodeMutation;
926
+ children: ResolveTree[];
927
+ parent: ResolveTree | null;
928
+ };
929
+ declare function queueToResolveTrees(queue: addedNodeMutation[]): ResolveTree[];
930
+ declare function iterateResolveTree(tree: ResolveTree, cb: (mutation: addedNodeMutation) => unknown): void;
931
+ type AppendedIframe = {
932
+ mutationInQueue: addedNodeMutation;
933
+ builtNode: HTMLIFrameElement | RRIFrameElement;
934
+ };
935
+ declare function isSerializedIframe<TNode extends Node | BaseRRNode>(n: TNode, mirror: IMirror<TNode>): boolean;
936
+ declare function isSerializedStylesheet<TNode extends Node | BaseRRNode>(n: TNode, mirror: IMirror<TNode>): boolean;
937
+ declare function getBaseDimension(node: Node, rootIframe: Node): DocumentDimension;
938
+ declare function hasShadowRoot<T extends Node | BaseRRNode>(n: T): n is T & {
939
+ shadowRoot: ShadowRoot;
940
+ };
941
+ declare function getNestedRule(rules: CSSRuleList, position: number[]): CSSGroupingRule;
942
+ declare function getPositionsAndIndex(nestedIndex: number[]): {
943
+ positions: number[];
944
+ index: number | undefined;
945
+ };
946
+ declare function uniqueTextMutations(mutations: textMutation[]): textMutation[];
947
+ declare class StyleSheetMirror {
948
+ private id;
949
+ private styleIDMap;
950
+ private idStyleMap;
951
+ getId(stylesheet: CSSStyleSheet): number;
952
+ has(stylesheet: CSSStyleSheet): boolean;
953
+ add(stylesheet: CSSStyleSheet, id?: number): number;
954
+ getStyle(id: number): CSSStyleSheet | null;
955
+ reset(): void;
956
+ generateId(): number;
957
+ }
958
+ declare function getShadowHost(n: Node): Element | null;
959
+ declare function getRootShadowHost(n: Node): Node;
960
+ declare function shadowHostInDom(n: Node): boolean;
961
+ declare function inDom(n: Node): boolean;
962
+
963
+ type utils_d_AppendedIframe = AppendedIframe;
964
+ type utils_d_StyleSheetMirror = StyleSheetMirror;
965
+ declare const utils_d_StyleSheetMirror: typeof StyleSheetMirror;
966
+ declare const utils_d__mirror: typeof _mirror;
967
+ declare const utils_d_getBaseDimension: typeof getBaseDimension;
968
+ declare const utils_d_getNestedRule: typeof getNestedRule;
969
+ declare const utils_d_getPositionsAndIndex: typeof getPositionsAndIndex;
970
+ declare const utils_d_getRootShadowHost: typeof getRootShadowHost;
971
+ declare const utils_d_getShadowHost: typeof getShadowHost;
972
+ declare const utils_d_getWindowHeight: typeof getWindowHeight;
973
+ declare const utils_d_getWindowScroll: typeof getWindowScroll;
974
+ declare const utils_d_getWindowWidth: typeof getWindowWidth;
975
+ declare const utils_d_hasShadowRoot: typeof hasShadowRoot;
976
+ declare const utils_d_hookSetter: typeof hookSetter;
977
+ declare const utils_d_inDom: typeof inDom;
978
+ declare const utils_d_isAncestorRemoved: typeof isAncestorRemoved;
979
+ declare const utils_d_isBlocked: typeof isBlocked;
980
+ declare const utils_d_isIgnored: typeof isIgnored;
981
+ declare const utils_d_isSerialized: typeof isSerialized;
982
+ declare const utils_d_isSerializedIframe: typeof isSerializedIframe;
983
+ declare const utils_d_isSerializedStylesheet: typeof isSerializedStylesheet;
984
+ declare const utils_d_iterateResolveTree: typeof iterateResolveTree;
985
+ declare const utils_d_legacy_isTouchEvent: typeof legacy_isTouchEvent;
986
+ declare const utils_d_nowTimestamp: typeof nowTimestamp;
987
+ declare const utils_d_on: typeof on;
988
+ declare const utils_d_patch: typeof patch;
989
+ declare const utils_d_polyfill: typeof polyfill;
990
+ declare const utils_d_queueToResolveTrees: typeof queueToResolveTrees;
991
+ declare const utils_d_shadowHostInDom: typeof shadowHostInDom;
992
+ declare const utils_d_throttle: typeof throttle;
993
+ declare const utils_d_uniqueTextMutations: typeof uniqueTextMutations;
994
+ declare namespace utils_d {
995
+ export {
996
+ utils_d_AppendedIframe as AppendedIframe,
997
+ utils_d_StyleSheetMirror as StyleSheetMirror,
998
+ utils_d__mirror as _mirror,
999
+ utils_d_getBaseDimension as getBaseDimension,
1000
+ utils_d_getNestedRule as getNestedRule,
1001
+ utils_d_getPositionsAndIndex as getPositionsAndIndex,
1002
+ utils_d_getRootShadowHost as getRootShadowHost,
1003
+ utils_d_getShadowHost as getShadowHost,
1004
+ utils_d_getWindowHeight as getWindowHeight,
1005
+ utils_d_getWindowScroll as getWindowScroll,
1006
+ utils_d_getWindowWidth as getWindowWidth,
1007
+ utils_d_hasShadowRoot as hasShadowRoot,
1008
+ utils_d_hookSetter as hookSetter,
1009
+ utils_d_inDom as inDom,
1010
+ utils_d_isAncestorRemoved as isAncestorRemoved,
1011
+ utils_d_isBlocked as isBlocked,
1012
+ utils_d_isIgnored as isIgnored,
1013
+ utils_d_isSerialized as isSerialized,
1014
+ utils_d_isSerializedIframe as isSerializedIframe,
1015
+ utils_d_isSerializedStylesheet as isSerializedStylesheet,
1016
+ utils_d_iterateResolveTree as iterateResolveTree,
1017
+ utils_d_legacy_isTouchEvent as legacy_isTouchEvent,
1018
+ utils_d_nowTimestamp as nowTimestamp,
1019
+ utils_d_on as on,
1020
+ utils_d_patch as patch,
1021
+ utils_d_polyfill as polyfill,
1022
+ utils_d_queueToResolveTrees as queueToResolveTrees,
1023
+ utils_d_shadowHostInDom as shadowHostInDom,
1024
+ utils_d_throttle as throttle,
1025
+ utils_d_uniqueTextMutations as uniqueTextMutations,
1026
+ };
1027
+ }
1028
+
1029
+ declare class Timer {
1030
+ timeOffset: number;
1031
+ speed: number;
1032
+ private actions;
1033
+ private raf;
1034
+ private lastTimestamp;
1035
+ constructor(actions: actionWithDelay[] | undefined, config: {
1036
+ speed: number;
1037
+ });
1038
+ addAction(action: actionWithDelay): void;
1039
+ start(): void;
1040
+ private rafCheck;
1041
+ clear(): void;
1042
+ setSpeed(speed: number): void;
1043
+ isActive(): boolean;
1044
+ private findActionIndex;
1045
+ }
1046
+
1047
+ declare enum InterpreterStatus {
1048
+ NotStarted = 0,
1049
+ Running = 1,
1050
+ Stopped = 2
1051
+ }
1052
+ declare type SingleOrArray<T> = T[] | T;
1053
+ interface EventObject {
1054
+ type: string;
1055
+ }
1056
+ declare type InitEvent = {
1057
+ type: 'xstate.init';
1058
+ };
1059
+ declare namespace StateMachine {
1060
+ type Action<TContext extends object, TEvent extends EventObject> = string | AssignActionObject<TContext, TEvent> | ActionObject<TContext, TEvent> | ActionFunction<TContext, TEvent>;
1061
+ type ActionMap<TContext extends object, TEvent extends EventObject> = Record<string, Exclude<Action<TContext, TEvent>, string>>;
1062
+ interface ActionObject<TContext extends object, TEvent extends EventObject> {
1063
+ type: string;
1064
+ exec?: ActionFunction<TContext, TEvent>;
1065
+ [key: string]: any;
1066
+ }
1067
+ type ActionFunction<TContext extends object, TEvent extends EventObject> = (context: TContext, event: TEvent | InitEvent) => void;
1068
+ type AssignAction = 'xstate.assign';
1069
+ interface AssignActionObject<TContext extends object, TEvent extends EventObject> extends ActionObject<TContext, TEvent> {
1070
+ type: AssignAction;
1071
+ assignment: Assigner<TContext, TEvent> | PropertyAssigner<TContext, TEvent>;
1072
+ }
1073
+ type Transition<TContext extends object, TEvent extends EventObject> = string | {
1074
+ target?: string;
1075
+ actions?: SingleOrArray<Action<TContext, TEvent>>;
1076
+ cond?: (context: TContext, event: TEvent) => boolean;
1077
+ };
1078
+ interface State<TContext extends object, TEvent extends EventObject, TState extends Typestate<TContext>> {
1079
+ value: TState['value'];
1080
+ context: TContext;
1081
+ actions: Array<ActionObject<TContext, TEvent>>;
1082
+ changed?: boolean | undefined;
1083
+ matches: <TSV extends TState['value']>(value: TSV) => this is TState extends {
1084
+ value: TSV;
1085
+ } ? TState & {
1086
+ value: TSV;
1087
+ } : never;
1088
+ }
1089
+ type AnyState = State<any, any, any>;
1090
+ interface Config<TContext extends object, TEvent extends EventObject, TState extends Typestate<TContext> = {
1091
+ value: any;
1092
+ context: TContext;
1093
+ }> {
1094
+ id?: string;
1095
+ initial: string;
1096
+ context?: TContext;
1097
+ states: {
1098
+ [key in TState['value']]: {
1099
+ on?: {
1100
+ [K in TEvent['type']]?: SingleOrArray<Transition<TContext, TEvent extends {
1101
+ type: K;
1102
+ } ? TEvent : never>>;
1103
+ };
1104
+ exit?: SingleOrArray<Action<TContext, TEvent>>;
1105
+ entry?: SingleOrArray<Action<TContext, TEvent>>;
1106
+ };
1107
+ };
1108
+ }
1109
+ interface Machine<TContext extends object, TEvent extends EventObject, TState extends Typestate<TContext>> {
1110
+ config: StateMachine.Config<TContext, TEvent, TState>;
1111
+ initialState: State<TContext, TEvent, TState>;
1112
+ transition: (state: string | State<TContext, TEvent, TState>, event: TEvent['type'] | TEvent) => State<TContext, TEvent, TState>;
1113
+ }
1114
+ type StateListener<T extends AnyState> = (state: T) => void;
1115
+ interface Service<TContext extends object, TEvent extends EventObject, TState extends Typestate<TContext> = {
1116
+ value: any;
1117
+ context: TContext;
1118
+ }> {
1119
+ send: (event: TEvent | TEvent['type']) => void;
1120
+ subscribe: (listener: StateListener<State<TContext, TEvent, TState>>) => {
1121
+ unsubscribe: () => void;
1122
+ };
1123
+ start: (initialState?: TState['value'] | {
1124
+ context: TContext;
1125
+ value: TState['value'];
1126
+ }) => Service<TContext, TEvent, TState>;
1127
+ stop: () => Service<TContext, TEvent, TState>;
1128
+ readonly status: InterpreterStatus;
1129
+ readonly state: State<TContext, TEvent, TState>;
1130
+ }
1131
+ type Assigner<TContext extends object, TEvent extends EventObject> = (context: TContext, event: TEvent) => Partial<TContext>;
1132
+ type PropertyAssigner<TContext extends object, TEvent extends EventObject> = {
1133
+ [K in keyof TContext]?: ((context: TContext, event: TEvent) => TContext[K]) | TContext[K];
1134
+ };
1135
+ }
1136
+ interface Typestate<TContext extends object> {
1137
+ value: string;
1138
+ context: TContext;
1139
+ }
1140
+
1141
+ type PlayerContext = {
1142
+ events: eventWithTime[];
1143
+ timer: Timer;
1144
+ timeOffset: number;
1145
+ baselineTime: number;
1146
+ lastPlayedEvent: eventWithTime | null;
1147
+ };
1148
+ type PlayerEvent = {
1149
+ type: 'PLAY';
1150
+ payload: {
1151
+ timeOffset: number;
1152
+ };
1153
+ } | {
1154
+ type: 'CAST_EVENT';
1155
+ payload: {
1156
+ event: eventWithTime;
1157
+ };
1158
+ } | {
1159
+ type: 'PAUSE';
1160
+ } | {
1161
+ type: 'TO_LIVE';
1162
+ payload: {
1163
+ baselineTime?: number;
1164
+ };
1165
+ } | {
1166
+ type: 'ADD_EVENT';
1167
+ payload: {
1168
+ event: eventWithTime;
1169
+ };
1170
+ } | {
1171
+ type: 'END';
1172
+ };
1173
+ type PlayerState = {
1174
+ value: 'playing';
1175
+ context: PlayerContext;
1176
+ } | {
1177
+ value: 'paused';
1178
+ context: PlayerContext;
1179
+ } | {
1180
+ value: 'live';
1181
+ context: PlayerContext;
1182
+ };
1183
+ type PlayerAssets = {
1184
+ emitter: Emitter$1;
1185
+ applyEventsSynchronously(events: Array<eventWithTime>): void;
1186
+ getCastFn(event: eventWithTime, isSync: boolean): () => void;
1187
+ };
1188
+ declare function createPlayerService(context: PlayerContext, { getCastFn, applyEventsSynchronously, emitter }: PlayerAssets): StateMachine.Service<PlayerContext, PlayerEvent, PlayerState>;
1189
+ type SpeedContext = {
1190
+ normalSpeed: playerConfig['speed'];
1191
+ timer: Timer;
1192
+ };
1193
+ type SpeedEvent = {
1194
+ type: 'FAST_FORWARD';
1195
+ payload: {
1196
+ speed: playerConfig['speed'];
1197
+ };
1198
+ } | {
1199
+ type: 'BACK_TO_NORMAL';
1200
+ } | {
1201
+ type: 'SET_SPEED';
1202
+ payload: {
1203
+ speed: playerConfig['speed'];
1204
+ };
1205
+ };
1206
+ type SpeedState = {
1207
+ value: 'normal';
1208
+ context: SpeedContext;
1209
+ } | {
1210
+ value: 'skipping';
1211
+ context: SpeedContext;
1212
+ };
1213
+ declare function createSpeedService(context: SpeedContext): StateMachine.Service<SpeedContext, SpeedEvent, SpeedState>;
1214
+
1215
+ declare class Replayer {
1216
+ wrapper: HTMLDivElement;
1217
+ iframe: HTMLIFrameElement;
1218
+ service: ReturnType<typeof createPlayerService>;
1219
+ speedService: ReturnType<typeof createSpeedService>;
1220
+ get timer(): Timer;
1221
+ config: playerConfig;
1222
+ usingVirtualDom: boolean;
1223
+ virtualDom: RRDocument;
1224
+ private mouse;
1225
+ private mouseTail;
1226
+ private tailPositions;
1227
+ private emitter;
1228
+ private nextUserInteractionEvent;
1229
+ private legacy_missingNodeRetryMap;
1230
+ private cache;
1231
+ private imageMap;
1232
+ private canvasEventMap;
1233
+ private mirror;
1234
+ private styleMirror;
1235
+ private firstFullSnapshot;
1236
+ private newDocumentQueue;
1237
+ private mousePos;
1238
+ private touchActive;
1239
+ private lastMouseDownEvent;
1240
+ private lastHoveredRootNode;
1241
+ private lastSelectionData;
1242
+ private constructedStyleMutations;
1243
+ private adoptedStyleSheets;
1244
+ constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
1245
+ on(event: string, handler: Handler): this;
1246
+ off(event: string, handler: Handler): this;
1247
+ setConfig(config: Partial<playerConfig>): void;
1248
+ getMetaData(): playerMetaData;
1249
+ getCurrentTime(): number;
1250
+ getTimeOffset(): number;
1251
+ getMirror(): Mirror$1;
1252
+ play(timeOffset?: number): void;
1253
+ pause(timeOffset?: number): void;
1254
+ resume(timeOffset?: number): void;
1255
+ destroy(): void;
1256
+ startLive(baselineTime?: number): void;
1257
+ addEvent(rawEvent: eventWithTime | string): void;
1258
+ enableInteract(): void;
1259
+ disableInteract(): void;
1260
+ resetCache(): void;
1261
+ private setupDom;
1262
+ private handleResize;
1263
+ private applyEventsSynchronously;
1264
+ private getCastFn;
1265
+ private rebuildFullSnapshot;
1266
+ private insertStyleRules;
1267
+ private attachDocumentToIframe;
1268
+ private collectIframeAndAttachDocument;
1269
+ private waitForStylesheetLoad;
1270
+ private preloadAllImages;
1271
+ private preloadImages;
1272
+ private deserializeAndPreloadCanvasEvents;
1273
+ private applyIncremental;
1274
+ private applyMutation;
1275
+ private applyScroll;
1276
+ private applyInput;
1277
+ private applySelection;
1278
+ private applyStyleSheetMutation;
1279
+ private applyStyleSheetRule;
1280
+ private applyStyleDeclaration;
1281
+ private applyAdoptedStyleSheet;
1282
+ private legacy_resolveMissingNode;
1283
+ private moveAndHover;
1284
+ private drawMouseTail;
1285
+ private hoverElements;
1286
+ private isUserInteraction;
1287
+ private backToNormal;
1288
+ private warnNodeNotFound;
1289
+ private warnCanvasMutationFailed;
1290
+ private debugNodeNotFound;
1291
+ private warn;
1292
+ private debug;
1293
+ }
1294
+
1295
+ type recordOptions<T> = {
1296
+ emit?: (e: T, isCheckout?: boolean) => void;
1297
+ checkoutEveryNth?: number;
1298
+ checkoutEveryNms?: number;
1299
+ blockClass?: blockClass;
1300
+ blockSelector?: string;
1301
+ ignoreClass?: string;
1302
+ ignoreSelector?: string;
1303
+ maskTextClass?: maskTextClass;
1304
+ maskTextSelector?: string;
1305
+ maskAllInputs?: boolean;
1306
+ maskInputOptions?: MaskInputOptions;
1307
+ maskInputFn?: MaskInputFn;
1308
+ maskTextFn?: MaskTextFn;
1309
+ slimDOMOptions?: SlimDOMOptions | 'all' | true;
1310
+ ignoreCSSAttributes?: Set<string>;
1311
+ inlineStylesheet?: boolean;
1312
+ hooks?: hooksParam;
1313
+ packFn?: PackFn;
1314
+ sampling?: SamplingStrategy;
1315
+ dataURLOptions?: DataURLOptions;
1316
+ recordCanvas?: boolean;
1317
+ recordCrossOriginIframes?: boolean;
1318
+ recordAfter?: 'DOMContentLoaded' | 'load';
1319
+ userTriggeredOnInput?: boolean;
1320
+ collectFonts?: boolean;
1321
+ inlineImages?: boolean;
1322
+ plugins?: RecordPlugin[];
1323
+ mousemoveWait?: number;
1324
+ keepIframeSrcFn?: KeepIframeSrcFn;
1325
+ errorHandler?: ErrorHandler;
1326
+ };
1327
+ type ReplayPlugin = {
1328
+ handler?: (event: eventWithTime, isSync: boolean, context: {
1329
+ replayer: Replayer;
1330
+ }) => void;
1331
+ onBuild?: (node: Node | BaseRRNode, context: {
1332
+ id: number;
1333
+ replayer: Replayer;
1334
+ }) => void;
1335
+ getMirror?: (mirrors: {
1336
+ nodeMirror: Mirror$1;
1337
+ }) => void;
1338
+ };
1339
+ type playerConfig = {
1340
+ speed: number;
1341
+ maxSpeed: number;
1342
+ root: Element;
1343
+ loadTimeout: number;
1344
+ skipInactive: boolean;
1345
+ showWarning: boolean;
1346
+ showDebug: boolean;
1347
+ blockClass: string;
1348
+ liveMode: boolean;
1349
+ insertStyleRules: string[];
1350
+ triggerFocus: boolean;
1351
+ UNSAFE_replayCanvas: boolean;
1352
+ pauseAnimation?: boolean;
1353
+ mouseTail: boolean | {
1354
+ duration?: number;
1355
+ lineCap?: string;
1356
+ lineWidth?: number;
1357
+ strokeStyle?: string;
1358
+ };
1359
+ unpackFn?: UnpackFn;
1360
+ useVirtualDom: boolean;
1361
+ logger: {
1362
+ log: (...args: Parameters<typeof console.log>) => void;
1363
+ warn: (...args: Parameters<typeof console.warn>) => void;
1364
+ };
1365
+ plugins?: ReplayPlugin[];
1366
+ };
1367
+ declare global {
1368
+ interface Window {
1369
+ FontFace: typeof FontFace;
1370
+ }
1371
+ }
1372
+ type ErrorHandler = (error: unknown) => void | boolean;
1373
+
1374
+ declare function record<T = eventWithTime>(options?: recordOptions<T>): listenerHandler | undefined;
1375
+ declare namespace record {
1376
+ var addCustomEvent: <T>(tag: string, payload: T) => void;
1377
+ var freezePage: () => void;
1378
+ var takeFullSnapshot: (isCheckout?: boolean | undefined) => void;
1379
+ var mirror: Mirror$1;
1380
+ }
1381
+
1382
+ declare const addCustomEvent: <T>(tag: string, payload: T) => void;
1383
+ declare const freezePage: () => void;
1384
+
1385
+ declare const pack: PackFn;
1386
+
1387
+ declare const unpack: UnpackFn;
1388
+
1389
+ type StringifyOptions = {
1390
+ stringLengthLimit?: number;
1391
+ numOfKeysLimit: number;
1392
+ depthOfLimit: number;
1393
+ };
1394
+ type LogRecordOptions = {
1395
+ level?: LogLevel[];
1396
+ lengthThreshold?: number;
1397
+ stringifyOptions?: StringifyOptions;
1398
+ logger?: Logger | 'console';
1399
+ };
1400
+ type LogData = {
1401
+ level: LogLevel;
1402
+ trace: string[];
1403
+ payload: string[];
1404
+ };
1405
+ type Logger = {
1406
+ assert?: typeof console.assert;
1407
+ clear?: typeof console.clear;
1408
+ count?: typeof console.count;
1409
+ countReset?: typeof console.countReset;
1410
+ debug?: typeof console.debug;
1411
+ dir?: typeof console.dir;
1412
+ dirxml?: typeof console.dirxml;
1413
+ error?: typeof console.error;
1414
+ group?: typeof console.group;
1415
+ groupCollapsed?: typeof console.groupCollapsed;
1416
+ groupEnd?: () => void;
1417
+ info?: typeof console.info;
1418
+ log?: typeof console.log;
1419
+ table?: typeof console.table;
1420
+ time?: typeof console.time;
1421
+ timeEnd?: typeof console.timeEnd;
1422
+ timeLog?: typeof console.timeLog;
1423
+ trace?: typeof console.trace;
1424
+ warn?: typeof console.warn;
1425
+ };
1426
+ type LogLevel = keyof Logger;
1427
+ declare const PLUGIN_NAME = "rrweb/console@1";
1428
+ declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
1429
+
1430
+ type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
1431
+ type LogReplayConfig = {
1432
+ level?: LogLevel[];
1433
+ replayLogger?: ReplayLogger;
1434
+ };
1435
+ declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
1436
+
1437
+ type rrweb_EventType = EventType;
1438
+ declare const rrweb_EventType: typeof EventType;
1439
+ type rrweb_IncrementalSource = IncrementalSource;
1440
+ declare const rrweb_IncrementalSource: typeof IncrementalSource;
1441
+ type rrweb_LogData = LogData;
1442
+ type rrweb_LogLevel = LogLevel;
1443
+ type rrweb_Logger = Logger;
1444
+ type rrweb_MouseInteractions = MouseInteractions;
1445
+ declare const rrweb_MouseInteractions: typeof MouseInteractions;
1446
+ declare const rrweb_PLUGIN_NAME: typeof PLUGIN_NAME;
1447
+ type rrweb_Replayer = Replayer;
1448
+ declare const rrweb_Replayer: typeof Replayer;
1449
+ type rrweb_ReplayerEvents = ReplayerEvents;
1450
+ declare const rrweb_ReplayerEvents: typeof ReplayerEvents;
1451
+ type rrweb_StringifyOptions = StringifyOptions;
1452
+ declare const rrweb_addCustomEvent: typeof addCustomEvent;
1453
+ declare const rrweb_freezePage: typeof freezePage;
1454
+ declare const rrweb_getRecordConsolePlugin: typeof getRecordConsolePlugin;
1455
+ declare const rrweb_getReplayConsolePlugin: typeof getReplayConsolePlugin;
1456
+ declare const rrweb_pack: typeof pack;
1457
+ declare const rrweb_record: typeof record;
1458
+ type rrweb_recordOptions<T> = recordOptions<T>;
1459
+ declare const rrweb_unpack: typeof unpack;
1460
+ declare namespace rrweb {
1461
+ export {
1462
+ rrweb_EventType as EventType,
1463
+ rrweb_IncrementalSource as IncrementalSource,
1464
+ rrweb_LogData as LogData,
1465
+ rrweb_LogLevel as LogLevel,
1466
+ rrweb_Logger as Logger,
1467
+ rrweb_MouseInteractions as MouseInteractions,
1468
+ rrweb_PLUGIN_NAME as PLUGIN_NAME,
1469
+ rrweb_Replayer as Replayer,
1470
+ rrweb_ReplayerEvents as ReplayerEvents,
1471
+ rrweb_StringifyOptions as StringifyOptions,
1472
+ rrweb_addCustomEvent as addCustomEvent,
1473
+ rrweb_freezePage as freezePage,
1474
+ rrweb_getRecordConsolePlugin as getRecordConsolePlugin,
1475
+ rrweb_getReplayConsolePlugin as getReplayConsolePlugin,
1476
+ _mirror as mirror,
1477
+ rrweb_pack as pack,
1478
+ rrweb_record as record,
1479
+ rrweb_recordOptions as recordOptions,
1480
+ rrweb_unpack as unpack,
1481
+ utils_d as utils,
1482
+ };
1483
+ }
1484
+
1485
+ interface XhrResponse {
1486
+ body: Object | string;
1487
+ statusCode: number;
1488
+ method: string;
1489
+ headers: XhrHeaders;
1490
+ url: string;
1491
+ rawRequest: XMLHttpRequest;
1492
+ }
1493
+
1494
+ interface XhrHeaders {
1495
+ [key: string]: string;
1496
+ }
1497
+
1498
+ declare const isValidChunkSize: (chunkSize: any, { minChunkSize, maxChunkSize, }?: {
1499
+ minChunkSize?: number | undefined;
1500
+ maxChunkSize?: number | undefined;
1501
+ }) => chunkSize is number | null | undefined;
1502
+ declare const getChunkSizeError: (chunkSize: any, { minChunkSize, maxChunkSize, }?: {
1503
+ minChunkSize?: number | undefined;
1504
+ maxChunkSize?: number | undefined;
1505
+ }) => TypeError;
1506
+ declare type ChunkedStreamIterableOptions = {
1507
+ defaultChunkSize?: number;
1508
+ minChunkSize?: number;
1509
+ maxChunkSize?: number;
1510
+ };
1511
+ declare class ChunkedStreamIterable implements AsyncIterable<Blob> {
1512
+ protected readableStream: ReadableStream<Uint8Array | Blob>;
1513
+ protected _chunkSize: number | undefined;
1514
+ protected defaultChunkSize: number;
1515
+ readonly minChunkSize: number;
1516
+ readonly maxChunkSize: number;
1517
+ constructor(readableStream: ReadableStream<Uint8Array | Blob>, options?: ChunkedStreamIterableOptions);
1518
+ get chunkSize(): number;
1519
+ set chunkSize(value: number);
1520
+ get chunkByteSize(): number;
1521
+ [Symbol.asyncIterator](): AsyncIterator<Blob>;
1522
+ }
1523
+ declare type EventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success';
1524
+ declare type AllowedMethods = 'PUT' | 'POST' | 'PATCH';
1525
+ interface UpChunkOptions {
1526
+ endpoint: string | ((file?: File) => Promise<string>);
1527
+ file: File;
1528
+ method?: AllowedMethods;
1529
+ headers?: XhrHeaders | (() => XhrHeaders) | (() => Promise<XhrHeaders>);
1530
+ maxFileSize?: number;
1531
+ chunkSize?: number;
1532
+ attempts?: number;
1533
+ delayBeforeAttempt?: number;
1534
+ retryCodes?: number[];
1535
+ dynamicChunkSize?: boolean;
1536
+ maxChunkSize?: number;
1537
+ minChunkSize?: number;
1538
+ }
1539
+ declare class UpChunk {
1540
+ static createUpload(options: UpChunkOptions): UpChunk;
1541
+ endpoint: string | ((file?: File) => Promise<string>);
1542
+ file: File;
1543
+ headers: XhrHeaders | (() => XhrHeaders) | (() => Promise<XhrHeaders>);
1544
+ method: AllowedMethods;
1545
+ attempts: number;
1546
+ delayBeforeAttempt: number;
1547
+ retryCodes: number[];
1548
+ dynamicChunkSize: boolean;
1549
+ protected chunkedStreamIterable: ChunkedStreamIterable;
1550
+ protected chunkedStreamIterator: AsyncIterator<Blob, any, undefined>;
1551
+ protected pendingChunk?: Blob;
1552
+ private chunkCount;
1553
+ private maxFileBytes;
1554
+ private endpointValue;
1555
+ private totalChunks;
1556
+ private attemptCount;
1557
+ private offline;
1558
+ private _paused;
1559
+ private success;
1560
+ private currentXhr?;
1561
+ private lastChunkStart;
1562
+ private nextChunkRangeStart;
1563
+ private eventTarget;
1564
+ constructor(options: UpChunkOptions);
1565
+ protected get maxChunkSize(): number;
1566
+ protected get minChunkSize(): number;
1567
+ get chunkSize(): number;
1568
+ set chunkSize(value: number);
1569
+ get chunkByteSize(): number;
1570
+ get totalChunkSize(): number;
1571
+ /**
1572
+ * Subscribe to an event
1573
+ */
1574
+ on(eventName: EventName, fn: (event: CustomEvent) => void): void;
1575
+ /**
1576
+ * Subscribe to an event once
1577
+ */
1578
+ once(eventName: EventName, fn: (event: CustomEvent) => void): void;
1579
+ /**
1580
+ * Unsubscribe to an event
1581
+ */
1582
+ off(eventName: EventName, fn: (event: CustomEvent) => void): void;
1583
+ get paused(): boolean;
1584
+ abort(): void;
1585
+ pause(): void;
1586
+ resume(): void;
1587
+ /**
1588
+ * Dispatch an event
1589
+ */
1590
+ private dispatch;
1591
+ /**
1592
+ * Validate options and throw errors if expectations are violated.
1593
+ */
1594
+ private validateOptions;
1595
+ /**
1596
+ * Endpoint can either be a URL or a function that returns a promise that resolves to a string.
1597
+ */
1598
+ private getEndpoint;
1599
+ private xhrPromise;
1600
+ /**
1601
+ * Send chunk of the file with appropriate headers
1602
+ */
1603
+ protected sendChunk(chunk: Blob): Promise<XhrResponse>;
1604
+ protected sendChunkWithRetries(chunk: Blob): Promise<boolean>;
1605
+ /**
1606
+ * Manage the whole upload by calling getChunk & sendChunk
1607
+ * handle errors & retries and dispatch events
1608
+ */
1609
+ private sendChunks;
1610
+ }
1611
+ declare const createUpload$1: typeof UpChunk.createUpload;
1612
+
1613
+ type _mux_upchunk_ChunkedStreamIterable = ChunkedStreamIterable;
1614
+ declare const _mux_upchunk_ChunkedStreamIterable: typeof ChunkedStreamIterable;
1615
+ type _mux_upchunk_ChunkedStreamIterableOptions = ChunkedStreamIterableOptions;
1616
+ type _mux_upchunk_UpChunk = UpChunk;
1617
+ declare const _mux_upchunk_UpChunk: typeof UpChunk;
1618
+ type _mux_upchunk_UpChunkOptions = UpChunkOptions;
1619
+ declare const _mux_upchunk_getChunkSizeError: typeof getChunkSizeError;
1620
+ declare const _mux_upchunk_isValidChunkSize: typeof isValidChunkSize;
1621
+ declare namespace _mux_upchunk {
1622
+ export {
1623
+ _mux_upchunk_ChunkedStreamIterable as ChunkedStreamIterable,
1624
+ _mux_upchunk_ChunkedStreamIterableOptions as ChunkedStreamIterableOptions,
1625
+ _mux_upchunk_UpChunk as UpChunk,
1626
+ _mux_upchunk_UpChunkOptions as UpChunkOptions,
1627
+ createUpload$1 as createUpload,
1628
+ _mux_upchunk_getChunkSizeError as getChunkSizeError,
1629
+ _mux_upchunk_isValidChunkSize as isValidChunkSize,
1630
+ };
1631
+ }
1632
+
1
1633
  declare enum NOTIFICATION_TYPES {
2
1634
  ACTIVATE = "ACTIVATE:experiment, user_id,attributes, variation, event",
3
1635
  DECISION = "DECISION:type, userId, attributes, decisionInfo",
@@ -846,6 +2478,7 @@ declare const enum Platform {
846
2478
  }
847
2479
  declare const enum InstallationMethod {
848
2480
  Npm = "web-npm",
2481
+ NpmBundled = "web-npm-bundled",
849
2482
  Gtm = "web-gtm",
850
2483
  Segment = "web-segment",
851
2484
  SegmentAndroid = "android-segment",
@@ -934,6 +2567,7 @@ interface Config {
934
2567
  path?: string;
935
2568
  platform?: Platform;
936
2569
  previewKey?: string | null;
2570
+ previewLanguage?: string;
937
2571
  replayNonce?: string;
938
2572
  replaySettings?: object;
939
2573
  requireUserIdForTracking: boolean;
@@ -1027,44 +2661,6 @@ declare namespace optimizely {
1027
2661
  }
1028
2662
  }
1029
2663
 
1030
- declare namespace upchunk {
1031
- type AllowedMethods = "PUT" | "POST" | "PATCH";
1032
-
1033
- //Adapted from here: https://github.com/muxinc/upchunk/blob/master/src/upchunk.ts
1034
- interface UpChunkOptions {
1035
- endpoint: string | ((file?: File) => Promise<string>);
1036
- file: File;
1037
- method?: AllowedMethods;
1038
- headers?: Headers;
1039
- maxFileSize?: number;
1040
- chunkSize?: number;
1041
- attempts?: number;
1042
- delayBeforeAttempt?: number;
1043
- retryCodes?: number[];
1044
- dynamicChunkSize?: boolean;
1045
- maxChunkSize?: number;
1046
- minChunkSize?: number;
1047
- }
1048
-
1049
- type UpChunkEventName =
1050
- | "attempt"
1051
- | "attemptFailure"
1052
- | "chunkSuccess"
1053
- | "error"
1054
- | "offline"
1055
- | "online"
1056
- | "progress"
1057
- | "success";
1058
-
1059
- interface UpChunk {
1060
- startTime: number;
1061
- on: (eventName: UpChunkEventName, fn: (event: CustomEvent) => void) => void;
1062
- }
1063
- interface UpChunkModule {
1064
- createUpload: (options: UpChunkOptions) => UpChunk;
1065
- }
1066
- }
1067
-
1068
2664
  declare namespace sprigConfig {
1069
2665
  type IdentifyResult = Promise<
1070
2666
  | {
@@ -1210,7 +2806,14 @@ declare namespace sprigConfig {
1210
2806
  };
1211
2807
  };
1212
2808
  }
1213
-
2809
+ type ArgumentTypes<F> = F extends (...args: infer A) => unknown ? A : never;
2810
+ type ArgumentType<T> = T extends (arg1: infer U, ...args: unknown[]) => unknown
2811
+ ? U
2812
+ : unknown;
2813
+ type PublicOf<T> = { [K in keyof T]: T[K] };
2814
+ type createUpload = typeof _mux_upchunk["createUpload"];
2815
+ type rrwebRecord = typeof rrweb["record"];
2816
+ type rrwebCustomEvent = typeof rrweb["record"]["addCustomEvent"];
1214
2817
  declare global {
1215
2818
  interface Window {
1216
2819
  __cfg: Config;
@@ -1222,10 +2825,21 @@ declare global {
1222
2825
  optimizely?: optimizely.Optimizely;
1223
2826
  optimizelyDatafile?: object;
1224
2827
  previewMode?: unknown;
1225
- UpChunk: upchunk.UpChunkModule;
2828
+ UpChunk: {
2829
+ createUpload: (
2830
+ ...args: ArgumentTypes<createUpload>
2831
+ ) => PublicOf<ReturnType<createUpload>>;
2832
+ };
1226
2833
  _Sprig?: sprigConfig.WindowSprig;
1227
2834
  Sprig: sprigConfig.WindowSprig;
1228
2835
  UserLeap: sprigConfig.WindowSprig;
2836
+ rrwebRecord?: {
2837
+ addCustomEvent: (
2838
+ ...args: ArgumentTypes<rrwebCustomEvent>
2839
+ ) => PublicOf<ReturnType<rrwebCustomEvent>>;
2840
+ } & ((
2841
+ arg: Omit<ArgumentType<rrwebRecord>, "hooks">
2842
+ ) => PublicOf<ReturnType<rrwebRecord>>);
1229
2843
  sprigAPI?: object;
1230
2844
  }
1231
2845
 
@@ -1259,9 +2873,6 @@ declare class SprigAPI {
1259
2873
  SURVEY_WILL_PRESENT: SprigEvent;
1260
2874
  QUESTION_ANSWERED: SprigEvent;
1261
2875
  CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
1262
- /**
1263
- * Attach an email address to visitor
1264
- */
1265
2876
  VISITOR_ID_UPDATED: SprigEvent;
1266
2877
  DATA: {
1267
2878
  DISMISS_REASONS: {