Release 0.9.1

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent f83f4e7b13
commit 6ba84ee5d0
5 changed files with 26 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "rrweb",
"version": "0.9.0",
"version": "0.9.1",
"description": "record and replay the web",
"scripts": {
"test": "npm run bundle:browser && cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.test.ts",

View File

@@ -13,7 +13,8 @@ export default class MutationBuffer {
private blockClass;
private inlineStylesheet;
private maskInputOptions;
constructor(cb: mutationCallBack, blockClass: blockClass, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions);
private recordCanvas;
constructor(cb: mutationCallBack, blockClass: blockClass, inlineStylesheet: boolean, maskInputOptions: MaskInputOptions, recordCanvas: boolean);
processMutations: (mutations: mutationRecord[]) => void;
emit: () => void;
private processMutation;

View File

@@ -15,6 +15,7 @@ export declare class Replayer {
private legacy_missingNodeRetryMap;
private treeIndex;
private fragmentParentMap;
private imageMap;
constructor(events: Array<eventWithTime | string>, config?: Partial<playerConfig>);
on(event: string, handler: Handler): void;
setConfig(config: Partial<playerConfig>): void;
@@ -33,6 +34,7 @@ export declare class Replayer {
private getCastFn;
private rebuildFullSnapshot;
private waitForStylesheetLoad;
private preloadAllImages;
private applyIncremental;
private applyMutation;
private applyScroll;
@@ -43,5 +45,6 @@ export declare class Replayer {
private isUserInteraction;
private backToNormal;
private warnNodeNotFound;
private warnCanvasMutationFailed;
private debugNodeNotFound;
}

View File

@@ -12,6 +12,7 @@ export declare class Timer {
clear(): void;
setSpeed(speed: number): void;
toggleLiveMode(mode: boolean): void;
isActive(): boolean;
private findActionIndex;
}
export declare function addDelay(event: eventWithTime, baselineTime: number): number;

21
typings/types.d.ts vendored
View File

@@ -55,7 +55,8 @@ export declare enum IncrementalSource {
Input = 5,
TouchMove = 6,
MediaInteraction = 7,
StyleSheetRule = 8
StyleSheetRule = 8,
CanvasMutation = 9
}
export declare type mutationData = {
source: IncrementalSource.Mutation;
@@ -83,7 +84,10 @@ export declare type mediaInteractionData = {
export declare type styleSheetRuleData = {
source: IncrementalSource.StyleSheetRule;
} & styleSheetRuleParam;
export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData;
export declare type canvasMutationData = {
source: IncrementalSource.CanvasMutation;
} & canvasMutationParam;
export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData;
export declare type event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent;
export declare type eventWithTime = event & {
timestamp: number;
@@ -108,6 +112,7 @@ export declare type recordOptions<T> = {
hooks?: hooksParam;
packFn?: PackFn;
sampling?: SamplingStrategy;
recordCanvas?: boolean;
mousemoveWait?: number;
};
export declare type observerParam = {
@@ -123,7 +128,9 @@ export declare type observerParam = {
maskInputOptions: MaskInputOptions;
inlineStylesheet: boolean;
styleSheetRuleCb: styleSheetRuleCallback;
canvasMutationCb: canvasMutationCallback;
sampling: SamplingStrategy;
recordCanvas: boolean;
};
export declare type hooksParam = {
mutation?: mutationCallBack;
@@ -134,6 +141,7 @@ export declare type hooksParam = {
input?: inputCallback;
mediaInteaction?: mediaInteractionCallback;
styleSheetRule?: styleSheetRuleCallback;
canvasMutation?: canvasMutationCallback;
};
export declare type mutationRecord = {
type: string;
@@ -225,6 +233,13 @@ export declare type styleSheetRuleParam = {
adds?: styleSheetAddRule[];
};
export declare type styleSheetRuleCallback = (s: styleSheetRuleParam) => void;
export declare type canvasMutationCallback = (p: canvasMutationParam) => void;
export declare type canvasMutationParam = {
id: number;
property: string;
args: Array<unknown>;
setter?: true;
};
export declare type viewportResizeDimention = {
width: number;
height: number;
@@ -270,6 +285,7 @@ export declare type playerConfig = {
liveMode: boolean;
insertStyleRules: string[];
triggerFocus: boolean;
UNSAFE_replayCanvas: boolean;
unpackFn?: UnpackFn;
};
export declare type playerMetaData = {
@@ -292,6 +308,7 @@ export declare type Handler = (event?: unknown) => void;
export declare type Emitter = {
on(type: string, handler: Handler): void;
emit(type: string, event?: unknown): void;
off(type: string, handler: Handler): void;
};
export declare type Arguments<T> = T extends (...payload: infer U) => unknown ? U : unknown;
export declare enum ReplayerEvents {