@highlight-run/rrweb 0.12.13 → 1.1.0

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.
@@ -7,7 +7,7 @@ declare type LogRecordOptions = {
7
7
  level?: LogLevel[] | undefined;
8
8
  lengthThreshold?: number;
9
9
  stringifyOptions?: StringifyOptions;
10
- logger?: Logger;
10
+ logger?: Logger | string;
11
11
  };
12
12
  export declare type LogData = {
13
13
  level: LogLevel;
@@ -0,0 +1,2 @@
1
+ import { blockClass, canvasMutationCallback, IWindow, listenerHandler, Mirror } from '../../../types';
2
+ export default function initCanvas2DMutationObserver(cb: canvasMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;
@@ -0,0 +1,2 @@
1
+ import { blockClass, IWindow, listenerHandler } from '../../../types';
2
+ export default function initCanvasContextObserver(win: IWindow, blockClass: blockClass): listenerHandler;
@@ -0,0 +1,4 @@
1
+ import { SerializedWebGlArg } from '../../../types';
2
+ export declare function serializeArg(value: any): SerializedWebGlArg;
3
+ export declare const serializeArgs: (args: Array<any>) => SerializedWebGlArg[];
4
+ export declare const saveWebGLVar: (value: any) => number | void;
@@ -0,0 +1,2 @@
1
+ import { blockClass, canvasMutationCallback, IWindow, listenerHandler, Mirror } from '../../../types';
2
+ export default function initCanvasWebGLMutationObserver(cb: canvasMutationCallback, win: IWindow, blockClass: blockClass, mirror: Mirror): listenerHandler;
@@ -0,0 +1,2 @@
1
+ import { StringifyOptions } from '../types';
2
+ export declare function stringify(obj: any, stringifyOptions?: StringifyOptions): string;
@@ -0,0 +1,9 @@
1
+ import { Replayer } from '../';
2
+ import { canvasMutationData } from '../../types';
3
+ export default function canvasMutation({ event, mutation, target, imageMap, errorHandler, }: {
4
+ event: Parameters<Replayer['applyIncremental']>[0];
5
+ mutation: canvasMutationData;
6
+ target: HTMLCanvasElement;
7
+ imageMap: Replayer['imageMap'];
8
+ errorHandler: Replayer['warnCanvasMutationFailed'];
9
+ }): void;
@@ -0,0 +1,9 @@
1
+ import { Replayer } from '..';
2
+ import { canvasMutationData } from '../../types';
3
+ export default function canvasMutation({ event, mutation, target, imageMap, errorHandler, }: {
4
+ event: Parameters<Replayer['applyIncremental']>[0];
5
+ mutation: canvasMutationData;
6
+ target: HTMLCanvasElement;
7
+ imageMap: Replayer['imageMap'];
8
+ errorHandler: Replayer['warnCanvasMutationFailed'];
9
+ }): void;
@@ -0,0 +1,10 @@
1
+ import { Replayer } from '../';
2
+ import { canvasMutationData, SerializedWebGlArg } from '../../types';
3
+ export declare function variableListFor(ctor: string): any[];
4
+ export declare function deserializeArg(imageMap: Replayer['imageMap']): (arg: SerializedWebGlArg) => any;
5
+ export default function webglMutation({ mutation, target, imageMap, errorHandler, }: {
6
+ mutation: canvasMutationData;
7
+ target: HTMLCanvasElement;
8
+ imageMap: Replayer['imageMap'];
9
+ errorHandler: Replayer['warnCanvasMutationFailed'];
10
+ }): void;
@@ -20,6 +20,7 @@ export declare class Replayer {
20
20
  private fragmentParentMap;
21
21
  private elementStateMap;
22
22
  private virtualStyleRulesMap;
23
+ private cache;
23
24
  private imageMap;
24
25
  private nextUserInteractionEvent;
25
26
  private mirror;
@@ -43,6 +44,7 @@ export declare class Replayer {
43
44
  addEvent(rawEvent: eventWithTime | string): void;
44
45
  enableInteract(): void;
45
46
  disableInteract(): void;
47
+ resetCache(): void;
46
48
  private setupDom;
47
49
  private handleResize;
48
50
  private applyEventsSynchronously;
@@ -52,6 +54,8 @@ export declare class Replayer {
52
54
  private insertStyleRules;
53
55
  private attachDocumentToIframe;
54
56
  private collectIframeAndAttachDocument;
57
+ private hasImageArg;
58
+ private getImageArgs;
55
59
  private waitForStylesheetLoad;
56
60
  private preloadAllImages;
57
61
  private applyIncremental;
@@ -15,4 +15,7 @@ export declare class Timer {
15
15
  isActive(): boolean;
16
16
  private findActionIndex;
17
17
  }
18
- export declare function addDelay(event: eventWithTime, baselineTime: number): number;
18
+ export declare type LastDelay = {
19
+ at: number | null;
20
+ };
21
+ export declare function addDelay(event: eventWithTime, baselineTime: number, lastDelay?: LastDelay): number;
@@ -1,5 +1,5 @@
1
1
  import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE } from './snapshot';
2
- import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild';
2
+ import rebuild, { buildNodeWithSN, addHoverClass, createCache } from './rebuild';
3
3
  export * from './types';
4
4
  export * from './utils';
5
- export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE, };
5
+ export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, createCache, transformAttribute, visitSnapshot, cleanupSnapshot, needMaskingText, IGNORED_NODE, };
@@ -1,16 +1,19 @@
1
- import { serializedNodeWithId, idNodeMap, INode } from './types';
2
- export declare function addHoverClass(cssText: string): string;
1
+ import { serializedNodeWithId, idNodeMap, INode, BuildCache } from './types';
2
+ export declare function addHoverClass(cssText: string, cache: BuildCache): string;
3
+ export declare function createCache(): BuildCache;
3
4
  export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
4
5
  doc: Document;
5
6
  map: idNodeMap;
6
7
  skipChild?: boolean;
7
8
  hackCss: boolean;
8
9
  afterAppend?: (n: INode) => unknown;
10
+ cache: BuildCache;
9
11
  }): INode | null;
10
12
  declare function rebuild(n: serializedNodeWithId, options: {
11
13
  doc: Document;
12
14
  onVisit?: (node: INode) => unknown;
13
15
  hackCss?: boolean;
14
16
  afterAppend?: (n: INode) => unknown;
17
+ cache: BuildCache;
15
18
  }): [Node | null, idNodeMap];
16
19
  export default rebuild;
@@ -9,6 +9,7 @@ export declare enum NodeType {
9
9
  export declare type documentNode = {
10
10
  type: NodeType.Document;
11
11
  childNodes: serializedNodeWithId[];
12
+ compatMode?: string;
12
13
  };
13
14
  export declare type documentTypeNode = {
14
15
  type: NodeType.DocumentType;
@@ -54,6 +55,9 @@ export declare type tagMap = {
54
55
  export interface INode extends Node {
55
56
  __sn: serializedNodeWithId;
56
57
  }
58
+ export interface ICanvas extends HTMLCanvasElement {
59
+ __context: string;
60
+ }
57
61
  export declare type idNodeMap = {
58
62
  [key: number]: INode;
59
63
  };
@@ -90,3 +94,6 @@ export declare type SlimDOMOptions = Partial<{
90
94
  export declare type MaskTextFn = (text: string) => string;
91
95
  export declare type MaskInputFn = (text: string) => string;
92
96
  export declare type KeepIframeSrcFn = (src: string) => boolean;
97
+ export declare type BuildCache = {
98
+ stylesWithHoverClass: Map<string, string>;
99
+ };