@highlight-run/rrweb 1.1.2 → 1.1.6

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,5 +1,6 @@
1
1
  import { IWindow, SerializedWebGlArg } from '../../../types';
2
- export declare function serializeArg(value: any, win: IWindow): SerializedWebGlArg;
3
- export declare const serializeArgs: (args: Array<any>, win: IWindow) => SerializedWebGlArg[];
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[];
4
6
  export declare const isInstanceOfWebGLObject: (value: any, win: IWindow) => value is WebGLShader | WebGLProgram | WebGLActiveInfo | WebGLBuffer | WebGLFramebuffer | WebGLRenderbuffer | WebGLShaderPrecisionFormat | WebGLTexture | WebGLUniformLocation | WebGLVertexArrayObject;
5
- export declare const saveWebGLVar: (value: any, win: IWindow) => number | void;
@@ -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;
@@ -58,6 +58,7 @@ export declare class Replayer {
58
58
  private hasImageArg;
59
59
  private getImageArgs;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highlight-run/rrweb",
3
- "version": "1.1.2",
3
+ "version": "1.1.6",
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",