update typings and fix lint errors

This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
parent e00ca2cbd9
commit 0235cd4d0a
4 changed files with 11 additions and 6 deletions

View File

@@ -754,10 +754,10 @@ export class Replayer {
!this.imageMap.has(event)
) {
count++;
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var imgd = ctx?.createImageData(canvas.width, canvas.height);
var d = imgd?.data;
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const imgd = ctx?.createImageData(canvas.width, canvas.height);
let d = imgd?.data;
d = JSON.parse(event.data.args[0]);
ctx?.putImageData(imgd!, 0, 0);
}

View File

@@ -1,9 +1,10 @@
import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { mutationCallBack, observerParam, listenerHandler, blockClass, maskTextClass, hooksParam, MaskTextFn, Mirror } from '../types';
import { mutationCallBack, observerParam, listenerHandler, scrollCallback, blockClass, maskTextClass, hooksParam, SamplingStrategy, MaskTextFn, Mirror } from '../types';
import MutationBuffer from './mutation';
import { IframeManager } from './iframe-manager';
import { ShadowDomManager } from './shadow-dom-manager';
export declare const mutationBuffers: MutationBuffer[];
export declare function initMutationObserver(cb: mutationCallBack, doc: Document, blockClass: blockClass, blockSelector: string | null, maskTextClass: maskTextClass, maskTextSelector: string | null, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, maskTextFn: MaskTextFn | undefined, recordCanvas: boolean, slimDOMOptions: SlimDOMOptions, mirror: Mirror, iframeManager: IframeManager, shadowDomManager: ShadowDomManager, rootEl: Node): MutationObserver;
export declare function initScrollObserver(cb: scrollCallback, doc: Document, mirror: Mirror, blockClass: blockClass, sampling: SamplingStrategy): listenerHandler;
export declare const INPUT_TAGS: string[];
export declare function initObservers(o: observerParam, hooks?: hooksParam): listenerHandler;

View File

@@ -1,4 +1,4 @@
import { mutationCallBack, blockClass, maskTextClass, MaskTextFn, Mirror } from '../types';
import { mutationCallBack, blockClass, maskTextClass, MaskTextFn, Mirror, scrollCallback, SamplingStrategy } from '../types';
import { MaskInputOptions, SlimDOMOptions } from 'rrweb-snapshot';
import { IframeManager } from './iframe-manager';
declare type BypassOptions = {
@@ -10,15 +10,18 @@ declare type BypassOptions = {
maskInputOptions: MaskInputOptions;
maskTextFn: MaskTextFn | undefined;
recordCanvas: boolean;
sampling: SamplingStrategy;
slimDOMOptions: SlimDOMOptions;
iframeManager: IframeManager;
};
export declare class ShadowDomManager {
private mutationCb;
private scrollCb;
private bypassOptions;
private mirror;
constructor(options: {
mutationCb: mutationCallBack;
scrollCb: scrollCallback;
bypassOptions: BypassOptions;
mirror: Mirror;
});

View File

@@ -24,6 +24,7 @@ export declare class Replayer {
private newDocumentQueue;
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
on(event: string, handler: Handler): this;
off(event: string, handler: Handler): this;
setConfig(config: Partial<playerConfig>): void;
getMetaData(): playerMetaData;
getCurrentTime(): number;