@appsurify-testmap/rrweb-types 3.1.1-alpha.1 → 3.1.1-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -41,6 +41,7 @@ export declare type attributeMutation = {
41
41
  attributes: {
42
42
  [key: string]: string | styleOMValue | null;
43
43
  };
44
+ selector?: string;
44
45
  };
45
46
 
46
47
  export declare type attributes = cssTextKeyAttr & {
@@ -238,6 +239,7 @@ export declare type hooksParam = {
238
239
  mouseInteraction?: mouseInteractionCallBack;
239
240
  scroll?: scrollCallback;
240
241
  viewportResize?: viewportResizeCallback;
242
+ navigation?: navigationCallback;
241
243
  input?: inputCallback;
242
244
  mediaInteaction?: mediaInteractionCallback;
243
245
  styleSheetRule?: styleSheetRuleCallback;
@@ -246,7 +248,6 @@ export declare type hooksParam = {
246
248
  font?: fontCallback;
247
249
  selection?: selectionCallback;
248
250
  customElement?: customElementCallback;
249
- visibilityMutation?: visibilityMutationCallback;
250
251
  };
251
252
 
252
253
  export declare interface ICrossOriginIframeMirror {
@@ -286,6 +287,9 @@ export declare interface IMirror<TNode> {
286
287
  add(n: TNode, meta: serializedNodeWithId): void;
287
288
  replace(id: number, n: TNode): void;
288
289
  reset(): void;
290
+ getNodeBySelector(selector: string): TNode | null;
291
+ getNodesBySelector(selector: string): TNode[];
292
+ hasSelector(selector: string): boolean;
289
293
  }
290
294
 
291
295
  export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData | visibilityMutationData;
@@ -313,7 +317,7 @@ export declare enum IncrementalSource {
313
317
  Selection = 14,
314
318
  AdoptedStyleSheet = 15,
315
319
  CustomElement = 16,
316
- VisibilityMutation = 17
320
+ Visibility = 17
317
321
  }
318
322
 
319
323
  declare interface INode extends Node {
@@ -466,6 +470,12 @@ export declare type mutationRecord = Readonly<{
466
470
  attributeName: string | null;
467
471
  }>;
468
472
 
473
+ export declare type navigationCallback = (data: {
474
+ href: string;
475
+ oldHref: string;
476
+ navigationType: 'pushState' | 'replaceState' | 'popstate' | 'hashchange';
477
+ }) => void;
478
+
469
479
  export declare enum NodeType {
470
480
  Document = 0,
471
481
  DocumentType = 1,
@@ -545,6 +555,7 @@ export declare type SamplingStrategy = Partial<{
545
555
  media: number;
546
556
  input: 'all' | 'last';
547
557
  canvas: 'all' | number;
558
+ navigation: boolean;
548
559
  visibility: boolean | Record<string, boolean | number | string | undefined>;
549
560
  }>;
550
561
 
@@ -681,6 +692,7 @@ export declare type textCursor = {
681
692
  export declare type textMutation = {
682
693
  id: number;
683
694
  value: string | null;
695
+ selector?: string;
684
696
  };
685
697
 
686
698
  export declare type textNode = {
@@ -707,21 +719,22 @@ export declare type viewportResizeDimension = {
707
719
  height: number;
708
720
  };
709
721
 
722
+ export declare type visibilityCallBack = (v: visibilityCallbackParam) => void;
723
+
724
+ export declare type visibilityCallbackParam = {
725
+ mutations: visibilityMutation[];
726
+ };
727
+
710
728
  export declare type visibilityMutation = {
711
729
  id: number;
712
730
  isVisible: boolean;
713
731
  ratio?: number;
714
- };
715
-
716
- export declare type visibilityMutationCallback = (v: visibilityMutationCallbackParam) => void;
717
-
718
- export declare type visibilityMutationCallbackParam = {
719
- mutations: visibilityMutation[];
732
+ selector?: string;
720
733
  };
721
734
 
722
735
  export declare type visibilityMutationData = {
723
- source: IncrementalSource.VisibilityMutation;
724
- } & visibilityMutationCallbackParam;
736
+ source: IncrementalSource.Visibility;
737
+ } & visibilityCallbackParam;
725
738
 
726
739
  export { }
727
740
 
package/dist/index.d.ts CHANGED
@@ -41,6 +41,7 @@ export declare type attributeMutation = {
41
41
  attributes: {
42
42
  [key: string]: string | styleOMValue | null;
43
43
  };
44
+ selector?: string;
44
45
  };
45
46
 
46
47
  export declare type attributes = cssTextKeyAttr & {
@@ -238,6 +239,7 @@ export declare type hooksParam = {
238
239
  mouseInteraction?: mouseInteractionCallBack;
239
240
  scroll?: scrollCallback;
240
241
  viewportResize?: viewportResizeCallback;
242
+ navigation?: navigationCallback;
241
243
  input?: inputCallback;
242
244
  mediaInteaction?: mediaInteractionCallback;
243
245
  styleSheetRule?: styleSheetRuleCallback;
@@ -246,7 +248,6 @@ export declare type hooksParam = {
246
248
  font?: fontCallback;
247
249
  selection?: selectionCallback;
248
250
  customElement?: customElementCallback;
249
- visibilityMutation?: visibilityMutationCallback;
250
251
  };
251
252
 
252
253
  export declare interface ICrossOriginIframeMirror {
@@ -286,6 +287,9 @@ export declare interface IMirror<TNode> {
286
287
  add(n: TNode, meta: serializedNodeWithId): void;
287
288
  replace(id: number, n: TNode): void;
288
289
  reset(): void;
290
+ getNodeBySelector(selector: string): TNode | null;
291
+ getNodesBySelector(selector: string): TNode[];
292
+ hasSelector(selector: string): boolean;
289
293
  }
290
294
 
291
295
  export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData | selectionData | styleDeclarationData | adoptedStyleSheetData | customElementData | visibilityMutationData;
@@ -313,7 +317,7 @@ export declare enum IncrementalSource {
313
317
  Selection = 14,
314
318
  AdoptedStyleSheet = 15,
315
319
  CustomElement = 16,
316
- VisibilityMutation = 17
320
+ Visibility = 17
317
321
  }
318
322
 
319
323
  declare interface INode extends Node {
@@ -466,6 +470,12 @@ export declare type mutationRecord = Readonly<{
466
470
  attributeName: string | null;
467
471
  }>;
468
472
 
473
+ export declare type navigationCallback = (data: {
474
+ href: string;
475
+ oldHref: string;
476
+ navigationType: 'pushState' | 'replaceState' | 'popstate' | 'hashchange';
477
+ }) => void;
478
+
469
479
  export declare enum NodeType {
470
480
  Document = 0,
471
481
  DocumentType = 1,
@@ -545,6 +555,7 @@ export declare type SamplingStrategy = Partial<{
545
555
  media: number;
546
556
  input: 'all' | 'last';
547
557
  canvas: 'all' | number;
558
+ navigation: boolean;
548
559
  visibility: boolean | Record<string, boolean | number | string | undefined>;
549
560
  }>;
550
561
 
@@ -681,6 +692,7 @@ export declare type textCursor = {
681
692
  export declare type textMutation = {
682
693
  id: number;
683
694
  value: string | null;
695
+ selector?: string;
684
696
  };
685
697
 
686
698
  export declare type textNode = {
@@ -707,21 +719,22 @@ export declare type viewportResizeDimension = {
707
719
  height: number;
708
720
  };
709
721
 
722
+ export declare type visibilityCallBack = (v: visibilityCallbackParam) => void;
723
+
724
+ export declare type visibilityCallbackParam = {
725
+ mutations: visibilityMutation[];
726
+ };
727
+
710
728
  export declare type visibilityMutation = {
711
729
  id: number;
712
730
  isVisible: boolean;
713
731
  ratio?: number;
714
- };
715
-
716
- export declare type visibilityMutationCallback = (v: visibilityMutationCallbackParam) => void;
717
-
718
- export declare type visibilityMutationCallbackParam = {
719
- mutations: visibilityMutation[];
732
+ selector?: string;
720
733
  };
721
734
 
722
735
  export declare type visibilityMutationData = {
723
- source: IncrementalSource.VisibilityMutation;
724
- } & visibilityMutationCallbackParam;
736
+ source: IncrementalSource.Visibility;
737
+ } & visibilityCallbackParam;
725
738
 
726
739
  export { }
727
740
 
@@ -28,7 +28,7 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
28
28
  IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
29
29
  IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
30
30
  IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
31
- IncrementalSource2[IncrementalSource2["VisibilityMutation"] = 17] = "VisibilityMutation";
31
+ IncrementalSource2[IncrementalSource2["Visibility"] = 17] = "Visibility";
32
32
  return IncrementalSource2;
33
33
  })(IncrementalSource || {});
34
34
  var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
@@ -1 +1 @@
1
- {"version":3,"file":"rrweb-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 VisibilityMutation,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n}\n\nexport type visibilityMutationCallbackParam = {\n mutations: visibilityMutation[];\n}\n\nexport type visibilityMutationCallback = (v: visibilityMutationCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.VisibilityMutation;\n} & visibilityMutationCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means do not record visibility changes\n *\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 visibilityMutation?: visibilityMutationCallback;\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};\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};\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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],"names":["EventType","IncrementalSource","MouseInteractions","PointerTypes","CanvasContext","MediaInteractions","ReplayerEvents","NodeType"],"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AA,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;;;;;;;;;"}
1
+ {"version":3,"file":"rrweb-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 Visibility,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n selector?: string;\n};\n\nexport type visibilityCallbackParam = {\n mutations: visibilityMutation[];\n};\n\nexport type visibilityCallBack = (v: visibilityCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.Visibility;\n} & visibilityCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means not to record navigation events\n * default: true (enabled)\n */\n navigation: boolean;\n /**\n * Visibility observer: false to disable; object for debounce/throttle/threshold/sensitivity/rafThrottle.\n * When object: recordVisibility (default false) — if true, record incremental events with source Visibility;\n * if false/omitted, only notify for checkout (full snapshot by checkoutEveryNvm threshold).\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 navigation?: navigationCallback;\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};\n\nexport type textMutation = {\n id: number;\n value: string | null;\n selector?: string;\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};\n\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n selector?: string;\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 navigationCallback = (data: {\n href: string;\n oldHref: string;\n navigationType: 'pushState' | 'replaceState' | 'popstate' | 'hashchange';\n}) => 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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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 /**\n * Get the first node with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns First matching node or null if not found\n */\n getNodeBySelector(selector: string): TNode | null;\n\n /**\n * Get all nodes with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns Array of matching nodes (empty array if none found)\n */\n getNodesBySelector(selector: string): TNode[];\n\n /**\n * Check if any node with the given SEQL selector exists in the mirror.\n * @param selector - SEQL selector string\n * @returns true if at least one node with this selector exists\n */\n hasSelector(selector: string): boolean;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],"names":["EventType","IncrementalSource","MouseInteractions","PointerTypes","CanvasContext","MediaInteractions","ReplayerEvents","NodeType"],"mappings":";;AAAO,IAAK,8BAAAA,eAAL;AACLA,aAAAA,WAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,cAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,qBAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,QAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,QAAA,IAAA,CAAA,IAAA;AAPU,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AA6DL,IAAK,sCAAAC,uBAAL;AACLA,qBAAAA,mBAAA,UAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,WAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,QAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,gBAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,OAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,WAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,gBAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,gBAAA,IAAA,CAAA,IAAA;AACAA,qBAAAA,mBAAA,MAA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AAA,IAAA,CAAA,IAAA;AANU,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;;;;;;;;;"}
@@ -26,7 +26,7 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
26
26
  IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
27
27
  IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
28
28
  IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
29
- IncrementalSource2[IncrementalSource2["VisibilityMutation"] = 17] = "VisibilityMutation";
29
+ IncrementalSource2[IncrementalSource2["Visibility"] = 17] = "Visibility";
30
30
  return IncrementalSource2;
31
31
  })(IncrementalSource || {});
32
32
  var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
@@ -1 +1 @@
1
- {"version":3,"file":"rrweb-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 VisibilityMutation,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n}\n\nexport type visibilityMutationCallbackParam = {\n mutations: visibilityMutation[];\n}\n\nexport type visibilityMutationCallback = (v: visibilityMutationCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.VisibilityMutation;\n} & visibilityMutationCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means do not record visibility changes\n *\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 visibilityMutation?: visibilityMutationCallback;\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};\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};\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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/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,qBAA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,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;"}
1
+ {"version":3,"file":"rrweb-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 Visibility,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n selector?: string;\n};\n\nexport type visibilityCallbackParam = {\n mutations: visibilityMutation[];\n};\n\nexport type visibilityCallBack = (v: visibilityCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.Visibility;\n} & visibilityCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means not to record navigation events\n * default: true (enabled)\n */\n navigation: boolean;\n /**\n * Visibility observer: false to disable; object for debounce/throttle/threshold/sensitivity/rafThrottle.\n * When object: recordVisibility (default false) — if true, record incremental events with source Visibility;\n * if false/omitted, only notify for checkout (full snapshot by checkoutEveryNvm threshold).\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 navigation?: navigationCallback;\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};\n\nexport type textMutation = {\n id: number;\n value: string | null;\n selector?: string;\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};\n\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n selector?: string;\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 navigationCallback = (data: {\n href: string;\n oldHref: string;\n navigationType: 'pushState' | 'replaceState' | 'popstate' | 'hashchange';\n}) => 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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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 /**\n * Get the first node with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns First matching node or null if not found\n */\n getNodeBySelector(selector: string): TNode | null;\n\n /**\n * Get all nodes with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns Array of matching nodes (empty array if none found)\n */\n getNodesBySelector(selector: string): TNode[];\n\n /**\n * Check if any node with the given SEQL selector exists in the mirror.\n * @param selector - SEQL selector string\n * @returns true if at least one node with this selector exists\n */\n hasSelector(selector: string): boolean;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],"names":["EventType","IncrementalSource","MouseInteractions","PointerTypes","CanvasContext","MediaInteractions","ReplayerEvents","NodeType"],"mappings":"AAAO,IAAK,8BAAAA,eAAL;AACLA,aAAAA,WAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,cAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,qBAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,QAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,QAAA,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IAAsB;AACtBA,kBAAA,mBAAA,IAAoB;AACpBA,kBAAA,WAAA,IAAY;AACZA,kBAAA,SAAA,IAAU;AACVA,kBAAA,kBAAA,IAAmB;AACnBA,kBAAA,WAAA,IAAY;AACZA,kBAAA,aAAA,IAAc;AACdA,kBAAA,OAAA,IAAQ;AACRA,kBAAA,aAAA,IAAc;AACdA,kBAAA,UAAA,IAAW;AACXA,kBAAA,SAAA,IAAU;AApBA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAgDL,IAAK,6BAAAC,cAAL;AACLA,YAAAA,UAAA,UAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,cAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,MAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,OAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AANU,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;"}
@@ -1,16 +1,4 @@
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 };
1
+ (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrwebTypes", [], f);} else if ("object" == typeof exports) {exports["rrwebTypes"] = f();} else {g["rrwebTypes"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
14
2
  "use strict";
15
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
16
4
  var EventType = /* @__PURE__ */ ((EventType2) => {
@@ -41,7 +29,7 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
41
29
  IncrementalSource2[IncrementalSource2["Selection"] = 14] = "Selection";
42
30
  IncrementalSource2[IncrementalSource2["AdoptedStyleSheet"] = 15] = "AdoptedStyleSheet";
43
31
  IncrementalSource2[IncrementalSource2["CustomElement"] = 16] = "CustomElement";
44
- IncrementalSource2[IncrementalSource2["VisibilityMutation"] = 17] = "VisibilityMutation";
32
+ IncrementalSource2[IncrementalSource2["Visibility"] = 17] = "Visibility";
45
33
  return IncrementalSource2;
46
34
  })(IncrementalSource || {});
47
35
  var MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {
@@ -115,7 +103,7 @@ exports.MouseInteractions = MouseInteractions;
115
103
  exports.NodeType = NodeType;
116
104
  exports.PointerTypes = PointerTypes;
117
105
  exports.ReplayerEvents = ReplayerEvents;
118
- if (typeof module.exports == "object" && typeof exports == "object") {
106
+ ;if (typeof module.exports == "object" && typeof exports == "object") {
119
107
  var __cp = (to, from, except, desc) => {
120
108
  if ((from && typeof from === "object") || typeof from === "function") {
121
109
  for (let key of Object.getOwnPropertyNames(from)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 VisibilityMutation,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n}\n\nexport type visibilityMutationCallbackParam = {\n mutations: visibilityMutation[];\n}\n\nexport type visibilityMutationCallback = (v: visibilityMutationCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.VisibilityMutation;\n} & visibilityMutationCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means do not record visibility changes\n *\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 visibilityMutation?: visibilityMutationCallback;\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};\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};\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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;AAAY,IAAA,YAAA,kBAAAA,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,oBAAA,kBAAAC,uBAAL;AACLA,qBAAA,mBAAA,UAAA,IAAA,CAAA,IAAA;AACAA,qBAAA,mBAAA,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,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;;;;;;;;;",
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 Visibility,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n selector?: string;\n};\n\nexport type visibilityCallbackParam = {\n mutations: visibilityMutation[];\n};\n\nexport type visibilityCallBack = (v: visibilityCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.Visibility;\n} & visibilityCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means not to record navigation events\n * default: true (enabled)\n */\n navigation: boolean;\n /**\n * Visibility observer: false to disable; object for debounce/throttle/threshold/sensitivity/rafThrottle.\n * When object: recordVisibility (default false) — if true, record incremental events with source Visibility;\n * if false/omitted, only notify for checkout (full snapshot by checkoutEveryNvm threshold).\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 navigation?: navigationCallback;\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};\n\nexport type textMutation = {\n id: number;\n value: string | null;\n selector?: string;\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};\n\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n selector?: string;\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 navigationCallback = (data: {\n href: string;\n oldHref: string;\n navigationType: 'pushState' | 'replaceState' | 'popstate' | 'hashchange';\n}) => 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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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 /**\n * Get the first node with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns First matching node or null if not found\n */\n getNodeBySelector(selector: string): TNode | null;\n\n /**\n * Get all nodes with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns Array of matching nodes (empty array if none found)\n */\n getNodesBySelector(selector: string): TNode[];\n\n /**\n * Check if any node with the given SEQL selector exists in the mirror.\n * @param selector - SEQL selector string\n * @returns true if at least one node with this selector exists\n */\n hasSelector(selector: string): boolean;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],
5
+ "mappings": ";;;AAAO,IAAK,YAAA,kBAAAA,eAAL;AACLA,aAAAA,WAAA,kBAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,MAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,cAAA,IAAA,CAAA,IAAA;AACAA,aAAAA,WAAA,qBAAA,IAAA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,OAAA,IAAQ;AACRA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,QAAA,IAAS;AACTA,kBAAA,QAAA,IAAS;AACTA,kBAAA,QAAA,IAAS;AACTA,kBAAA,uBAAA,IAAwB;AACxBA,kBAAA,qBAAA,IAAsB;AACtBA,kBAAA,mBAAA,IAAoB;AACpBA,kBAAA,WAAA,IAAY;AACZA,kBAAA,SAAA,IAAU;AACVA,kBAAA,kBAAA,IAAmB;AACnBA,kBAAA,WAAA,IAAY;AACZA,kBAAA,aAAA,IAAc;AACdA,kBAAA,OAAA,IAAQ;AACRA,kBAAA,aAAA,IAAc;AACdA,kBAAA,UAAA,IAAW;AACXA,kBAAA,SAAA,IAAU;AApBA,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAgDL,IAAK,WAAA,kBAAAC,cAAL;AACLA,YAAAA,UAAA,UAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,cAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,MAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,OAAA,IAAA,CAAA,IAAA;AACAA,YAAAA,UAAA,SAAA,IAAA,CAAA,IAAA;AANU,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;;;;;;;;;",
6
6
  "names": ["EventType", "IncrementalSource", "MouseInteractions", "PointerTypes", "CanvasContext", "MediaInteractions", "ReplayerEvents", "NodeType"]
7
7
  }
@@ -1,18 +1,6 @@
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[h.VisibilityMutation=17]="VisibilityMutation",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||{}),b=(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))(b||{}),i=(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))(i||{});exports.CanvasContext=g;exports.EventType=u;exports.IncrementalSource=D;exports.MediaInteractions=l;exports.MouseInteractions=C;exports.NodeType=i;exports.PointerTypes=d;exports.ReplayerEvents=b;
15
- if (typeof module.exports == "object" && typeof exports == "object") {
1
+ (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrwebTypes", [], f);} else if ("object" == typeof exports) {exports["rrwebTypes"] = f();} else {g["rrwebTypes"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
2
+ "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[h.Visibility=17]="Visibility",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||{}),b=(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))(b||{}),k=(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))(k||{});exports.CanvasContext=g;exports.EventType=u;exports.IncrementalSource=D;exports.MediaInteractions=l;exports.MouseInteractions=C;exports.NodeType=k;exports.PointerTypes=d;exports.ReplayerEvents=b;
3
+ ;if (typeof module.exports == "object" && typeof exports == "object") {
16
4
  var __cp = (to, from, except, desc) => {
17
5
  if ((from && typeof from === "object") || typeof from === "function") {
18
6
  for (let key of Object.getOwnPropertyNames(from)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 VisibilityMutation,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n}\n\nexport type visibilityMutationCallbackParam = {\n mutations: visibilityMutation[];\n}\n\nexport type visibilityMutationCallback = (v: visibilityMutationCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.VisibilityMutation;\n} & visibilityMutationCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means do not record visibility changes\n *\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 visibilityMutation?: visibilityMutationCallback;\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};\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};\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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/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,gBACAD,EAAAC,EAAA,mBAAA,EAAA,EAAA,qBAl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EAAA,UAAY,aACZA,EAAA,QAAU,WACVA,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"]
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 Visibility,\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 visibilityMutation = {\n id: number;\n isVisible: boolean;\n ratio?: number;\n selector?: string;\n};\n\nexport type visibilityCallbackParam = {\n mutations: visibilityMutation[];\n};\n\nexport type visibilityCallBack = (v: visibilityCallbackParam) => void;\n\nexport type visibilityMutationData = {\n source: IncrementalSource.Visibility;\n} & visibilityCallbackParam;\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 | visibilityMutationData\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 excludeAttribute = 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 * false means not to record navigation events\n * default: true (enabled)\n */\n navigation: boolean;\n /**\n * Visibility observer: false to disable; object for debounce/throttle/threshold/sensitivity/rafThrottle.\n * When object: recordVisibility (default false) — if true, record incremental events with source Visibility;\n * if false/omitted, only notify for checkout (full snapshot by checkoutEveryNvm threshold).\n */\n visibility: boolean | Record<string, boolean | number | string | undefined>;\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 navigation?: navigationCallback;\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};\n\nexport type textMutation = {\n id: number;\n value: string | null;\n selector?: string;\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};\n\nexport type attributeMutation = {\n id: number;\n attributes: {\n [key: string]: string | styleOMValue | null;\n };\n selector?: string;\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 navigationCallback = (data: {\n href: string;\n oldHref: string;\n navigationType: 'pushState' | 'replaceState' | 'popstate' | 'hashchange';\n}) => 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 isVisible?: boolean;\n isInteractive?: boolean;\n selector?: string;\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 /**\n * Get the first node with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns First matching node or null if not found\n */\n getNodeBySelector(selector: string): TNode | null;\n\n /**\n * Get all nodes with the given SEQL selector.\n * @param selector - SEQL selector string\n * @returns Array of matching nodes (empty array if none found)\n */\n getNodesBySelector(selector: string): TNode[];\n\n /**\n * Check if any node with the given SEQL selector exists in the mirror.\n * @param selector - SEQL selector string\n * @returns true if at least one node with this selector exists\n */\n hasSelector(selector: string): boolean;\n}\n\nexport type DataURLOptions = Partial<{\n type: string;\n quality: number;\n}>;\n\n/**\n * Options for SEQL selector generation.\n * SEQL (Semantic Element Query Language) generates stable selectors based on\n * semantic HTML, ARIA roles, and stable attributes rather than brittle CSS paths.\n */\nexport type SelectorOptions = Partial<{\n /**\n * Maximum depth for path traversal from anchor to target.\n * Default: 10\n */\n maxPathDepth: number;\n\n /**\n * Enable SVG fingerprinting for SVG elements.\n * Default: true\n */\n enableSvgFingerprint: boolean;\n\n /**\n * Minimum confidence threshold to accept generated selector.\n * Default: 0.3\n */\n confidenceThreshold: number;\n\n /**\n * Fallback to body element if no semantic anchor found.\n * Default: true\n */\n fallbackToBody: boolean;\n}>;\n\n// Types for @rrweb/packer\nexport type PackFn = (event: eventWithTime) => string;\nexport type UnpackFn = (raw: string) => eventWithTime;\n"],
5
+ "mappings": ";gFAAO,IAAKA,GAAAA,IACVA,EAAAA,EAAA,iBAAA,CAAA,EAAA,mBACAA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CAAA,EAAA,eACAA,EAAAA,EAAA,QAAA,CAAA,EAAA,UACAA,EAAAA,EAAA,KAAA,CAAA,EAAA,OACAA,EAAAA,EAAA,MAAA,CAAA,EAAA,QACAA,EAAAA,EAAA,QAAA,CAAA,EAAA,UANUA,IAAAA,GAAA,CAAA,CAAA",
6
+ "names": ["EventType", "IncrementalSource", "MouseInteractions", "PointerTypes", "CanvasContext", "MediaInteractions", "ReplayerEvents", "NodeType"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsurify-testmap/rrweb-types",
3
- "version": "3.1.1-alpha.1",
3
+ "version": "3.1.1-alpha.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },