@betterbugs/types 2.0.0-alpha.19

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/types.cjs ADDED
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var EventType = /* @__PURE__ */ ((EventType2) => {
4
+ EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
5
+ EventType2[EventType2["Load"] = 1] = "Load";
6
+ EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot";
7
+ EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
8
+ EventType2[EventType2["Meta"] = 4] = "Meta";
9
+ EventType2[EventType2["Custom"] = 5] = "Custom";
10
+ EventType2[EventType2["Plugin"] = 6] = "Plugin";
11
+ return EventType2;
12
+ })(EventType || {});
13
+ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
14
+ IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation";
15
+ IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove";
16
+ IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction";
17
+ IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll";
18
+ IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize";
19
+ IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input";
20
+ IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove";
21
+ IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction";
22
+ IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule";
23
+ IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation";
24
+ IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font";
25
+ IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log";
26
+ IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag";
27
+ IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration";
28
+ IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
29
+ IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
30
+ IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
31
+ return IncrementalSource2;
32
+ })(IncrementalSource || {});
33
+ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
34
+ MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
35
+ MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
36
+ MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
37
+ MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
38
+ MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
39
+ MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
40
+ MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
41
+ MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
42
+ MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
43
+ MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
44
+ MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
45
+ return MouseInteractions2;
46
+ })(MouseInteractions || {});
47
+ var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
48
+ PointerTypes2[PointerTypes2["Mouse"] = 0] = "Mouse";
49
+ PointerTypes2[PointerTypes2["Pen"] = 1] = "Pen";
50
+ PointerTypes2[PointerTypes2["Touch"] = 2] = "Touch";
51
+ return PointerTypes2;
52
+ })(PointerTypes || {});
53
+ var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {
54
+ CanvasContext2[CanvasContext2["2D"] = 0] = "2D";
55
+ CanvasContext2[CanvasContext2["WebGL"] = 1] = "WebGL";
56
+ CanvasContext2[CanvasContext2["WebGL2"] = 2] = "WebGL2";
57
+ return CanvasContext2;
58
+ })(CanvasContext || {});
59
+ var MediaInteractions = /* @__PURE__ */ ((MediaInteractions2) => {
60
+ MediaInteractions2[MediaInteractions2["Play"] = 0] = "Play";
61
+ MediaInteractions2[MediaInteractions2["Pause"] = 1] = "Pause";
62
+ MediaInteractions2[MediaInteractions2["Seeked"] = 2] = "Seeked";
63
+ MediaInteractions2[MediaInteractions2["VolumeChange"] = 3] = "VolumeChange";
64
+ MediaInteractions2[MediaInteractions2["RateChange"] = 4] = "RateChange";
65
+ return MediaInteractions2;
66
+ })(MediaInteractions || {});
67
+ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
68
+ ReplayerEvents2["Start"] = "start";
69
+ ReplayerEvents2["Pause"] = "pause";
70
+ ReplayerEvents2["Resume"] = "resume";
71
+ ReplayerEvents2["Resize"] = "resize";
72
+ ReplayerEvents2["Finish"] = "finish";
73
+ ReplayerEvents2["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
74
+ ReplayerEvents2["LoadStylesheetStart"] = "load-stylesheet-start";
75
+ ReplayerEvents2["LoadStylesheetEnd"] = "load-stylesheet-end";
76
+ ReplayerEvents2["SkipStart"] = "skip-start";
77
+ ReplayerEvents2["SkipEnd"] = "skip-end";
78
+ ReplayerEvents2["MouseInteraction"] = "mouse-interaction";
79
+ ReplayerEvents2["EventCast"] = "event-cast";
80
+ ReplayerEvents2["CustomEvent"] = "custom-event";
81
+ ReplayerEvents2["Flush"] = "flush";
82
+ ReplayerEvents2["StateChange"] = "state-change";
83
+ ReplayerEvents2["PlayBack"] = "play-back";
84
+ ReplayerEvents2["Destroy"] = "destroy";
85
+ return ReplayerEvents2;
86
+ })(ReplayerEvents || {});
87
+ var NodeType = /* @__PURE__ */ ((NodeType2) => {
88
+ NodeType2[NodeType2["Document"] = 0] = "Document";
89
+ NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
90
+ NodeType2[NodeType2["Element"] = 2] = "Element";
91
+ NodeType2[NodeType2["Text"] = 3] = "Text";
92
+ NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
93
+ NodeType2[NodeType2["Comment"] = 5] = "Comment";
94
+ return NodeType2;
95
+ })(NodeType || {});
96
+ exports.CanvasContext = CanvasContext;
97
+ exports.EventType = EventType;
98
+ exports.IncrementalSource = IncrementalSource;
99
+ exports.MediaInteractions = MediaInteractions;
100
+ exports.MouseInteractions = MouseInteractions;
101
+ exports.NodeType = NodeType;
102
+ exports.PointerTypes = PointerTypes;
103
+ exports.ReplayerEvents = ReplayerEvents;
104
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","sources":["../src/index.ts"],"sourcesContent":["export enum EventType {\n DomContentLoaded,\n Load,\n FullSnapshot,\n IncrementalSnapshot,\n Meta,\n Custom,\n Plugin,\n}\n\nexport type domContentLoadedEvent = {\n type: EventType.DomContentLoaded;\n data: unknown;\n};\n\nexport type loadedEvent = {\n type: EventType.Load;\n data: unknown;\n};\n\nexport type fullSnapshotEvent = {\n type: EventType.FullSnapshot;\n data: {\n node: serializedNodeWithId;\n initialOffset: {\n top: number;\n left: number;\n };\n };\n};\n\nexport type incrementalSnapshotEvent = {\n type: EventType.IncrementalSnapshot;\n data: incrementalData;\n};\n\nexport type metaEvent = {\n type: EventType.Meta;\n data: {\n href: string;\n width: number;\n height: number;\n };\n};\n\nexport type customEvent<T = unknown> = {\n type: EventType.Custom;\n data: {\n tag: string;\n payload: T;\n };\n};\n\nexport type pluginEvent<T = unknown> = {\n type: EventType.Plugin;\n data: {\n plugin: string;\n payload: T;\n };\n};\n\nexport enum IncrementalSource {\n Mutation,\n MouseMove,\n MouseInteraction,\n Scroll,\n ViewportResize,\n Input,\n TouchMove,\n MediaInteraction,\n StyleSheetRule,\n CanvasMutation,\n Font,\n Log,\n Drag,\n StyleDeclaration,\n Selection,\n AdoptedStyleSheet,\n CustomElement,\n}\n\nexport type mutationData = {\n source: IncrementalSource.Mutation;\n} & mutationCallbackParam;\n\nexport type mousemoveData = {\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag;\n positions: mousePosition[];\n};\n\nexport type mouseInteractionData = {\n source: IncrementalSource.MouseInteraction;\n} & mouseInteractionParam;\n\nexport type scrollData = {\n source: IncrementalSource.Scroll;\n} & scrollPosition;\n\nexport type viewportResizeData = {\n source: IncrementalSource.ViewportResize;\n} & viewportResizeDimension;\n\nexport type inputData = {\n source: IncrementalSource.Input;\n id: number;\n} & inputValue;\n\nexport type mediaInteractionData = {\n source: IncrementalSource.MediaInteraction;\n} & mediaInteractionParam;\n\nexport type styleSheetRuleData = {\n source: IncrementalSource.StyleSheetRule;\n} & styleSheetRuleParam;\n\nexport type styleDeclarationData = {\n source: IncrementalSource.StyleDeclaration;\n} & styleDeclarationParam;\n\nexport type canvasMutationData = {\n source: IncrementalSource.CanvasMutation;\n} & canvasMutationParam;\n\nexport type fontData = {\n source: IncrementalSource.Font;\n} & fontParam;\n\nexport type selectionData = {\n source: IncrementalSource.Selection;\n} & selectionParam;\n\nexport type adoptedStyleSheetData = {\n source: IncrementalSource.AdoptedStyleSheet;\n} & adoptedStyleSheetParam;\n\nexport type customElementData = {\n source: IncrementalSource.CustomElement;\n} & customElementParam;\n\nexport type incrementalData =\n | mutationData\n | mousemoveData\n | mouseInteractionData\n | scrollData\n | viewportResizeData\n | inputData\n | mediaInteractionData\n | styleSheetRuleData\n | canvasMutationData\n | fontData\n | selectionData\n | styleDeclarationData\n | adoptedStyleSheetData\n | customElementData;\n\nexport type eventWithoutTime =\n | domContentLoadedEvent\n | loadedEvent\n | fullSnapshotEvent\n | incrementalSnapshotEvent\n | metaEvent\n | customEvent\n | pluginEvent;\n\n/**\n * @deprecated intended for internal use\n * a synonym for eventWithoutTime\n */\nexport type event = eventWithoutTime;\n\nexport type eventWithTime = eventWithoutTime & {\n timestamp: number;\n delay?: number;\n};\n\nexport type canvasEventWithTime = eventWithTime & {\n type: EventType.IncrementalSnapshot;\n data: canvasMutationData;\n};\n\nexport type blockClass = string | RegExp;\n\nexport type maskTextClass = string | RegExp;\n\nexport type SamplingStrategy = Partial<{\n /**\n * false means not to record mouse/touch move events\n * number is the throttle threshold of recording mouse/touch move\n */\n mousemove: boolean | number;\n /**\n * number is the throttle threshold of mouse/touch move callback\n */\n mousemoveCallback: number;\n /**\n * false means not to record mouse interaction events\n * can also specify record some kinds of mouse interactions\n */\n mouseInteraction: boolean | Record<string, boolean | undefined>;\n /**\n * number is the throttle threshold of recording scroll\n */\n scroll: number;\n /**\n * number is the throttle threshold of recording media interactions\n */\n media: number;\n /**\n * 'all' will record all the input events\n * 'last' will only record the last input value while input a sequence of chars\n */\n input: 'all' | 'last';\n /**\n * 'all' will record every single canvas call\n * number between 1 and 60, will record an image snapshots in a web-worker a (maximum) number of times per second.\n * Number only supported where [`OffscreenCanvas`](http://mdn.io/offscreencanvas) is supported.\n */\n canvas: 'all' | number;\n}>;\n\nexport interface ICrossOriginIframeMirror {\n getId(\n iframe: HTMLIFrameElement,\n remoteId: number,\n parentToRemoteMap?: Map<number, number>,\n remoteToParentMap?: Map<number, number>,\n ): number;\n getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];\n getRemoteId(\n iframe: HTMLIFrameElement,\n parentId: number,\n map?: Map<number, number>,\n ): number;\n getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];\n reset(iframe?: HTMLIFrameElement): void;\n}\n\nexport type RecordPlugin<TOptions = unknown> = {\n name: string;\n observer?: (\n cb: (...args: Array<unknown>) => void,\n win: IWindow,\n options: TOptions,\n ) => listenerHandler;\n eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;\n getMirror?: (mirrors: {\n nodeMirror: IMirror<Node>;\n crossOriginIframeMirror: ICrossOriginIframeMirror;\n crossOriginIframeStyleMirror: ICrossOriginIframeMirror;\n }) => void;\n options: TOptions;\n};\n\nexport type hooksParam = {\n mutation?: mutationCallBack;\n mousemove?: mousemoveCallBack;\n mouseInteraction?: mouseInteractionCallBack;\n scroll?: scrollCallback;\n viewportResize?: viewportResizeCallback;\n input?: inputCallback;\n mediaInteaction?: mediaInteractionCallback;\n styleSheetRule?: styleSheetRuleCallback;\n styleDeclaration?: styleDeclarationCallback;\n canvasMutation?: canvasMutationCallback;\n font?: fontCallback;\n selection?: selectionCallback;\n customElement?: customElementCallback;\n};\n\n// https://dom.spec.whatwg.org/#interface-mutationrecord\nexport type mutationRecord = Readonly<{\n type: string;\n target: Node;\n oldValue: string | null;\n addedNodes: NodeList;\n removedNodes: NodeList;\n attributeName: string | null;\n}>;\n\nexport type textCursor = {\n node: Node;\n value: string | null;\n};\nexport type textMutation = {\n id: number;\n value: string | null;\n};\n\nexport type styleOMValue = {\n [key: string]: styleValueWithPriority | string | false;\n};\n\nexport type styleValueWithPriority = [string, string];\n\nexport type attributeCursor = {\n node: Node;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n styleDiff: styleOMValue;\n _unchangedStyles: styleOMValue;\n};\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n};\n\nexport type removedNodeMutation = {\n parentId: number;\n id: number;\n isShadow?: boolean;\n};\n\nexport type addedNodeMutation = {\n parentId: number;\n // Newly recorded mutations will not have previousId any more, just for compatibility\n previousId?: number | null;\n nextId: number | null;\n node: serializedNodeWithId;\n};\n\nexport type mutationCallbackParam = {\n texts: textMutation[];\n attributes: attributeMutation[];\n removes: removedNodeMutation[];\n adds: addedNodeMutation[];\n isAttachIframe?: true;\n};\n\nexport type mutationCallBack = (m: mutationCallbackParam) => void;\n\nexport type mousemoveCallBack = (\n p: mousePosition[],\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag,\n) => void;\n\nexport type mousePosition = {\n x: number;\n y: number;\n id: number;\n timeOffset: number;\n};\n\nexport type mouseMovePos = {\n x: number;\n y: number;\n id: number;\n debugData: incrementalData;\n};\n\nexport enum MouseInteractions {\n MouseUp,\n MouseDown,\n Click,\n ContextMenu,\n DblClick,\n Focus,\n Blur,\n TouchStart,\n TouchMove_Departed, // we will start a separate observer for touch move event\n TouchEnd,\n TouchCancel,\n}\n\nexport enum PointerTypes {\n Mouse,\n Pen,\n Touch,\n}\n\nexport enum CanvasContext {\n '2D',\n WebGL,\n WebGL2,\n}\n\nexport type SerializedCanvasArg =\n | {\n rr_type: 'ArrayBuffer';\n base64: string; // base64\n }\n | {\n rr_type: 'Blob';\n data: Array<CanvasArg>;\n type?: string;\n }\n | {\n rr_type: string;\n src: string; // url of image\n }\n | {\n rr_type: string;\n args: Array<CanvasArg>;\n }\n | {\n rr_type: string;\n index: number;\n };\n\nexport type CanvasArg =\n | SerializedCanvasArg\n | string\n | number\n | boolean\n | null\n | CanvasArg[];\n\ntype mouseInteractionParam = {\n type: MouseInteractions;\n id: number;\n x?: number;\n y?: number;\n pointerType?: PointerTypes;\n};\n\nexport type mouseInteractionCallBack = (d: mouseInteractionParam) => void;\n\nexport type scrollPosition = {\n id: number;\n x: number;\n y: number;\n};\n\nexport type scrollCallback = (p: scrollPosition) => void;\n\nexport type styleSheetAddRule = {\n rule: string;\n index?: number | number[];\n};\n\nexport type styleSheetDeleteRule = {\n index: number | number[];\n};\n\nexport type styleSheetRuleParam = {\n id?: number;\n styleId?: number;\n removes?: styleSheetDeleteRule[];\n adds?: styleSheetAddRule[];\n replace?: string;\n replaceSync?: string;\n};\n\nexport type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;\n\nexport type adoptedStyleSheetParam = {\n // id indicates the node id of document or shadow DOMs' host element.\n id: number;\n // New CSSStyleSheets which have never appeared before.\n styles?: {\n styleId: number;\n rules: styleSheetAddRule[];\n }[];\n // StyleSheet ids to be adopted.\n styleIds: number[];\n};\n\nexport type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;\n\nexport type styleDeclarationParam = {\n id?: number;\n styleId?: number;\n index: number[];\n set?: {\n property: string;\n value: string | null;\n priority: string | undefined;\n };\n remove?: {\n property: string;\n };\n};\n\nexport type styleDeclarationCallback = (s: styleDeclarationParam) => void;\n\nexport type canvasMutationCommand = {\n property: string;\n args: Array<unknown>;\n setter?: true;\n};\n\nexport type canvasMutationParam =\n | {\n id: number;\n type: CanvasContext;\n commands: canvasMutationCommand[];\n }\n | ({\n id: number;\n type: CanvasContext;\n } & canvasMutationCommand);\n\nexport type canvasMutationWithType = {\n type: CanvasContext;\n} & canvasMutationCommand;\n\nexport type canvasMutationCallback = (p: canvasMutationParam) => void;\n\nexport type canvasManagerMutationCallback = (\n target: HTMLCanvasElement,\n p: canvasMutationWithType,\n) => void;\n\nexport type ImageBitmapDataURLWorkerParams = {\n id: number;\n bitmap: ImageBitmap;\n width: number;\n height: number;\n dataURLOptions: DataURLOptions;\n};\n\nexport type ImageBitmapDataURLWorkerResponse =\n | {\n id: number;\n }\n | {\n id: number;\n type: string;\n base64: string;\n width: number;\n height: number;\n };\n\nexport type fontParam = {\n family: string;\n fontSource: string;\n buffer: boolean;\n descriptors?: FontFaceDescriptors;\n};\n\nexport type fontCallback = (p: fontParam) => void;\n\nexport type viewportResizeDimension = {\n width: number;\n height: number;\n};\n\nexport type viewportResizeCallback = (d: viewportResizeDimension) => void;\n\nexport type inputValue = {\n text: string;\n isChecked: boolean;\n\n // `userTriggered` indicates if this event was triggered directly by user (userTriggered: true)\n // or was triggered indirectly (userTriggered: false)\n // Example of `userTriggered` in action:\n // User clicks on radio element (userTriggered: true) which triggers the other radio element to change (userTriggered: false)\n userTriggered?: boolean;\n};\n\nexport type inputCallback = (v: inputValue & { id: number }) => void;\n\nexport enum MediaInteractions {\n Play,\n Pause,\n Seeked,\n VolumeChange,\n RateChange,\n}\n\nexport type mediaInteractionParam = {\n type: MediaInteractions;\n id: number;\n currentTime?: number;\n volume?: number;\n muted?: boolean;\n loop?: boolean;\n playbackRate?: number;\n};\n\nexport type mediaInteractionCallback = (p: mediaInteractionParam) => void;\n\nexport type DocumentDimension = {\n x: number;\n y: number;\n // scale value relative to its parent iframe\n relativeScale: number;\n // scale value relative to the root iframe\n absoluteScale: number;\n};\n\nexport type SelectionRange = {\n start: number;\n startOffset: number;\n end: number;\n endOffset: number;\n};\n\nexport type selectionParam = {\n ranges: Array<SelectionRange>;\n};\n\nexport type selectionCallback = (p: selectionParam) => void;\n\nexport type customElementParam = {\n define?: {\n name: string;\n };\n};\n\nexport type customElementCallback = (c: customElementParam) => void;\n\n/**\n * @deprecated\n */\ninterface INode extends Node {\n __sn: serializedNodeWithId;\n}\n\nexport type DeprecatedMirror = {\n map: {\n [key: number]: INode;\n };\n getId: (n: Node) => number;\n getNode: (id: number) => INode | null;\n removeNodeFromMap: (n: Node) => void;\n has: (id: number) => boolean;\n reset: () => void;\n};\n\nexport type throttleOptions = {\n leading?: boolean;\n trailing?: boolean;\n};\n\nexport type listenerHandler = () => void;\nexport type hookResetter = () => void;\n\nexport type playerMetaData = {\n startTime: number;\n endTime: number;\n totalTime: number;\n};\n\nexport type actionWithDelay = {\n doAction: () => void;\n delay: number;\n};\n\nexport type Handler = (event?: unknown) => void;\n\nexport type Emitter = {\n on(type: string, handler: Handler): void;\n emit(type: string, event?: unknown): void;\n off(type: string, handler: Handler): void;\n};\n\nexport type Arguments<T> = T extends (...payload: infer U) => unknown\n ? U\n : unknown;\n\nexport enum ReplayerEvents {\n Start = 'start',\n Pause = 'pause',\n /**\n * @deprecated use Play instead\n */\n Resume = 'resume',\n Resize = 'resize',\n Finish = 'finish',\n FullsnapshotRebuilded = 'fullsnapshot-rebuilded',\n LoadStylesheetStart = 'load-stylesheet-start',\n LoadStylesheetEnd = 'load-stylesheet-end',\n SkipStart = 'skip-start',\n SkipEnd = 'skip-end',\n MouseInteraction = 'mouse-interaction',\n EventCast = 'event-cast',\n CustomEvent = 'custom-event',\n Flush = 'flush',\n StateChange = 'state-change',\n PlayBack = 'play-back',\n Destroy = 'destroy',\n}\n\nexport type KeepIframeSrcFn = (src: string) => boolean;\n\ndeclare global {\n interface Window {\n FontFace: typeof FontFace;\n }\n}\n\nexport type IWindow = Window & typeof globalThis;\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type GetTypedKeys<Obj extends object, ValueType> = TakeTypeHelper<\n Obj,\n ValueType\n>[keyof TakeTypeHelper<Obj, ValueType>];\nexport type TakeTypeHelper<Obj extends object, ValueType> = {\n [K in keyof Obj]: Obj[K] extends ValueType ? K : never;\n};\n\nexport type TakeTypedKeyValues<Obj extends object, Type> = Pick<\n Obj,\n TakeTypeHelper<Obj, Type>[keyof TakeTypeHelper<Obj, Type>]\n>;\n\nexport enum NodeType {\n Document,\n DocumentType,\n Element,\n Text,\n CDATA,\n Comment,\n}\n\nexport type documentNode = {\n type: NodeType.Document;\n childNodes: serializedNodeWithId[];\n compatMode?: string;\n};\n\nexport type documentTypeNode = {\n type: NodeType.DocumentType;\n name: string;\n publicId: string;\n systemId: string;\n};\n\ntype cssTextKeyAttr = {\n _cssText?: string;\n};\n\nexport type attributes = cssTextKeyAttr & {\n [key: string]:\n | string\n | number // properties e.g. rr_scrollLeft or rr_mediaCurrentTime\n | true // e.g. checked on <input type=\"radio\">\n | null; // an indication that an attribute was removed (during a mutation)\n};\n\nexport type legacyAttributes = {\n /**\n * @deprecated old bug in rrweb was causing these to always be set\n * @see https://github.com/rrweb-io/rrweb/pull/651\n */\n selected: false;\n};\n\nexport type mediaAttributes = {\n rr_mediaState: 'played' | 'paused';\n rr_mediaCurrentTime: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaPlaybackRate?: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaMuted?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaLoop?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaVolume?: number;\n};\n\nexport type elementNode = {\n type: NodeType.Element;\n tagName: string;\n attributes: attributes;\n childNodes: serializedNodeWithId[];\n isSVG?: true;\n needBlock?: boolean;\n // This is a custom element or not.\n isCustom?: true;\n};\n\nexport type textNode = {\n type: NodeType.Text;\n textContent: string;\n /**\n * @deprecated styles are now always snapshotted against parent <style> element\n * style mutations can still happen via an added textNode, but they don't need this attribute for correct replay\n */\n isStyle?: true;\n};\n\nexport type cdataNode = {\n type: NodeType.CDATA;\n textContent: '';\n};\n\nexport type commentNode = {\n type: NodeType.Comment;\n textContent: string;\n};\n\nexport type serializedNode = (\n | documentNode\n | documentTypeNode\n | elementNode\n | textNode\n | cdataNode\n | commentNode\n) & {\n rootId?: number;\n isShadowHost?: boolean;\n isShadow?: boolean;\n};\n\nexport type serializedNodeWithId = serializedNode & { id: number };\n\nexport type serializedElementNodeWithId = Extract<\n serializedNodeWithId,\n Record<'type', NodeType.Element>\n>;\n\nexport interface IMirror<TNode> {\n getId(n: TNode | undefined | null): number;\n\n getNode(id: number): TNode | null;\n\n getIds(): number[];\n\n getMeta(n: TNode): serializedNodeWithId | null;\n\n removeNodeFromMap(n: TNode): void;\n\n has(id: number): boolean;\n\n hasNode(node: TNode): boolean;\n\n add(n: TNode, meta: serializedNodeWithId): void;\n\n replace(id: number, n: TNode): void;\n\n reset(): void;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n// Types for @betterbugs/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],"names":["EventType","IncrementalSource","MouseInteractions","PointerTypes","CanvasContext","MediaInteractions","ReplayerEvents","NodeType"],"mappings":";;AAAY,IAAA,8BAAAA,eAAL;AACLA,aAAA,WAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,cAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,qBAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,MAAA,IAAA,CAAA,IAA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AAA,mBAAoB,IAAA;AACpBA,kBAAA,WAAY,IAAA;AACZA,kBAAA,SAAU,IAAA;AACVA,kBAAA,kBAAmB,IAAA;AACnBA,kBAAA,WAAY,IAAA;AACZA,kBAAA,aAAc,IAAA;AACdA,kBAAA,OAAQ,IAAA;AACRA,kBAAA,aAAc,IAAA;AACdA,kBAAA,UAAW,IAAA;AACXA,kBAAA,SAAU,IAAA;AApBAA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAgDA,IAAA,6BAAAC,cAAL;AACLA,YAAA,UAAA,UAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,cAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,MAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,OAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AANUA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;;;;;;;;;"}
package/dist/types.js ADDED
@@ -0,0 +1,104 @@
1
+ var EventType = /* @__PURE__ */ ((EventType2) => {
2
+ EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
3
+ EventType2[EventType2["Load"] = 1] = "Load";
4
+ EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot";
5
+ EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
6
+ EventType2[EventType2["Meta"] = 4] = "Meta";
7
+ EventType2[EventType2["Custom"] = 5] = "Custom";
8
+ EventType2[EventType2["Plugin"] = 6] = "Plugin";
9
+ return EventType2;
10
+ })(EventType || {});
11
+ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
12
+ IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation";
13
+ IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove";
14
+ IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction";
15
+ IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll";
16
+ IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize";
17
+ IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input";
18
+ IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove";
19
+ IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction";
20
+ IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule";
21
+ IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation";
22
+ IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font";
23
+ IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log";
24
+ IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag";
25
+ IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration";
26
+ IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
27
+ IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
28
+ IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
29
+ return IncrementalSource2;
30
+ })(IncrementalSource || {});
31
+ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
32
+ MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
33
+ MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
34
+ MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
35
+ MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
36
+ MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
37
+ MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
38
+ MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
39
+ MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
40
+ MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
41
+ MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
42
+ MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
43
+ return MouseInteractions2;
44
+ })(MouseInteractions || {});
45
+ var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
46
+ PointerTypes2[PointerTypes2["Mouse"] = 0] = "Mouse";
47
+ PointerTypes2[PointerTypes2["Pen"] = 1] = "Pen";
48
+ PointerTypes2[PointerTypes2["Touch"] = 2] = "Touch";
49
+ return PointerTypes2;
50
+ })(PointerTypes || {});
51
+ var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {
52
+ CanvasContext2[CanvasContext2["2D"] = 0] = "2D";
53
+ CanvasContext2[CanvasContext2["WebGL"] = 1] = "WebGL";
54
+ CanvasContext2[CanvasContext2["WebGL2"] = 2] = "WebGL2";
55
+ return CanvasContext2;
56
+ })(CanvasContext || {});
57
+ var MediaInteractions = /* @__PURE__ */ ((MediaInteractions2) => {
58
+ MediaInteractions2[MediaInteractions2["Play"] = 0] = "Play";
59
+ MediaInteractions2[MediaInteractions2["Pause"] = 1] = "Pause";
60
+ MediaInteractions2[MediaInteractions2["Seeked"] = 2] = "Seeked";
61
+ MediaInteractions2[MediaInteractions2["VolumeChange"] = 3] = "VolumeChange";
62
+ MediaInteractions2[MediaInteractions2["RateChange"] = 4] = "RateChange";
63
+ return MediaInteractions2;
64
+ })(MediaInteractions || {});
65
+ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
66
+ ReplayerEvents2["Start"] = "start";
67
+ ReplayerEvents2["Pause"] = "pause";
68
+ ReplayerEvents2["Resume"] = "resume";
69
+ ReplayerEvents2["Resize"] = "resize";
70
+ ReplayerEvents2["Finish"] = "finish";
71
+ ReplayerEvents2["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
72
+ ReplayerEvents2["LoadStylesheetStart"] = "load-stylesheet-start";
73
+ ReplayerEvents2["LoadStylesheetEnd"] = "load-stylesheet-end";
74
+ ReplayerEvents2["SkipStart"] = "skip-start";
75
+ ReplayerEvents2["SkipEnd"] = "skip-end";
76
+ ReplayerEvents2["MouseInteraction"] = "mouse-interaction";
77
+ ReplayerEvents2["EventCast"] = "event-cast";
78
+ ReplayerEvents2["CustomEvent"] = "custom-event";
79
+ ReplayerEvents2["Flush"] = "flush";
80
+ ReplayerEvents2["StateChange"] = "state-change";
81
+ ReplayerEvents2["PlayBack"] = "play-back";
82
+ ReplayerEvents2["Destroy"] = "destroy";
83
+ return ReplayerEvents2;
84
+ })(ReplayerEvents || {});
85
+ var NodeType = /* @__PURE__ */ ((NodeType2) => {
86
+ NodeType2[NodeType2["Document"] = 0] = "Document";
87
+ NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
88
+ NodeType2[NodeType2["Element"] = 2] = "Element";
89
+ NodeType2[NodeType2["Text"] = 3] = "Text";
90
+ NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
91
+ NodeType2[NodeType2["Comment"] = 5] = "Comment";
92
+ return NodeType2;
93
+ })(NodeType || {});
94
+ export {
95
+ CanvasContext,
96
+ EventType,
97
+ IncrementalSource,
98
+ MediaInteractions,
99
+ MouseInteractions,
100
+ NodeType,
101
+ PointerTypes,
102
+ ReplayerEvents
103
+ };
104
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../src/index.ts"],"sourcesContent":["export enum EventType {\n DomContentLoaded,\n Load,\n FullSnapshot,\n IncrementalSnapshot,\n Meta,\n Custom,\n Plugin,\n}\n\nexport type domContentLoadedEvent = {\n type: EventType.DomContentLoaded;\n data: unknown;\n};\n\nexport type loadedEvent = {\n type: EventType.Load;\n data: unknown;\n};\n\nexport type fullSnapshotEvent = {\n type: EventType.FullSnapshot;\n data: {\n node: serializedNodeWithId;\n initialOffset: {\n top: number;\n left: number;\n };\n };\n};\n\nexport type incrementalSnapshotEvent = {\n type: EventType.IncrementalSnapshot;\n data: incrementalData;\n};\n\nexport type metaEvent = {\n type: EventType.Meta;\n data: {\n href: string;\n width: number;\n height: number;\n };\n};\n\nexport type customEvent<T = unknown> = {\n type: EventType.Custom;\n data: {\n tag: string;\n payload: T;\n };\n};\n\nexport type pluginEvent<T = unknown> = {\n type: EventType.Plugin;\n data: {\n plugin: string;\n payload: T;\n };\n};\n\nexport enum IncrementalSource {\n Mutation,\n MouseMove,\n MouseInteraction,\n Scroll,\n ViewportResize,\n Input,\n TouchMove,\n MediaInteraction,\n StyleSheetRule,\n CanvasMutation,\n Font,\n Log,\n Drag,\n StyleDeclaration,\n Selection,\n AdoptedStyleSheet,\n CustomElement,\n}\n\nexport type mutationData = {\n source: IncrementalSource.Mutation;\n} & mutationCallbackParam;\n\nexport type mousemoveData = {\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag;\n positions: mousePosition[];\n};\n\nexport type mouseInteractionData = {\n source: IncrementalSource.MouseInteraction;\n} & mouseInteractionParam;\n\nexport type scrollData = {\n source: IncrementalSource.Scroll;\n} & scrollPosition;\n\nexport type viewportResizeData = {\n source: IncrementalSource.ViewportResize;\n} & viewportResizeDimension;\n\nexport type inputData = {\n source: IncrementalSource.Input;\n id: number;\n} & inputValue;\n\nexport type mediaInteractionData = {\n source: IncrementalSource.MediaInteraction;\n} & mediaInteractionParam;\n\nexport type styleSheetRuleData = {\n source: IncrementalSource.StyleSheetRule;\n} & styleSheetRuleParam;\n\nexport type styleDeclarationData = {\n source: IncrementalSource.StyleDeclaration;\n} & styleDeclarationParam;\n\nexport type canvasMutationData = {\n source: IncrementalSource.CanvasMutation;\n} & canvasMutationParam;\n\nexport type fontData = {\n source: IncrementalSource.Font;\n} & fontParam;\n\nexport type selectionData = {\n source: IncrementalSource.Selection;\n} & selectionParam;\n\nexport type adoptedStyleSheetData = {\n source: IncrementalSource.AdoptedStyleSheet;\n} & adoptedStyleSheetParam;\n\nexport type customElementData = {\n source: IncrementalSource.CustomElement;\n} & customElementParam;\n\nexport type incrementalData =\n | mutationData\n | mousemoveData\n | mouseInteractionData\n | scrollData\n | viewportResizeData\n | inputData\n | mediaInteractionData\n | styleSheetRuleData\n | canvasMutationData\n | fontData\n | selectionData\n | styleDeclarationData\n | adoptedStyleSheetData\n | customElementData;\n\nexport type eventWithoutTime =\n | domContentLoadedEvent\n | loadedEvent\n | fullSnapshotEvent\n | incrementalSnapshotEvent\n | metaEvent\n | customEvent\n | pluginEvent;\n\n/**\n * @deprecated intended for internal use\n * a synonym for eventWithoutTime\n */\nexport type event = eventWithoutTime;\n\nexport type eventWithTime = eventWithoutTime & {\n timestamp: number;\n delay?: number;\n};\n\nexport type canvasEventWithTime = eventWithTime & {\n type: EventType.IncrementalSnapshot;\n data: canvasMutationData;\n};\n\nexport type blockClass = string | RegExp;\n\nexport type maskTextClass = string | RegExp;\n\nexport type SamplingStrategy = Partial<{\n /**\n * false means not to record mouse/touch move events\n * number is the throttle threshold of recording mouse/touch move\n */\n mousemove: boolean | number;\n /**\n * number is the throttle threshold of mouse/touch move callback\n */\n mousemoveCallback: number;\n /**\n * false means not to record mouse interaction events\n * can also specify record some kinds of mouse interactions\n */\n mouseInteraction: boolean | Record<string, boolean | undefined>;\n /**\n * number is the throttle threshold of recording scroll\n */\n scroll: number;\n /**\n * number is the throttle threshold of recording media interactions\n */\n media: number;\n /**\n * 'all' will record all the input events\n * 'last' will only record the last input value while input a sequence of chars\n */\n input: 'all' | 'last';\n /**\n * 'all' will record every single canvas call\n * number between 1 and 60, will record an image snapshots in a web-worker a (maximum) number of times per second.\n * Number only supported where [`OffscreenCanvas`](http://mdn.io/offscreencanvas) is supported.\n */\n canvas: 'all' | number;\n}>;\n\nexport interface ICrossOriginIframeMirror {\n getId(\n iframe: HTMLIFrameElement,\n remoteId: number,\n parentToRemoteMap?: Map<number, number>,\n remoteToParentMap?: Map<number, number>,\n ): number;\n getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];\n getRemoteId(\n iframe: HTMLIFrameElement,\n parentId: number,\n map?: Map<number, number>,\n ): number;\n getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];\n reset(iframe?: HTMLIFrameElement): void;\n}\n\nexport type RecordPlugin<TOptions = unknown> = {\n name: string;\n observer?: (\n cb: (...args: Array<unknown>) => void,\n win: IWindow,\n options: TOptions,\n ) => listenerHandler;\n eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;\n getMirror?: (mirrors: {\n nodeMirror: IMirror<Node>;\n crossOriginIframeMirror: ICrossOriginIframeMirror;\n crossOriginIframeStyleMirror: ICrossOriginIframeMirror;\n }) => void;\n options: TOptions;\n};\n\nexport type hooksParam = {\n mutation?: mutationCallBack;\n mousemove?: mousemoveCallBack;\n mouseInteraction?: mouseInteractionCallBack;\n scroll?: scrollCallback;\n viewportResize?: viewportResizeCallback;\n input?: inputCallback;\n mediaInteaction?: mediaInteractionCallback;\n styleSheetRule?: styleSheetRuleCallback;\n styleDeclaration?: styleDeclarationCallback;\n canvasMutation?: canvasMutationCallback;\n font?: fontCallback;\n selection?: selectionCallback;\n customElement?: customElementCallback;\n};\n\n// https://dom.spec.whatwg.org/#interface-mutationrecord\nexport type mutationRecord = Readonly<{\n type: string;\n target: Node;\n oldValue: string | null;\n addedNodes: NodeList;\n removedNodes: NodeList;\n attributeName: string | null;\n}>;\n\nexport type textCursor = {\n node: Node;\n value: string | null;\n};\nexport type textMutation = {\n id: number;\n value: string | null;\n};\n\nexport type styleOMValue = {\n [key: string]: styleValueWithPriority | string | false;\n};\n\nexport type styleValueWithPriority = [string, string];\n\nexport type attributeCursor = {\n node: Node;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n styleDiff: styleOMValue;\n _unchangedStyles: styleOMValue;\n};\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n};\n\nexport type removedNodeMutation = {\n parentId: number;\n id: number;\n isShadow?: boolean;\n};\n\nexport type addedNodeMutation = {\n parentId: number;\n // Newly recorded mutations will not have previousId any more, just for compatibility\n previousId?: number | null;\n nextId: number | null;\n node: serializedNodeWithId;\n};\n\nexport type mutationCallbackParam = {\n texts: textMutation[];\n attributes: attributeMutation[];\n removes: removedNodeMutation[];\n adds: addedNodeMutation[];\n isAttachIframe?: true;\n};\n\nexport type mutationCallBack = (m: mutationCallbackParam) => void;\n\nexport type mousemoveCallBack = (\n p: mousePosition[],\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag,\n) => void;\n\nexport type mousePosition = {\n x: number;\n y: number;\n id: number;\n timeOffset: number;\n};\n\nexport type mouseMovePos = {\n x: number;\n y: number;\n id: number;\n debugData: incrementalData;\n};\n\nexport enum MouseInteractions {\n MouseUp,\n MouseDown,\n Click,\n ContextMenu,\n DblClick,\n Focus,\n Blur,\n TouchStart,\n TouchMove_Departed, // we will start a separate observer for touch move event\n TouchEnd,\n TouchCancel,\n}\n\nexport enum PointerTypes {\n Mouse,\n Pen,\n Touch,\n}\n\nexport enum CanvasContext {\n '2D',\n WebGL,\n WebGL2,\n}\n\nexport type SerializedCanvasArg =\n | {\n rr_type: 'ArrayBuffer';\n base64: string; // base64\n }\n | {\n rr_type: 'Blob';\n data: Array<CanvasArg>;\n type?: string;\n }\n | {\n rr_type: string;\n src: string; // url of image\n }\n | {\n rr_type: string;\n args: Array<CanvasArg>;\n }\n | {\n rr_type: string;\n index: number;\n };\n\nexport type CanvasArg =\n | SerializedCanvasArg\n | string\n | number\n | boolean\n | null\n | CanvasArg[];\n\ntype mouseInteractionParam = {\n type: MouseInteractions;\n id: number;\n x?: number;\n y?: number;\n pointerType?: PointerTypes;\n};\n\nexport type mouseInteractionCallBack = (d: mouseInteractionParam) => void;\n\nexport type scrollPosition = {\n id: number;\n x: number;\n y: number;\n};\n\nexport type scrollCallback = (p: scrollPosition) => void;\n\nexport type styleSheetAddRule = {\n rule: string;\n index?: number | number[];\n};\n\nexport type styleSheetDeleteRule = {\n index: number | number[];\n};\n\nexport type styleSheetRuleParam = {\n id?: number;\n styleId?: number;\n removes?: styleSheetDeleteRule[];\n adds?: styleSheetAddRule[];\n replace?: string;\n replaceSync?: string;\n};\n\nexport type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;\n\nexport type adoptedStyleSheetParam = {\n // id indicates the node id of document or shadow DOMs' host element.\n id: number;\n // New CSSStyleSheets which have never appeared before.\n styles?: {\n styleId: number;\n rules: styleSheetAddRule[];\n }[];\n // StyleSheet ids to be adopted.\n styleIds: number[];\n};\n\nexport type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;\n\nexport type styleDeclarationParam = {\n id?: number;\n styleId?: number;\n index: number[];\n set?: {\n property: string;\n value: string | null;\n priority: string | undefined;\n };\n remove?: {\n property: string;\n };\n};\n\nexport type styleDeclarationCallback = (s: styleDeclarationParam) => void;\n\nexport type canvasMutationCommand = {\n property: string;\n args: Array<unknown>;\n setter?: true;\n};\n\nexport type canvasMutationParam =\n | {\n id: number;\n type: CanvasContext;\n commands: canvasMutationCommand[];\n }\n | ({\n id: number;\n type: CanvasContext;\n } & canvasMutationCommand);\n\nexport type canvasMutationWithType = {\n type: CanvasContext;\n} & canvasMutationCommand;\n\nexport type canvasMutationCallback = (p: canvasMutationParam) => void;\n\nexport type canvasManagerMutationCallback = (\n target: HTMLCanvasElement,\n p: canvasMutationWithType,\n) => void;\n\nexport type ImageBitmapDataURLWorkerParams = {\n id: number;\n bitmap: ImageBitmap;\n width: number;\n height: number;\n dataURLOptions: DataURLOptions;\n};\n\nexport type ImageBitmapDataURLWorkerResponse =\n | {\n id: number;\n }\n | {\n id: number;\n type: string;\n base64: string;\n width: number;\n height: number;\n };\n\nexport type fontParam = {\n family: string;\n fontSource: string;\n buffer: boolean;\n descriptors?: FontFaceDescriptors;\n};\n\nexport type fontCallback = (p: fontParam) => void;\n\nexport type viewportResizeDimension = {\n width: number;\n height: number;\n};\n\nexport type viewportResizeCallback = (d: viewportResizeDimension) => void;\n\nexport type inputValue = {\n text: string;\n isChecked: boolean;\n\n // `userTriggered` indicates if this event was triggered directly by user (userTriggered: true)\n // or was triggered indirectly (userTriggered: false)\n // Example of `userTriggered` in action:\n // User clicks on radio element (userTriggered: true) which triggers the other radio element to change (userTriggered: false)\n userTriggered?: boolean;\n};\n\nexport type inputCallback = (v: inputValue & { id: number }) => void;\n\nexport enum MediaInteractions {\n Play,\n Pause,\n Seeked,\n VolumeChange,\n RateChange,\n}\n\nexport type mediaInteractionParam = {\n type: MediaInteractions;\n id: number;\n currentTime?: number;\n volume?: number;\n muted?: boolean;\n loop?: boolean;\n playbackRate?: number;\n};\n\nexport type mediaInteractionCallback = (p: mediaInteractionParam) => void;\n\nexport type DocumentDimension = {\n x: number;\n y: number;\n // scale value relative to its parent iframe\n relativeScale: number;\n // scale value relative to the root iframe\n absoluteScale: number;\n};\n\nexport type SelectionRange = {\n start: number;\n startOffset: number;\n end: number;\n endOffset: number;\n};\n\nexport type selectionParam = {\n ranges: Array<SelectionRange>;\n};\n\nexport type selectionCallback = (p: selectionParam) => void;\n\nexport type customElementParam = {\n define?: {\n name: string;\n };\n};\n\nexport type customElementCallback = (c: customElementParam) => void;\n\n/**\n * @deprecated\n */\ninterface INode extends Node {\n __sn: serializedNodeWithId;\n}\n\nexport type DeprecatedMirror = {\n map: {\n [key: number]: INode;\n };\n getId: (n: Node) => number;\n getNode: (id: number) => INode | null;\n removeNodeFromMap: (n: Node) => void;\n has: (id: number) => boolean;\n reset: () => void;\n};\n\nexport type throttleOptions = {\n leading?: boolean;\n trailing?: boolean;\n};\n\nexport type listenerHandler = () => void;\nexport type hookResetter = () => void;\n\nexport type playerMetaData = {\n startTime: number;\n endTime: number;\n totalTime: number;\n};\n\nexport type actionWithDelay = {\n doAction: () => void;\n delay: number;\n};\n\nexport type Handler = (event?: unknown) => void;\n\nexport type Emitter = {\n on(type: string, handler: Handler): void;\n emit(type: string, event?: unknown): void;\n off(type: string, handler: Handler): void;\n};\n\nexport type Arguments<T> = T extends (...payload: infer U) => unknown\n ? U\n : unknown;\n\nexport enum ReplayerEvents {\n Start = 'start',\n Pause = 'pause',\n /**\n * @deprecated use Play instead\n */\n Resume = 'resume',\n Resize = 'resize',\n Finish = 'finish',\n FullsnapshotRebuilded = 'fullsnapshot-rebuilded',\n LoadStylesheetStart = 'load-stylesheet-start',\n LoadStylesheetEnd = 'load-stylesheet-end',\n SkipStart = 'skip-start',\n SkipEnd = 'skip-end',\n MouseInteraction = 'mouse-interaction',\n EventCast = 'event-cast',\n CustomEvent = 'custom-event',\n Flush = 'flush',\n StateChange = 'state-change',\n PlayBack = 'play-back',\n Destroy = 'destroy',\n}\n\nexport type KeepIframeSrcFn = (src: string) => boolean;\n\ndeclare global {\n interface Window {\n FontFace: typeof FontFace;\n }\n}\n\nexport type IWindow = Window & typeof globalThis;\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type GetTypedKeys<Obj extends object, ValueType> = TakeTypeHelper<\n Obj,\n ValueType\n>[keyof TakeTypeHelper<Obj, ValueType>];\nexport type TakeTypeHelper<Obj extends object, ValueType> = {\n [K in keyof Obj]: Obj[K] extends ValueType ? K : never;\n};\n\nexport type TakeTypedKeyValues<Obj extends object, Type> = Pick<\n Obj,\n TakeTypeHelper<Obj, Type>[keyof TakeTypeHelper<Obj, Type>]\n>;\n\nexport enum NodeType {\n Document,\n DocumentType,\n Element,\n Text,\n CDATA,\n Comment,\n}\n\nexport type documentNode = {\n type: NodeType.Document;\n childNodes: serializedNodeWithId[];\n compatMode?: string;\n};\n\nexport type documentTypeNode = {\n type: NodeType.DocumentType;\n name: string;\n publicId: string;\n systemId: string;\n};\n\ntype cssTextKeyAttr = {\n _cssText?: string;\n};\n\nexport type attributes = cssTextKeyAttr & {\n [key: string]:\n | string\n | number // properties e.g. rr_scrollLeft or rr_mediaCurrentTime\n | true // e.g. checked on <input type=\"radio\">\n | null; // an indication that an attribute was removed (during a mutation)\n};\n\nexport type legacyAttributes = {\n /**\n * @deprecated old bug in rrweb was causing these to always be set\n * @see https://github.com/rrweb-io/rrweb/pull/651\n */\n selected: false;\n};\n\nexport type mediaAttributes = {\n rr_mediaState: 'played' | 'paused';\n rr_mediaCurrentTime: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaPlaybackRate?: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaMuted?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaLoop?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaVolume?: number;\n};\n\nexport type elementNode = {\n type: NodeType.Element;\n tagName: string;\n attributes: attributes;\n childNodes: serializedNodeWithId[];\n isSVG?: true;\n needBlock?: boolean;\n // This is a custom element or not.\n isCustom?: true;\n};\n\nexport type textNode = {\n type: NodeType.Text;\n textContent: string;\n /**\n * @deprecated styles are now always snapshotted against parent <style> element\n * style mutations can still happen via an added textNode, but they don't need this attribute for correct replay\n */\n isStyle?: true;\n};\n\nexport type cdataNode = {\n type: NodeType.CDATA;\n textContent: '';\n};\n\nexport type commentNode = {\n type: NodeType.Comment;\n textContent: string;\n};\n\nexport type serializedNode = (\n | documentNode\n | documentTypeNode\n | elementNode\n | textNode\n | cdataNode\n | commentNode\n) & {\n rootId?: number;\n isShadowHost?: boolean;\n isShadow?: boolean;\n};\n\nexport type serializedNodeWithId = serializedNode & { id: number };\n\nexport type serializedElementNodeWithId = Extract<\n serializedNodeWithId,\n Record<'type', NodeType.Element>\n>;\n\nexport interface IMirror<TNode> {\n getId(n: TNode | undefined | null): number;\n\n getNode(id: number): TNode | null;\n\n getIds(): number[];\n\n getMeta(n: TNode): serializedNodeWithId | null;\n\n removeNodeFromMap(n: TNode): void;\n\n has(id: number): boolean;\n\n hasNode(node: TNode): boolean;\n\n add(n: TNode, meta: serializedNodeWithId): void;\n\n replace(id: number, n: TNode): void;\n\n reset(): void;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n// Types for @betterbugs/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],"names":["EventType","IncrementalSource","MouseInteractions","PointerTypes","CanvasContext","MediaInteractions","ReplayerEvents","NodeType"],"mappings":"AAAY,IAAA,8BAAAA,eAAL;AACLA,aAAA,WAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,cAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,qBAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,QAAA,IAAA,CAAA,IAAA;AACAA,aAAA,WAAA,QAAA,IAAA,CAAA,IAAA;AAPUA,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AA6DA,IAAA,sCAAAC,uBAAL;AACLA,qBAAA,mBAAA,UAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,WAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,QAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,gBAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,OAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,WAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,gBAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,gBAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,MAAA,IAAA,EAAA,IAAA;AACAA,qBAAA,mBAAA,KAAA,IAAA,EAAA,IAAA;AACAA,qBAAA,mBAAA,MAAA,IAAA,EAAA,IAAA;AACAA,qBAAA,mBAAA,kBAAA,IAAA,EAAA,IAAA;AACAA,qBAAA,mBAAA,WAAA,IAAA,EAAA,IAAA;AACAA,qBAAA,mB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AAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,cAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,YAAA,IAAA,CAAA,IAAA;AALUA,SAAAA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAmGA,IAAA,mCAAAC,oBAAL;AACLA,kBAAA,OAAQ,IAAA;AACRA,kBAAA,OAAQ,IAAA;AAIRA,kBAAA,QAAS,IAAA;AACTA,kBAAA,QAAS,IAAA;AACTA,kBAAA,QAAS,IAAA;AACTA,kBAAA,uBAAwB,IAAA;AACxBA,kBAAA,qBAAsB,IAAA;AACtBA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,WAAY,IAAA;AACZA,kBAAA,SAAU,IAAA;AACVA,kBAAA,kBAAmB,IAAA;AACnBA,kBAAA,WAAY,IAAA;AACZA,kBAAA,aAAc,IAAA;AACdA,kBAAA,OAAQ,IAAA;AACRA,kBAAA,aAAc,IAAA;AACdA,kBAAA,UAAW,IAAA;AACXA,kBAAA,SAAU,IAAA;AApBAA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAgDA,IAAA,6BAAAC,cAAL;AACLA,YAAA,UAAA,UAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,cAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,MAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,OAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AANUA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;"}
@@ -0,0 +1,134 @@
1
+ (function (g, f) {
2
+ if ("object" == typeof exports && "object" == typeof module) {
3
+ module.exports = f();
4
+ } else if ("function" == typeof define && define.amd) {
5
+ define("rrwebTypes", [], f);
6
+ } else if ("object" == typeof exports) {
7
+ exports["rrwebTypes"] = f();
8
+ } else {
9
+ g["rrwebTypes"] = f();
10
+ }
11
+ }(this, () => {
12
+ var exports = {};
13
+ var module = { exports };
14
+ "use strict";
15
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
16
+ var EventType = /* @__PURE__ */ ((EventType2) => {
17
+ EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
18
+ EventType2[EventType2["Load"] = 1] = "Load";
19
+ EventType2[EventType2["FullSnapshot"] = 2] = "FullSnapshot";
20
+ EventType2[EventType2["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
21
+ EventType2[EventType2["Meta"] = 4] = "Meta";
22
+ EventType2[EventType2["Custom"] = 5] = "Custom";
23
+ EventType2[EventType2["Plugin"] = 6] = "Plugin";
24
+ return EventType2;
25
+ })(EventType || {});
26
+ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
27
+ IncrementalSource2[IncrementalSource2["Mutation"] = 0] = "Mutation";
28
+ IncrementalSource2[IncrementalSource2["MouseMove"] = 1] = "MouseMove";
29
+ IncrementalSource2[IncrementalSource2["MouseInteraction"] = 2] = "MouseInteraction";
30
+ IncrementalSource2[IncrementalSource2["Scroll"] = 3] = "Scroll";
31
+ IncrementalSource2[IncrementalSource2["ViewportResize"] = 4] = "ViewportResize";
32
+ IncrementalSource2[IncrementalSource2["Input"] = 5] = "Input";
33
+ IncrementalSource2[IncrementalSource2["TouchMove"] = 6] = "TouchMove";
34
+ IncrementalSource2[IncrementalSource2["MediaInteraction"] = 7] = "MediaInteraction";
35
+ IncrementalSource2[IncrementalSource2["StyleSheetRule"] = 8] = "StyleSheetRule";
36
+ IncrementalSource2[IncrementalSource2["CanvasMutation"] = 9] = "CanvasMutation";
37
+ IncrementalSource2[IncrementalSource2["Font"] = 10] = "Font";
38
+ IncrementalSource2[IncrementalSource2["Log"] = 11] = "Log";
39
+ IncrementalSource2[IncrementalSource2["Drag"] = 12] = "Drag";
40
+ IncrementalSource2[IncrementalSource2["StyleDeclaration"] = 13] = "StyleDeclaration";
41
+ IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
42
+ IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
43
+ IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
44
+ return IncrementalSource2;
45
+ })(IncrementalSource || {});
46
+ var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
47
+ MouseInteractions2[MouseInteractions2["MouseUp"] = 0] = "MouseUp";
48
+ MouseInteractions2[MouseInteractions2["MouseDown"] = 1] = "MouseDown";
49
+ MouseInteractions2[MouseInteractions2["Click"] = 2] = "Click";
50
+ MouseInteractions2[MouseInteractions2["ContextMenu"] = 3] = "ContextMenu";
51
+ MouseInteractions2[MouseInteractions2["DblClick"] = 4] = "DblClick";
52
+ MouseInteractions2[MouseInteractions2["Focus"] = 5] = "Focus";
53
+ MouseInteractions2[MouseInteractions2["Blur"] = 6] = "Blur";
54
+ MouseInteractions2[MouseInteractions2["TouchStart"] = 7] = "TouchStart";
55
+ MouseInteractions2[MouseInteractions2["TouchMove_Departed"] = 8] = "TouchMove_Departed";
56
+ MouseInteractions2[MouseInteractions2["TouchEnd"] = 9] = "TouchEnd";
57
+ MouseInteractions2[MouseInteractions2["TouchCancel"] = 10] = "TouchCancel";
58
+ return MouseInteractions2;
59
+ })(MouseInteractions || {});
60
+ var PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {
61
+ PointerTypes2[PointerTypes2["Mouse"] = 0] = "Mouse";
62
+ PointerTypes2[PointerTypes2["Pen"] = 1] = "Pen";
63
+ PointerTypes2[PointerTypes2["Touch"] = 2] = "Touch";
64
+ return PointerTypes2;
65
+ })(PointerTypes || {});
66
+ var CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {
67
+ CanvasContext2[CanvasContext2["2D"] = 0] = "2D";
68
+ CanvasContext2[CanvasContext2["WebGL"] = 1] = "WebGL";
69
+ CanvasContext2[CanvasContext2["WebGL2"] = 2] = "WebGL2";
70
+ return CanvasContext2;
71
+ })(CanvasContext || {});
72
+ var MediaInteractions = /* @__PURE__ */ ((MediaInteractions2) => {
73
+ MediaInteractions2[MediaInteractions2["Play"] = 0] = "Play";
74
+ MediaInteractions2[MediaInteractions2["Pause"] = 1] = "Pause";
75
+ MediaInteractions2[MediaInteractions2["Seeked"] = 2] = "Seeked";
76
+ MediaInteractions2[MediaInteractions2["VolumeChange"] = 3] = "VolumeChange";
77
+ MediaInteractions2[MediaInteractions2["RateChange"] = 4] = "RateChange";
78
+ return MediaInteractions2;
79
+ })(MediaInteractions || {});
80
+ var ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {
81
+ ReplayerEvents2["Start"] = "start";
82
+ ReplayerEvents2["Pause"] = "pause";
83
+ ReplayerEvents2["Resume"] = "resume";
84
+ ReplayerEvents2["Resize"] = "resize";
85
+ ReplayerEvents2["Finish"] = "finish";
86
+ ReplayerEvents2["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
87
+ ReplayerEvents2["LoadStylesheetStart"] = "load-stylesheet-start";
88
+ ReplayerEvents2["LoadStylesheetEnd"] = "load-stylesheet-end";
89
+ ReplayerEvents2["SkipStart"] = "skip-start";
90
+ ReplayerEvents2["SkipEnd"] = "skip-end";
91
+ ReplayerEvents2["MouseInteraction"] = "mouse-interaction";
92
+ ReplayerEvents2["EventCast"] = "event-cast";
93
+ ReplayerEvents2["CustomEvent"] = "custom-event";
94
+ ReplayerEvents2["Flush"] = "flush";
95
+ ReplayerEvents2["StateChange"] = "state-change";
96
+ ReplayerEvents2["PlayBack"] = "play-back";
97
+ ReplayerEvents2["Destroy"] = "destroy";
98
+ return ReplayerEvents2;
99
+ })(ReplayerEvents || {});
100
+ var NodeType = /* @__PURE__ */ ((NodeType2) => {
101
+ NodeType2[NodeType2["Document"] = 0] = "Document";
102
+ NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
103
+ NodeType2[NodeType2["Element"] = 2] = "Element";
104
+ NodeType2[NodeType2["Text"] = 3] = "Text";
105
+ NodeType2[NodeType2["CDATA"] = 4] = "CDATA";
106
+ NodeType2[NodeType2["Comment"] = 5] = "Comment";
107
+ return NodeType2;
108
+ })(NodeType || {});
109
+ exports.CanvasContext = CanvasContext;
110
+ exports.EventType = EventType;
111
+ exports.IncrementalSource = IncrementalSource;
112
+ exports.MediaInteractions = MediaInteractions;
113
+ exports.MouseInteractions = MouseInteractions;
114
+ exports.NodeType = NodeType;
115
+ exports.PointerTypes = PointerTypes;
116
+ exports.ReplayerEvents = ReplayerEvents;
117
+ if (typeof module.exports == "object" && typeof exports == "object") {
118
+ var __cp = (to, from, except, desc) => {
119
+ if ((from && typeof from === "object") || typeof from === "function") {
120
+ for (let key of Object.getOwnPropertyNames(from)) {
121
+ if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
122
+ Object.defineProperty(to, key, {
123
+ get: () => from[key],
124
+ enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
125
+ });
126
+ }
127
+ }
128
+ return to;
129
+ };
130
+ module.exports = __cp(module.exports, exports);
131
+ }
132
+ return module.exports;
133
+ }))
134
+ //# sourceMappingURL=types.umd.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["export enum EventType {\n DomContentLoaded,\n Load,\n FullSnapshot,\n IncrementalSnapshot,\n Meta,\n Custom,\n Plugin,\n}\n\nexport type domContentLoadedEvent = {\n type: EventType.DomContentLoaded;\n data: unknown;\n};\n\nexport type loadedEvent = {\n type: EventType.Load;\n data: unknown;\n};\n\nexport type fullSnapshotEvent = {\n type: EventType.FullSnapshot;\n data: {\n node: serializedNodeWithId;\n initialOffset: {\n top: number;\n left: number;\n };\n };\n};\n\nexport type incrementalSnapshotEvent = {\n type: EventType.IncrementalSnapshot;\n data: incrementalData;\n};\n\nexport type metaEvent = {\n type: EventType.Meta;\n data: {\n href: string;\n width: number;\n height: number;\n };\n};\n\nexport type customEvent<T = unknown> = {\n type: EventType.Custom;\n data: {\n tag: string;\n payload: T;\n };\n};\n\nexport type pluginEvent<T = unknown> = {\n type: EventType.Plugin;\n data: {\n plugin: string;\n payload: T;\n };\n};\n\nexport enum IncrementalSource {\n Mutation,\n MouseMove,\n MouseInteraction,\n Scroll,\n ViewportResize,\n Input,\n TouchMove,\n MediaInteraction,\n StyleSheetRule,\n CanvasMutation,\n Font,\n Log,\n Drag,\n StyleDeclaration,\n Selection,\n AdoptedStyleSheet,\n CustomElement,\n}\n\nexport type mutationData = {\n source: IncrementalSource.Mutation;\n} & mutationCallbackParam;\n\nexport type mousemoveData = {\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag;\n positions: mousePosition[];\n};\n\nexport type mouseInteractionData = {\n source: IncrementalSource.MouseInteraction;\n} & mouseInteractionParam;\n\nexport type scrollData = {\n source: IncrementalSource.Scroll;\n} & scrollPosition;\n\nexport type viewportResizeData = {\n source: IncrementalSource.ViewportResize;\n} & viewportResizeDimension;\n\nexport type inputData = {\n source: IncrementalSource.Input;\n id: number;\n} & inputValue;\n\nexport type mediaInteractionData = {\n source: IncrementalSource.MediaInteraction;\n} & mediaInteractionParam;\n\nexport type styleSheetRuleData = {\n source: IncrementalSource.StyleSheetRule;\n} & styleSheetRuleParam;\n\nexport type styleDeclarationData = {\n source: IncrementalSource.StyleDeclaration;\n} & styleDeclarationParam;\n\nexport type canvasMutationData = {\n source: IncrementalSource.CanvasMutation;\n} & canvasMutationParam;\n\nexport type fontData = {\n source: IncrementalSource.Font;\n} & fontParam;\n\nexport type selectionData = {\n source: IncrementalSource.Selection;\n} & selectionParam;\n\nexport type adoptedStyleSheetData = {\n source: IncrementalSource.AdoptedStyleSheet;\n} & adoptedStyleSheetParam;\n\nexport type customElementData = {\n source: IncrementalSource.CustomElement;\n} & customElementParam;\n\nexport type incrementalData =\n | mutationData\n | mousemoveData\n | mouseInteractionData\n | scrollData\n | viewportResizeData\n | inputData\n | mediaInteractionData\n | styleSheetRuleData\n | canvasMutationData\n | fontData\n | selectionData\n | styleDeclarationData\n | adoptedStyleSheetData\n | customElementData;\n\nexport type eventWithoutTime =\n | domContentLoadedEvent\n | loadedEvent\n | fullSnapshotEvent\n | incrementalSnapshotEvent\n | metaEvent\n | customEvent\n | pluginEvent;\n\n/**\n * @deprecated intended for internal use\n * a synonym for eventWithoutTime\n */\nexport type event = eventWithoutTime;\n\nexport type eventWithTime = eventWithoutTime & {\n timestamp: number;\n delay?: number;\n};\n\nexport type canvasEventWithTime = eventWithTime & {\n type: EventType.IncrementalSnapshot;\n data: canvasMutationData;\n};\n\nexport type blockClass = string | RegExp;\n\nexport type maskTextClass = string | RegExp;\n\nexport type SamplingStrategy = Partial<{\n /**\n * false means not to record mouse/touch move events\n * number is the throttle threshold of recording mouse/touch move\n */\n mousemove: boolean | number;\n /**\n * number is the throttle threshold of mouse/touch move callback\n */\n mousemoveCallback: number;\n /**\n * false means not to record mouse interaction events\n * can also specify record some kinds of mouse interactions\n */\n mouseInteraction: boolean | Record<string, boolean | undefined>;\n /**\n * number is the throttle threshold of recording scroll\n */\n scroll: number;\n /**\n * number is the throttle threshold of recording media interactions\n */\n media: number;\n /**\n * 'all' will record all the input events\n * 'last' will only record the last input value while input a sequence of chars\n */\n input: 'all' | 'last';\n /**\n * 'all' will record every single canvas call\n * number between 1 and 60, will record an image snapshots in a web-worker a (maximum) number of times per second.\n * Number only supported where [`OffscreenCanvas`](http://mdn.io/offscreencanvas) is supported.\n */\n canvas: 'all' | number;\n}>;\n\nexport interface ICrossOriginIframeMirror {\n getId(\n iframe: HTMLIFrameElement,\n remoteId: number,\n parentToRemoteMap?: Map<number, number>,\n remoteToParentMap?: Map<number, number>,\n ): number;\n getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];\n getRemoteId(\n iframe: HTMLIFrameElement,\n parentId: number,\n map?: Map<number, number>,\n ): number;\n getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];\n reset(iframe?: HTMLIFrameElement): void;\n}\n\nexport type RecordPlugin<TOptions = unknown> = {\n name: string;\n observer?: (\n cb: (...args: Array<unknown>) => void,\n win: IWindow,\n options: TOptions,\n ) => listenerHandler;\n eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;\n getMirror?: (mirrors: {\n nodeMirror: IMirror<Node>;\n crossOriginIframeMirror: ICrossOriginIframeMirror;\n crossOriginIframeStyleMirror: ICrossOriginIframeMirror;\n }) => void;\n options: TOptions;\n};\n\nexport type hooksParam = {\n mutation?: mutationCallBack;\n mousemove?: mousemoveCallBack;\n mouseInteraction?: mouseInteractionCallBack;\n scroll?: scrollCallback;\n viewportResize?: viewportResizeCallback;\n input?: inputCallback;\n mediaInteaction?: mediaInteractionCallback;\n styleSheetRule?: styleSheetRuleCallback;\n styleDeclaration?: styleDeclarationCallback;\n canvasMutation?: canvasMutationCallback;\n font?: fontCallback;\n selection?: selectionCallback;\n customElement?: customElementCallback;\n};\n\n// https://dom.spec.whatwg.org/#interface-mutationrecord\nexport type mutationRecord = Readonly<{\n type: string;\n target: Node;\n oldValue: string | null;\n addedNodes: NodeList;\n removedNodes: NodeList;\n attributeName: string | null;\n}>;\n\nexport type textCursor = {\n node: Node;\n value: string | null;\n};\nexport type textMutation = {\n id: number;\n value: string | null;\n};\n\nexport type styleOMValue = {\n [key: string]: styleValueWithPriority | string | false;\n};\n\nexport type styleValueWithPriority = [string, string];\n\nexport type attributeCursor = {\n node: Node;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n styleDiff: styleOMValue;\n _unchangedStyles: styleOMValue;\n};\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n};\n\nexport type removedNodeMutation = {\n parentId: number;\n id: number;\n isShadow?: boolean;\n};\n\nexport type addedNodeMutation = {\n parentId: number;\n // Newly recorded mutations will not have previousId any more, just for compatibility\n previousId?: number | null;\n nextId: number | null;\n node: serializedNodeWithId;\n};\n\nexport type mutationCallbackParam = {\n texts: textMutation[];\n attributes: attributeMutation[];\n removes: removedNodeMutation[];\n adds: addedNodeMutation[];\n isAttachIframe?: true;\n};\n\nexport type mutationCallBack = (m: mutationCallbackParam) => void;\n\nexport type mousemoveCallBack = (\n p: mousePosition[],\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag,\n) => void;\n\nexport type mousePosition = {\n x: number;\n y: number;\n id: number;\n timeOffset: number;\n};\n\nexport type mouseMovePos = {\n x: number;\n y: number;\n id: number;\n debugData: incrementalData;\n};\n\nexport enum MouseInteractions {\n MouseUp,\n MouseDown,\n Click,\n ContextMenu,\n DblClick,\n Focus,\n Blur,\n TouchStart,\n TouchMove_Departed, // we will start a separate observer for touch move event\n TouchEnd,\n TouchCancel,\n}\n\nexport enum PointerTypes {\n Mouse,\n Pen,\n Touch,\n}\n\nexport enum CanvasContext {\n '2D',\n WebGL,\n WebGL2,\n}\n\nexport type SerializedCanvasArg =\n | {\n rr_type: 'ArrayBuffer';\n base64: string; // base64\n }\n | {\n rr_type: 'Blob';\n data: Array<CanvasArg>;\n type?: string;\n }\n | {\n rr_type: string;\n src: string; // url of image\n }\n | {\n rr_type: string;\n args: Array<CanvasArg>;\n }\n | {\n rr_type: string;\n index: number;\n };\n\nexport type CanvasArg =\n | SerializedCanvasArg\n | string\n | number\n | boolean\n | null\n | CanvasArg[];\n\ntype mouseInteractionParam = {\n type: MouseInteractions;\n id: number;\n x?: number;\n y?: number;\n pointerType?: PointerTypes;\n};\n\nexport type mouseInteractionCallBack = (d: mouseInteractionParam) => void;\n\nexport type scrollPosition = {\n id: number;\n x: number;\n y: number;\n};\n\nexport type scrollCallback = (p: scrollPosition) => void;\n\nexport type styleSheetAddRule = {\n rule: string;\n index?: number | number[];\n};\n\nexport type styleSheetDeleteRule = {\n index: number | number[];\n};\n\nexport type styleSheetRuleParam = {\n id?: number;\n styleId?: number;\n removes?: styleSheetDeleteRule[];\n adds?: styleSheetAddRule[];\n replace?: string;\n replaceSync?: string;\n};\n\nexport type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;\n\nexport type adoptedStyleSheetParam = {\n // id indicates the node id of document or shadow DOMs' host element.\n id: number;\n // New CSSStyleSheets which have never appeared before.\n styles?: {\n styleId: number;\n rules: styleSheetAddRule[];\n }[];\n // StyleSheet ids to be adopted.\n styleIds: number[];\n};\n\nexport type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;\n\nexport type styleDeclarationParam = {\n id?: number;\n styleId?: number;\n index: number[];\n set?: {\n property: string;\n value: string | null;\n priority: string | undefined;\n };\n remove?: {\n property: string;\n };\n};\n\nexport type styleDeclarationCallback = (s: styleDeclarationParam) => void;\n\nexport type canvasMutationCommand = {\n property: string;\n args: Array<unknown>;\n setter?: true;\n};\n\nexport type canvasMutationParam =\n | {\n id: number;\n type: CanvasContext;\n commands: canvasMutationCommand[];\n }\n | ({\n id: number;\n type: CanvasContext;\n } & canvasMutationCommand);\n\nexport type canvasMutationWithType = {\n type: CanvasContext;\n} & canvasMutationCommand;\n\nexport type canvasMutationCallback = (p: canvasMutationParam) => void;\n\nexport type canvasManagerMutationCallback = (\n target: HTMLCanvasElement,\n p: canvasMutationWithType,\n) => void;\n\nexport type ImageBitmapDataURLWorkerParams = {\n id: number;\n bitmap: ImageBitmap;\n width: number;\n height: number;\n dataURLOptions: DataURLOptions;\n};\n\nexport type ImageBitmapDataURLWorkerResponse =\n | {\n id: number;\n }\n | {\n id: number;\n type: string;\n base64: string;\n width: number;\n height: number;\n };\n\nexport type fontParam = {\n family: string;\n fontSource: string;\n buffer: boolean;\n descriptors?: FontFaceDescriptors;\n};\n\nexport type fontCallback = (p: fontParam) => void;\n\nexport type viewportResizeDimension = {\n width: number;\n height: number;\n};\n\nexport type viewportResizeCallback = (d: viewportResizeDimension) => void;\n\nexport type inputValue = {\n text: string;\n isChecked: boolean;\n\n // `userTriggered` indicates if this event was triggered directly by user (userTriggered: true)\n // or was triggered indirectly (userTriggered: false)\n // Example of `userTriggered` in action:\n // User clicks on radio element (userTriggered: true) which triggers the other radio element to change (userTriggered: false)\n userTriggered?: boolean;\n};\n\nexport type inputCallback = (v: inputValue & { id: number }) => void;\n\nexport enum MediaInteractions {\n Play,\n Pause,\n Seeked,\n VolumeChange,\n RateChange,\n}\n\nexport type mediaInteractionParam = {\n type: MediaInteractions;\n id: number;\n currentTime?: number;\n volume?: number;\n muted?: boolean;\n loop?: boolean;\n playbackRate?: number;\n};\n\nexport type mediaInteractionCallback = (p: mediaInteractionParam) => void;\n\nexport type DocumentDimension = {\n x: number;\n y: number;\n // scale value relative to its parent iframe\n relativeScale: number;\n // scale value relative to the root iframe\n absoluteScale: number;\n};\n\nexport type SelectionRange = {\n start: number;\n startOffset: number;\n end: number;\n endOffset: number;\n};\n\nexport type selectionParam = {\n ranges: Array<SelectionRange>;\n};\n\nexport type selectionCallback = (p: selectionParam) => void;\n\nexport type customElementParam = {\n define?: {\n name: string;\n };\n};\n\nexport type customElementCallback = (c: customElementParam) => void;\n\n/**\n * @deprecated\n */\ninterface INode extends Node {\n __sn: serializedNodeWithId;\n}\n\nexport type DeprecatedMirror = {\n map: {\n [key: number]: INode;\n };\n getId: (n: Node) => number;\n getNode: (id: number) => INode | null;\n removeNodeFromMap: (n: Node) => void;\n has: (id: number) => boolean;\n reset: () => void;\n};\n\nexport type throttleOptions = {\n leading?: boolean;\n trailing?: boolean;\n};\n\nexport type listenerHandler = () => void;\nexport type hookResetter = () => void;\n\nexport type playerMetaData = {\n startTime: number;\n endTime: number;\n totalTime: number;\n};\n\nexport type actionWithDelay = {\n doAction: () => void;\n delay: number;\n};\n\nexport type Handler = (event?: unknown) => void;\n\nexport type Emitter = {\n on(type: string, handler: Handler): void;\n emit(type: string, event?: unknown): void;\n off(type: string, handler: Handler): void;\n};\n\nexport type Arguments<T> = T extends (...payload: infer U) => unknown\n ? U\n : unknown;\n\nexport enum ReplayerEvents {\n Start = 'start',\n Pause = 'pause',\n /**\n * @deprecated use Play instead\n */\n Resume = 'resume',\n Resize = 'resize',\n Finish = 'finish',\n FullsnapshotRebuilded = 'fullsnapshot-rebuilded',\n LoadStylesheetStart = 'load-stylesheet-start',\n LoadStylesheetEnd = 'load-stylesheet-end',\n SkipStart = 'skip-start',\n SkipEnd = 'skip-end',\n MouseInteraction = 'mouse-interaction',\n EventCast = 'event-cast',\n CustomEvent = 'custom-event',\n Flush = 'flush',\n StateChange = 'state-change',\n PlayBack = 'play-back',\n Destroy = 'destroy',\n}\n\nexport type KeepIframeSrcFn = (src: string) => boolean;\n\ndeclare global {\n interface Window {\n FontFace: typeof FontFace;\n }\n}\n\nexport type IWindow = Window & typeof globalThis;\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type GetTypedKeys<Obj extends object, ValueType> = TakeTypeHelper<\n Obj,\n ValueType\n>[keyof TakeTypeHelper<Obj, ValueType>];\nexport type TakeTypeHelper<Obj extends object, ValueType> = {\n [K in keyof Obj]: Obj[K] extends ValueType ? K : never;\n};\n\nexport type TakeTypedKeyValues<Obj extends object, Type> = Pick<\n Obj,\n TakeTypeHelper<Obj, Type>[keyof TakeTypeHelper<Obj, Type>]\n>;\n\nexport enum NodeType {\n Document,\n DocumentType,\n Element,\n Text,\n CDATA,\n Comment,\n}\n\nexport type documentNode = {\n type: NodeType.Document;\n childNodes: serializedNodeWithId[];\n compatMode?: string;\n};\n\nexport type documentTypeNode = {\n type: NodeType.DocumentType;\n name: string;\n publicId: string;\n systemId: string;\n};\n\ntype cssTextKeyAttr = {\n _cssText?: string;\n};\n\nexport type attributes = cssTextKeyAttr & {\n [key: string]:\n | string\n | number // properties e.g. rr_scrollLeft or rr_mediaCurrentTime\n | true // e.g. checked on <input type=\"radio\">\n | null; // an indication that an attribute was removed (during a mutation)\n};\n\nexport type legacyAttributes = {\n /**\n * @deprecated old bug in rrweb was causing these to always be set\n * @see https://github.com/rrweb-io/rrweb/pull/651\n */\n selected: false;\n};\n\nexport type mediaAttributes = {\n rr_mediaState: 'played' | 'paused';\n rr_mediaCurrentTime: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaPlaybackRate?: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaMuted?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaLoop?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaVolume?: number;\n};\n\nexport type elementNode = {\n type: NodeType.Element;\n tagName: string;\n attributes: attributes;\n childNodes: serializedNodeWithId[];\n isSVG?: true;\n needBlock?: boolean;\n // This is a custom element or not.\n isCustom?: true;\n};\n\nexport type textNode = {\n type: NodeType.Text;\n textContent: string;\n /**\n * @deprecated styles are now always snapshotted against parent <style> element\n * style mutations can still happen via an added textNode, but they don't need this attribute for correct replay\n */\n isStyle?: true;\n};\n\nexport type cdataNode = {\n type: NodeType.CDATA;\n textContent: '';\n};\n\nexport type commentNode = {\n type: NodeType.Comment;\n textContent: string;\n};\n\nexport type serializedNode = (\n | documentNode\n | documentTypeNode\n | elementNode\n | textNode\n | cdataNode\n | commentNode\n) & {\n rootId?: number;\n isShadowHost?: boolean;\n isShadow?: boolean;\n};\n\nexport type serializedNodeWithId = serializedNode & { id: number };\n\nexport type serializedElementNodeWithId = Extract<\n serializedNodeWithId,\n Record<'type', NodeType.Element>\n>;\n\nexport interface IMirror<TNode> {\n getId(n: TNode | undefined | null): number;\n\n getNode(id: number): TNode | null;\n\n getIds(): number[];\n\n getMeta(n: TNode): serializedNodeWithId | null;\n\n removeNodeFromMap(n: TNode): void;\n\n has(id: number): boolean;\n\n hasNode(node: TNode): boolean;\n\n add(n: TNode, meta: serializedNodeWithId): void;\n\n replace(id: number, n: TNode): void;\n\n reset(): void;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n// Types for @betterbugs/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAY,IAAA,YAAA,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AA;AAAA,GAAA,qBAAA,CAAA,CAAA;AAmGA,IAAA,iBAAA,kBAAAC,oBAAL;AACLA,kBAAA,OAAQ,IAAA;AACRA,kBAAA,OAAQ,IAAA;AAIRA,kBAAA,QAAS,IAAA;AACTA,kBAAA,QAAS,IAAA;AACTA,kBAAA,QAAS,IAAA;AACTA,kBAAA,uBAAwB,IAAA;AACxBA,kBAAA,qBAAsB,IAAA;AACtBA,kBAAA,mBAAoB,IAAA;AACpBA,kBAAA,WAAY,IAAA;AACZA,kBAAA,SAAU,IAAA;AACVA,kBAAA,kBAAmB,IAAA;AACnBA,kBAAA,WAAY,IAAA;AACZA,kBAAA,aAAc,IAAA;AACdA,kBAAA,OAAQ,IAAA;AACRA,kBAAA,aAAc,IAAA;AACdA,kBAAA,UAAW,IAAA;AACXA,kBAAA,SAAU,IAAA;AApBAA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAgDA,IAAA,WAAA,kBAAAC,cAAL;AACLA,YAAA,UAAA,UAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,cAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,MAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,OAAA,IAAA,CAAA,IAAA;AACAA,YAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AANUA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;;;;;;;;;",
6
+ "names": ["EventType", "IncrementalSource", "MouseInteractions", "PointerTypes", "CanvasContext", "MediaInteractions", "ReplayerEvents", "NodeType"]
7
+ }
@@ -0,0 +1,32 @@
1
+ (function (g, f) {
2
+ if ("object" == typeof exports && "object" == typeof module) {
3
+ module.exports = f();
4
+ } else if ("function" == typeof define && define.amd) {
5
+ define("rrwebTypes", [], f);
6
+ } else if ("object" == typeof exports) {
7
+ exports["rrwebTypes"] = f();
8
+ } else {
9
+ g["rrwebTypes"] = f();
10
+ }
11
+ }(this, () => {
12
+ var exports = {};
13
+ var module = { exports };
14
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var u=(h=>(h[h.DomContentLoaded=0]="DomContentLoaded",h[h.Load=1]="Load",h[h.FullSnapshot=2]="FullSnapshot",h[h.IncrementalSnapshot=3]="IncrementalSnapshot",h[h.Meta=4]="Meta",h[h.Custom=5]="Custom",h[h.Plugin=6]="Plugin",h))(u||{}),D=(h=>(h[h.Mutation=0]="Mutation",h[h.MouseMove=1]="MouseMove",h[h.MouseInteraction=2]="MouseInteraction",h[h.Scroll=3]="Scroll",h[h.ViewportResize=4]="ViewportResize",h[h.Input=5]="Input",h[h.TouchMove=6]="TouchMove",h[h.MediaInteraction=7]="MediaInteraction",h[h.StyleSheetRule=8]="StyleSheetRule",h[h.CanvasMutation=9]="CanvasMutation",h[h.Font=10]="Font",h[h.Log=11]="Log",h[h.Drag=12]="Drag",h[h.StyleDeclaration=13]="StyleDeclaration",h[h.Selection=14]="Selection",h[h.AdoptedStyleSheet=15]="AdoptedStyleSheet",h[h.CustomElement=16]="CustomElement",h))(D||{}),C=(h=>(h[h.MouseUp=0]="MouseUp",h[h.MouseDown=1]="MouseDown",h[h.Click=2]="Click",h[h.ContextMenu=3]="ContextMenu",h[h.DblClick=4]="DblClick",h[h.Focus=5]="Focus",h[h.Blur=6]="Blur",h[h.TouchStart=7]="TouchStart",h[h.TouchMove_Departed=8]="TouchMove_Departed",h[h.TouchEnd=9]="TouchEnd",h[h.TouchCancel=10]="TouchCancel",h))(C||{}),d=(h=>(h[h.Mouse=0]="Mouse",h[h.Pen=1]="Pen",h[h.Touch=2]="Touch",h))(d||{}),g=(h=>(h[h["2D"]=0]="2D",h[h.WebGL=1]="WebGL",h[h.WebGL2=2]="WebGL2",h))(g||{}),l=(h=>(h[h.Play=0]="Play",h[h.Pause=1]="Pause",h[h.Seeked=2]="Seeked",h[h.VolumeChange=3]="VolumeChange",h[h.RateChange=4]="RateChange",h))(l||{}),k=(h=>(h.Start="start",h.Pause="pause",h.Resume="resume",h.Resize="resize",h.Finish="finish",h.FullsnapshotRebuilded="fullsnapshot-rebuilded",h.LoadStylesheetStart="load-stylesheet-start",h.LoadStylesheetEnd="load-stylesheet-end",h.SkipStart="skip-start",h.SkipEnd="skip-end",h.MouseInteraction="mouse-interaction",h.EventCast="event-cast",h.CustomEvent="custom-event",h.Flush="flush",h.StateChange="state-change",h.PlayBack="play-back",h.Destroy="destroy",h))(k||{}),L=(h=>(h[h.Document=0]="Document",h[h.DocumentType=1]="DocumentType",h[h.Element=2]="Element",h[h.Text=3]="Text",h[h.CDATA=4]="CDATA",h[h.Comment=5]="Comment",h))(L||{});exports.CanvasContext=g;exports.EventType=u;exports.IncrementalSource=D;exports.MediaInteractions=l;exports.MouseInteractions=C;exports.NodeType=L;exports.PointerTypes=d;exports.ReplayerEvents=k;
15
+ if (typeof module.exports == "object" && typeof exports == "object") {
16
+ var __cp = (to, from, except, desc) => {
17
+ if ((from && typeof from === "object") || typeof from === "function") {
18
+ for (let key of Object.getOwnPropertyNames(from)) {
19
+ if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
20
+ Object.defineProperty(to, key, {
21
+ get: () => from[key],
22
+ enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
23
+ });
24
+ }
25
+ }
26
+ return to;
27
+ };
28
+ module.exports = __cp(module.exports, exports);
29
+ }
30
+ return module.exports;
31
+ }))
32
+ //# sourceMappingURL=types.umd.min.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["export enum EventType {\n DomContentLoaded,\n Load,\n FullSnapshot,\n IncrementalSnapshot,\n Meta,\n Custom,\n Plugin,\n}\n\nexport type domContentLoadedEvent = {\n type: EventType.DomContentLoaded;\n data: unknown;\n};\n\nexport type loadedEvent = {\n type: EventType.Load;\n data: unknown;\n};\n\nexport type fullSnapshotEvent = {\n type: EventType.FullSnapshot;\n data: {\n node: serializedNodeWithId;\n initialOffset: {\n top: number;\n left: number;\n };\n };\n};\n\nexport type incrementalSnapshotEvent = {\n type: EventType.IncrementalSnapshot;\n data: incrementalData;\n};\n\nexport type metaEvent = {\n type: EventType.Meta;\n data: {\n href: string;\n width: number;\n height: number;\n };\n};\n\nexport type customEvent<T = unknown> = {\n type: EventType.Custom;\n data: {\n tag: string;\n payload: T;\n };\n};\n\nexport type pluginEvent<T = unknown> = {\n type: EventType.Plugin;\n data: {\n plugin: string;\n payload: T;\n };\n};\n\nexport enum IncrementalSource {\n Mutation,\n MouseMove,\n MouseInteraction,\n Scroll,\n ViewportResize,\n Input,\n TouchMove,\n MediaInteraction,\n StyleSheetRule,\n CanvasMutation,\n Font,\n Log,\n Drag,\n StyleDeclaration,\n Selection,\n AdoptedStyleSheet,\n CustomElement,\n}\n\nexport type mutationData = {\n source: IncrementalSource.Mutation;\n} & mutationCallbackParam;\n\nexport type mousemoveData = {\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag;\n positions: mousePosition[];\n};\n\nexport type mouseInteractionData = {\n source: IncrementalSource.MouseInteraction;\n} & mouseInteractionParam;\n\nexport type scrollData = {\n source: IncrementalSource.Scroll;\n} & scrollPosition;\n\nexport type viewportResizeData = {\n source: IncrementalSource.ViewportResize;\n} & viewportResizeDimension;\n\nexport type inputData = {\n source: IncrementalSource.Input;\n id: number;\n} & inputValue;\n\nexport type mediaInteractionData = {\n source: IncrementalSource.MediaInteraction;\n} & mediaInteractionParam;\n\nexport type styleSheetRuleData = {\n source: IncrementalSource.StyleSheetRule;\n} & styleSheetRuleParam;\n\nexport type styleDeclarationData = {\n source: IncrementalSource.StyleDeclaration;\n} & styleDeclarationParam;\n\nexport type canvasMutationData = {\n source: IncrementalSource.CanvasMutation;\n} & canvasMutationParam;\n\nexport type fontData = {\n source: IncrementalSource.Font;\n} & fontParam;\n\nexport type selectionData = {\n source: IncrementalSource.Selection;\n} & selectionParam;\n\nexport type adoptedStyleSheetData = {\n source: IncrementalSource.AdoptedStyleSheet;\n} & adoptedStyleSheetParam;\n\nexport type customElementData = {\n source: IncrementalSource.CustomElement;\n} & customElementParam;\n\nexport type incrementalData =\n | mutationData\n | mousemoveData\n | mouseInteractionData\n | scrollData\n | viewportResizeData\n | inputData\n | mediaInteractionData\n | styleSheetRuleData\n | canvasMutationData\n | fontData\n | selectionData\n | styleDeclarationData\n | adoptedStyleSheetData\n | customElementData;\n\nexport type eventWithoutTime =\n | domContentLoadedEvent\n | loadedEvent\n | fullSnapshotEvent\n | incrementalSnapshotEvent\n | metaEvent\n | customEvent\n | pluginEvent;\n\n/**\n * @deprecated intended for internal use\n * a synonym for eventWithoutTime\n */\nexport type event = eventWithoutTime;\n\nexport type eventWithTime = eventWithoutTime & {\n timestamp: number;\n delay?: number;\n};\n\nexport type canvasEventWithTime = eventWithTime & {\n type: EventType.IncrementalSnapshot;\n data: canvasMutationData;\n};\n\nexport type blockClass = string | RegExp;\n\nexport type maskTextClass = string | RegExp;\n\nexport type SamplingStrategy = Partial<{\n /**\n * false means not to record mouse/touch move events\n * number is the throttle threshold of recording mouse/touch move\n */\n mousemove: boolean | number;\n /**\n * number is the throttle threshold of mouse/touch move callback\n */\n mousemoveCallback: number;\n /**\n * false means not to record mouse interaction events\n * can also specify record some kinds of mouse interactions\n */\n mouseInteraction: boolean | Record<string, boolean | undefined>;\n /**\n * number is the throttle threshold of recording scroll\n */\n scroll: number;\n /**\n * number is the throttle threshold of recording media interactions\n */\n media: number;\n /**\n * 'all' will record all the input events\n * 'last' will only record the last input value while input a sequence of chars\n */\n input: 'all' | 'last';\n /**\n * 'all' will record every single canvas call\n * number between 1 and 60, will record an image snapshots in a web-worker a (maximum) number of times per second.\n * Number only supported where [`OffscreenCanvas`](http://mdn.io/offscreencanvas) is supported.\n */\n canvas: 'all' | number;\n}>;\n\nexport interface ICrossOriginIframeMirror {\n getId(\n iframe: HTMLIFrameElement,\n remoteId: number,\n parentToRemoteMap?: Map<number, number>,\n remoteToParentMap?: Map<number, number>,\n ): number;\n getIds(iframe: HTMLIFrameElement, remoteId: number[]): number[];\n getRemoteId(\n iframe: HTMLIFrameElement,\n parentId: number,\n map?: Map<number, number>,\n ): number;\n getRemoteIds(iframe: HTMLIFrameElement, parentId: number[]): number[];\n reset(iframe?: HTMLIFrameElement): void;\n}\n\nexport type RecordPlugin<TOptions = unknown> = {\n name: string;\n observer?: (\n cb: (...args: Array<unknown>) => void,\n win: IWindow,\n options: TOptions,\n ) => listenerHandler;\n eventProcessor?: <TExtend>(event: eventWithTime) => eventWithTime & TExtend;\n getMirror?: (mirrors: {\n nodeMirror: IMirror<Node>;\n crossOriginIframeMirror: ICrossOriginIframeMirror;\n crossOriginIframeStyleMirror: ICrossOriginIframeMirror;\n }) => void;\n options: TOptions;\n};\n\nexport type hooksParam = {\n mutation?: mutationCallBack;\n mousemove?: mousemoveCallBack;\n mouseInteraction?: mouseInteractionCallBack;\n scroll?: scrollCallback;\n viewportResize?: viewportResizeCallback;\n input?: inputCallback;\n mediaInteaction?: mediaInteractionCallback;\n styleSheetRule?: styleSheetRuleCallback;\n styleDeclaration?: styleDeclarationCallback;\n canvasMutation?: canvasMutationCallback;\n font?: fontCallback;\n selection?: selectionCallback;\n customElement?: customElementCallback;\n};\n\n// https://dom.spec.whatwg.org/#interface-mutationrecord\nexport type mutationRecord = Readonly<{\n type: string;\n target: Node;\n oldValue: string | null;\n addedNodes: NodeList;\n removedNodes: NodeList;\n attributeName: string | null;\n}>;\n\nexport type textCursor = {\n node: Node;\n value: string | null;\n};\nexport type textMutation = {\n id: number;\n value: string | null;\n};\n\nexport type styleOMValue = {\n [key: string]: styleValueWithPriority | string | false;\n};\n\nexport type styleValueWithPriority = [string, string];\n\nexport type attributeCursor = {\n node: Node;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n styleDiff: styleOMValue;\n _unchangedStyles: styleOMValue;\n};\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n};\n\nexport type removedNodeMutation = {\n parentId: number;\n id: number;\n isShadow?: boolean;\n};\n\nexport type addedNodeMutation = {\n parentId: number;\n // Newly recorded mutations will not have previousId any more, just for compatibility\n previousId?: number | null;\n nextId: number | null;\n node: serializedNodeWithId;\n};\n\nexport type mutationCallbackParam = {\n texts: textMutation[];\n attributes: attributeMutation[];\n removes: removedNodeMutation[];\n adds: addedNodeMutation[];\n isAttachIframe?: true;\n};\n\nexport type mutationCallBack = (m: mutationCallbackParam) => void;\n\nexport type mousemoveCallBack = (\n p: mousePosition[],\n source:\n | IncrementalSource.MouseMove\n | IncrementalSource.TouchMove\n | IncrementalSource.Drag,\n) => void;\n\nexport type mousePosition = {\n x: number;\n y: number;\n id: number;\n timeOffset: number;\n};\n\nexport type mouseMovePos = {\n x: number;\n y: number;\n id: number;\n debugData: incrementalData;\n};\n\nexport enum MouseInteractions {\n MouseUp,\n MouseDown,\n Click,\n ContextMenu,\n DblClick,\n Focus,\n Blur,\n TouchStart,\n TouchMove_Departed, // we will start a separate observer for touch move event\n TouchEnd,\n TouchCancel,\n}\n\nexport enum PointerTypes {\n Mouse,\n Pen,\n Touch,\n}\n\nexport enum CanvasContext {\n '2D',\n WebGL,\n WebGL2,\n}\n\nexport type SerializedCanvasArg =\n | {\n rr_type: 'ArrayBuffer';\n base64: string; // base64\n }\n | {\n rr_type: 'Blob';\n data: Array<CanvasArg>;\n type?: string;\n }\n | {\n rr_type: string;\n src: string; // url of image\n }\n | {\n rr_type: string;\n args: Array<CanvasArg>;\n }\n | {\n rr_type: string;\n index: number;\n };\n\nexport type CanvasArg =\n | SerializedCanvasArg\n | string\n | number\n | boolean\n | null\n | CanvasArg[];\n\ntype mouseInteractionParam = {\n type: MouseInteractions;\n id: number;\n x?: number;\n y?: number;\n pointerType?: PointerTypes;\n};\n\nexport type mouseInteractionCallBack = (d: mouseInteractionParam) => void;\n\nexport type scrollPosition = {\n id: number;\n x: number;\n y: number;\n};\n\nexport type scrollCallback = (p: scrollPosition) => void;\n\nexport type styleSheetAddRule = {\n rule: string;\n index?: number | number[];\n};\n\nexport type styleSheetDeleteRule = {\n index: number | number[];\n};\n\nexport type styleSheetRuleParam = {\n id?: number;\n styleId?: number;\n removes?: styleSheetDeleteRule[];\n adds?: styleSheetAddRule[];\n replace?: string;\n replaceSync?: string;\n};\n\nexport type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;\n\nexport type adoptedStyleSheetParam = {\n // id indicates the node id of document or shadow DOMs' host element.\n id: number;\n // New CSSStyleSheets which have never appeared before.\n styles?: {\n styleId: number;\n rules: styleSheetAddRule[];\n }[];\n // StyleSheet ids to be adopted.\n styleIds: number[];\n};\n\nexport type adoptedStyleSheetCallback = (a: adoptedStyleSheetParam) => void;\n\nexport type styleDeclarationParam = {\n id?: number;\n styleId?: number;\n index: number[];\n set?: {\n property: string;\n value: string | null;\n priority: string | undefined;\n };\n remove?: {\n property: string;\n };\n};\n\nexport type styleDeclarationCallback = (s: styleDeclarationParam) => void;\n\nexport type canvasMutationCommand = {\n property: string;\n args: Array<unknown>;\n setter?: true;\n};\n\nexport type canvasMutationParam =\n | {\n id: number;\n type: CanvasContext;\n commands: canvasMutationCommand[];\n }\n | ({\n id: number;\n type: CanvasContext;\n } & canvasMutationCommand);\n\nexport type canvasMutationWithType = {\n type: CanvasContext;\n} & canvasMutationCommand;\n\nexport type canvasMutationCallback = (p: canvasMutationParam) => void;\n\nexport type canvasManagerMutationCallback = (\n target: HTMLCanvasElement,\n p: canvasMutationWithType,\n) => void;\n\nexport type ImageBitmapDataURLWorkerParams = {\n id: number;\n bitmap: ImageBitmap;\n width: number;\n height: number;\n dataURLOptions: DataURLOptions;\n};\n\nexport type ImageBitmapDataURLWorkerResponse =\n | {\n id: number;\n }\n | {\n id: number;\n type: string;\n base64: string;\n width: number;\n height: number;\n };\n\nexport type fontParam = {\n family: string;\n fontSource: string;\n buffer: boolean;\n descriptors?: FontFaceDescriptors;\n};\n\nexport type fontCallback = (p: fontParam) => void;\n\nexport type viewportResizeDimension = {\n width: number;\n height: number;\n};\n\nexport type viewportResizeCallback = (d: viewportResizeDimension) => void;\n\nexport type inputValue = {\n text: string;\n isChecked: boolean;\n\n // `userTriggered` indicates if this event was triggered directly by user (userTriggered: true)\n // or was triggered indirectly (userTriggered: false)\n // Example of `userTriggered` in action:\n // User clicks on radio element (userTriggered: true) which triggers the other radio element to change (userTriggered: false)\n userTriggered?: boolean;\n};\n\nexport type inputCallback = (v: inputValue & { id: number }) => void;\n\nexport enum MediaInteractions {\n Play,\n Pause,\n Seeked,\n VolumeChange,\n RateChange,\n}\n\nexport type mediaInteractionParam = {\n type: MediaInteractions;\n id: number;\n currentTime?: number;\n volume?: number;\n muted?: boolean;\n loop?: boolean;\n playbackRate?: number;\n};\n\nexport type mediaInteractionCallback = (p: mediaInteractionParam) => void;\n\nexport type DocumentDimension = {\n x: number;\n y: number;\n // scale value relative to its parent iframe\n relativeScale: number;\n // scale value relative to the root iframe\n absoluteScale: number;\n};\n\nexport type SelectionRange = {\n start: number;\n startOffset: number;\n end: number;\n endOffset: number;\n};\n\nexport type selectionParam = {\n ranges: Array<SelectionRange>;\n};\n\nexport type selectionCallback = (p: selectionParam) => void;\n\nexport type customElementParam = {\n define?: {\n name: string;\n };\n};\n\nexport type customElementCallback = (c: customElementParam) => void;\n\n/**\n * @deprecated\n */\ninterface INode extends Node {\n __sn: serializedNodeWithId;\n}\n\nexport type DeprecatedMirror = {\n map: {\n [key: number]: INode;\n };\n getId: (n: Node) => number;\n getNode: (id: number) => INode | null;\n removeNodeFromMap: (n: Node) => void;\n has: (id: number) => boolean;\n reset: () => void;\n};\n\nexport type throttleOptions = {\n leading?: boolean;\n trailing?: boolean;\n};\n\nexport type listenerHandler = () => void;\nexport type hookResetter = () => void;\n\nexport type playerMetaData = {\n startTime: number;\n endTime: number;\n totalTime: number;\n};\n\nexport type actionWithDelay = {\n doAction: () => void;\n delay: number;\n};\n\nexport type Handler = (event?: unknown) => void;\n\nexport type Emitter = {\n on(type: string, handler: Handler): void;\n emit(type: string, event?: unknown): void;\n off(type: string, handler: Handler): void;\n};\n\nexport type Arguments<T> = T extends (...payload: infer U) => unknown\n ? U\n : unknown;\n\nexport enum ReplayerEvents {\n Start = 'start',\n Pause = 'pause',\n /**\n * @deprecated use Play instead\n */\n Resume = 'resume',\n Resize = 'resize',\n Finish = 'finish',\n FullsnapshotRebuilded = 'fullsnapshot-rebuilded',\n LoadStylesheetStart = 'load-stylesheet-start',\n LoadStylesheetEnd = 'load-stylesheet-end',\n SkipStart = 'skip-start',\n SkipEnd = 'skip-end',\n MouseInteraction = 'mouse-interaction',\n EventCast = 'event-cast',\n CustomEvent = 'custom-event',\n Flush = 'flush',\n StateChange = 'state-change',\n PlayBack = 'play-back',\n Destroy = 'destroy',\n}\n\nexport type KeepIframeSrcFn = (src: string) => boolean;\n\ndeclare global {\n interface Window {\n FontFace: typeof FontFace;\n }\n}\n\nexport type IWindow = Window & typeof globalThis;\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type GetTypedKeys<Obj extends object, ValueType> = TakeTypeHelper<\n Obj,\n ValueType\n>[keyof TakeTypeHelper<Obj, ValueType>];\nexport type TakeTypeHelper<Obj extends object, ValueType> = {\n [K in keyof Obj]: Obj[K] extends ValueType ? K : never;\n};\n\nexport type TakeTypedKeyValues<Obj extends object, Type> = Pick<\n Obj,\n TakeTypeHelper<Obj, Type>[keyof TakeTypeHelper<Obj, Type>]\n>;\n\nexport enum NodeType {\n Document,\n DocumentType,\n Element,\n Text,\n CDATA,\n Comment,\n}\n\nexport type documentNode = {\n type: NodeType.Document;\n childNodes: serializedNodeWithId[];\n compatMode?: string;\n};\n\nexport type documentTypeNode = {\n type: NodeType.DocumentType;\n name: string;\n publicId: string;\n systemId: string;\n};\n\ntype cssTextKeyAttr = {\n _cssText?: string;\n};\n\nexport type attributes = cssTextKeyAttr & {\n [key: string]:\n | string\n | number // properties e.g. rr_scrollLeft or rr_mediaCurrentTime\n | true // e.g. checked on <input type=\"radio\">\n | null; // an indication that an attribute was removed (during a mutation)\n};\n\nexport type legacyAttributes = {\n /**\n * @deprecated old bug in rrweb was causing these to always be set\n * @see https://github.com/rrweb-io/rrweb/pull/651\n */\n selected: false;\n};\n\nexport type mediaAttributes = {\n rr_mediaState: 'played' | 'paused';\n rr_mediaCurrentTime: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaPlaybackRate?: number;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaMuted?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaLoop?: boolean;\n /**\n * for backwards compatibility this is optional but should always be set\n */\n rr_mediaVolume?: number;\n};\n\nexport type elementNode = {\n type: NodeType.Element;\n tagName: string;\n attributes: attributes;\n childNodes: serializedNodeWithId[];\n isSVG?: true;\n needBlock?: boolean;\n // This is a custom element or not.\n isCustom?: true;\n};\n\nexport type textNode = {\n type: NodeType.Text;\n textContent: string;\n /**\n * @deprecated styles are now always snapshotted against parent <style> element\n * style mutations can still happen via an added textNode, but they don't need this attribute for correct replay\n */\n isStyle?: true;\n};\n\nexport type cdataNode = {\n type: NodeType.CDATA;\n textContent: '';\n};\n\nexport type commentNode = {\n type: NodeType.Comment;\n textContent: string;\n};\n\nexport type serializedNode = (\n | documentNode\n | documentTypeNode\n | elementNode\n | textNode\n | cdataNode\n | commentNode\n) & {\n rootId?: number;\n isShadowHost?: boolean;\n isShadow?: boolean;\n};\n\nexport type serializedNodeWithId = serializedNode & { id: number };\n\nexport type serializedElementNodeWithId = Extract<\n serializedNodeWithId,\n Record<'type', NodeType.Element>\n>;\n\nexport interface IMirror<TNode> {\n getId(n: TNode | undefined | null): number;\n\n getNode(id: number): TNode | null;\n\n getIds(): number[];\n\n getMeta(n: TNode): serializedNodeWithId | null;\n\n removeNodeFromMap(n: TNode): void;\n\n has(id: number): boolean;\n\n hasNode(node: TNode): boolean;\n\n add(n: TNode, meta: serializedNodeWithId): void;\n\n replace(id: number, n: TNode): void;\n\n reset(): void;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n// Types for @betterbugs/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],
5
+ "mappings": ";;;;;;;;;;;;;gFAAY,IAAAA,GAAAA,IACVA,EAAAC,EAAA,iBAAA,CAAA,EAAA,mBACAD,EAAAC,EAAA,KAAA,CAAA,EAAA,OACAD,EAAAC,EAAA,aAAA,CAAA,EAAA,eACAD,EAAAC,EAAA,oBAAA,CAAA,EAAA,sBACAD,EAAAC,EAAA,KAAA,CAAA,EAAA,OACAD,EAAAC,EAAA,OAAA,CAAA,EAAA,SACAD,EAAAC,EAAA,OAAA,CAAA,EAAA,SAPUD,IAAAA,GAAA,CAAA,CAAA,EA6DAE,GAAAA,IACVA,EAAAC,EAAA,SAAA,CAAA,EAAA,WACAD,EAAAC,EAAA,UAAA,CAAA,EAAA,YACAD,EAAAC,EAAA,iBAAA,CAAA,EAAA,mBACAD,EAAAC,EAAA,OAAA,CAAA,EAAA,SACAD,EAAAC,EAAA,eAAA,CAAA,EAAA,iBACAD,EAAAC,EAAA,MAAA,CAAA,EAAA,QACAD,EAAAC,EAAA,UAAA,CAAA,EAAA,YACAD,EAAAC,EAAA,iBAAA,CAAA,EAAA,mBACAD,EAAAC,EAAA,eAAA,CAAA,EAAA,iBACAD,EAAAC,EAAA,eAAA,CAAA,EAAA,iBACAD,EAAAC,EAAA,KAAA,EAAA,EAAA,OACAD,EAAAC,EAAA,IAAA,EAAA,EAAA,MACAD,EAAAC,EAAA,KAAA,EAAA,EAAA,OACAD,EAAAC,EAAA,iBAAA,EAAA,EAAA,mBACAD,EAAAC,EAAA,UAAA,EAAA,EAAA,YACAD,EAAAC,EAAA,kBAAA,EAAA,EAAA,oBACAD,EAAAC,EAAA,cAAA,EAAA,EAAA,gBAjBUD,IAAAA,GAAA,CAAA,CAAA,EAyS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,EAAA,iBAAmB,oBACnBA,EAAA,UAAY,aACZA,EAAA,YAAc,eACdA,EAAA,MAAQ,QACRA,EAAA,YAAc,eACdA,EAAA,SAAW,YACXA,EAAA,QAAU,UApBAA,IAAAA,GAAA,CAAA,CAAA,EAgDAC,GAAAA,IACVA,EAAAC,EAAA,SAAA,CAAA,EAAA,WACAD,EAAAC,EAAA,aAAA,CAAA,EAAA,eACAD,EAAAC,EAAA,QAAA,CAAA,EAAA,UACAD,EAAAC,EAAA,KAAA,CAAA,EAAA,OACAD,EAAAC,EAAA,MAAA,CAAA,EAAA,QACAD,EAAAC,EAAA,QAAA,CAAA,EAAA,UANUD,IAAAA,GAAA,CAAA,CAAA",
6
+ "names": ["EventType", "EventType2", "IncrementalSource", "IncrementalSource2", "MouseInteractions", "MouseInteractions2", "PointerTypes", "PointerTypes2", "CanvasContext", "CanvasContext2", "MediaInteractions", "MediaInteractions2", "ReplayerEvents", "NodeType", "NodeType2"]
7
+ }