@highlight-run/rrweb 1.1.0 → 1.1.4

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.
@@ -1,4 +1,6 @@
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;
1
+ import { IWindow, SerializedWebGlArg } from '../../../types';
2
+ export declare function variableListFor(ctx: WebGLRenderingContext | WebGL2RenderingContext, ctor: string): any[];
3
+ export declare const saveWebGLVar: (value: any, win: IWindow, ctx: WebGL2RenderingContext | WebGLRenderingContext) => number | void;
4
+ export declare function serializeArg(value: any, win: IWindow, ctx: WebGL2RenderingContext | WebGLRenderingContext): SerializedWebGlArg;
5
+ export declare const serializeArgs: (args: Array<any>, win: IWindow, ctx: WebGLRenderingContext | WebGL2RenderingContext) => SerializedWebGlArg[];
6
+ export declare const isInstanceOfWebGLObject: (value: any, win: IWindow) => value is WebGLShader | WebGLProgram | WebGLActiveInfo | WebGLBuffer | WebGLFramebuffer | WebGLRenderbuffer | WebGLShaderPrecisionFormat | WebGLTexture | WebGLUniformLocation | WebGLVertexArrayObject;
@@ -1,8 +1,8 @@
1
1
  import { Replayer } from '../';
2
- import { canvasMutationData } from '../../types';
2
+ import { canvasMutationCommand } from '../../types';
3
3
  export default function canvasMutation({ event, mutation, target, imageMap, errorHandler, }: {
4
4
  event: Parameters<Replayer['applyIncremental']>[0];
5
- mutation: canvasMutationData;
5
+ mutation: canvasMutationCommand;
6
6
  target: HTMLCanvasElement;
7
7
  imageMap: Replayer['imageMap'];
8
8
  errorHandler: Replayer['warnCanvasMutationFailed'];
@@ -1,10 +1,11 @@
1
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;
2
+ import { CanvasContext, canvasMutationCommand, SerializedWebGlArg } from '../../types';
3
+ export declare function variableListFor(ctx: WebGLRenderingContext | WebGL2RenderingContext, ctor: string): any[];
4
+ export declare function deserializeArg(imageMap: Replayer['imageMap'], ctx: WebGLRenderingContext | WebGL2RenderingContext): (arg: SerializedWebGlArg) => any;
5
+ export default function webglMutation({ mutation, target, type, imageMap, errorHandler, }: {
6
+ mutation: canvasMutationCommand;
7
7
  target: HTMLCanvasElement;
8
+ type: CanvasContext;
8
9
  imageMap: Replayer['imageMap'];
9
10
  errorHandler: Replayer['warnCanvasMutationFailed'];
10
11
  }): void;
@@ -13,6 +13,7 @@ export declare class Replayer {
13
13
  private mouseTail;
14
14
  private tailPositions;
15
15
  private emitter;
16
+ private nextUserInteractionEvent;
16
17
  private activityIntervals;
17
18
  private inactiveEndTimestamp;
18
19
  private legacy_missingNodeRetryMap;
@@ -22,7 +23,6 @@ export declare class Replayer {
22
23
  private virtualStyleRulesMap;
23
24
  private cache;
24
25
  private imageMap;
25
- private nextUserInteractionEvent;
26
26
  private mirror;
27
27
  private firstFullSnapshot;
28
28
  private newDocumentQueue;
@@ -54,10 +54,11 @@ export declare class Replayer {
54
54
  private insertStyleRules;
55
55
  private attachDocumentToIframe;
56
56
  private collectIframeAndAttachDocument;
57
+ private waitForStylesheetLoad;
57
58
  private hasImageArg;
58
59
  private getImageArgs;
59
- private waitForStylesheetLoad;
60
60
  private preloadAllImages;
61
+ private preloadImages;
61
62
  private applyIncremental;
62
63
  private applyMutation;
63
64
  private applyScroll;
@@ -15,7 +15,4 @@ export declare class Timer {
15
15
  isActive(): boolean;
16
16
  private findActionIndex;
17
17
  }
18
- export declare type LastDelay = {
19
- at: number | null;
20
- };
21
- export declare function addDelay(event: eventWithTime, baselineTime: number, lastDelay?: LastDelay): number;
18
+ export declare function addDelay(event: eventWithTime, baselineTime: number): number;
package/dist/types.d.ts CHANGED
@@ -132,7 +132,7 @@ export declare type SamplingStrategy = Partial<{
132
132
  }>;
133
133
  export declare type RecordPlugin<TOptions = unknown> = {
134
134
  name: string;
135
- observer: (cb: Function, win: Window, options: TOptions) => listenerHandler;
135
+ observer: (cb: Function, win: IWindow, options: TOptions) => listenerHandler;
136
136
  options: TOptions;
137
137
  };
138
138
  export declare type recordOptions<T> = {
@@ -346,14 +346,19 @@ export declare type styleDeclarationParam = {
346
346
  };
347
347
  export declare type styleDeclarationCallback = (s: styleDeclarationParam) => void;
348
348
  export declare type canvasMutationCallback = (p: canvasMutationParam) => void;
349
- export declare type canvasMutationParam = {
350
- id: number;
351
- type: CanvasContext;
349
+ export declare type canvasMutationCommand = {
352
350
  property: string;
353
351
  args: Array<unknown>;
354
352
  setter?: true;
355
- newFrame?: true;
356
353
  };
354
+ export declare type canvasMutationParam = {
355
+ id: number;
356
+ type: CanvasContext;
357
+ commands: canvasMutationCommand[];
358
+ } | ({
359
+ id: number;
360
+ type: CanvasContext;
361
+ } & canvasMutationCommand);
357
362
  export declare type fontParam = {
358
363
  family: string;
359
364
  fontSource: string;
@@ -450,7 +455,6 @@ export declare type missingNodeMap = {
450
455
  export declare type actionWithDelay = {
451
456
  doAction: () => void;
452
457
  delay: number;
453
- newFrame: boolean;
454
458
  };
455
459
  export declare type Handler = (event?: unknown) => void;
456
460
  export declare type Emitter = {
package/dist/utils.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData, DocumentDimension } from './types';
1
+ import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass, addedNodeMutation, removedNodeMutation, textMutation, attributeMutation, mutationData, scrollData, inputData, DocumentDimension, IWindow } from './types';
2
2
  import { INode, serializedNodeWithId } from './snapshot';
3
- export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | Window): listenerHandler;
3
+ export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | IWindow): listenerHandler;
4
4
  export declare function createMirror(): Mirror;
5
5
  export declare let _mirror: Mirror;
6
6
  export declare function throttle<T>(func: (arg: T) => void, wait: number, options?: throttleOptions): (arg: T) => void;
7
- export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: Window & typeof globalThis): hookResetter;
7
+ export declare function hookSetter<T>(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean, win?: IWindow): hookResetter;
8
8
  export declare function patch(source: {
9
9
  [key: string]: any;
10
10
  }, name: string, replacement: (...args: any[]) => any): () => void;
@@ -14,7 +14,7 @@ export declare function isBlocked(node: Node | null, blockClass: blockClass): bo
14
14
  export declare function isIgnored(n: Node | INode): boolean;
15
15
  export declare function isAncestorRemoved(target: INode, mirror: Mirror): boolean;
16
16
  export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent;
17
- export declare function polyfill(win?: Window & typeof globalThis): void;
17
+ export declare function polyfill(win?: IWindow): void;
18
18
  export declare type TreeNode = {
19
19
  id: number;
20
20
  mutation: addedNodeMutation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highlight-run/rrweb",
3
- "version": "1.1.0",
3
+ "version": "1.1.4",
4
4
  "description": "record and replay the web",
5
5
  "scripts": {
6
6
  "test": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register -r ignore-styles -r jsdom-global/register test/**.test.ts",