From 9035a8f81404fdac8116c05ba505299856e6dcac Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] Release 0.7.28 --- package.json | 2 +- typings/types.d.ts | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 805f655e..d17f5d5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrweb", - "version": "0.7.27", + "version": "0.7.28", "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", diff --git a/typings/types.d.ts b/typings/types.d.ts index 2da35b7b..bbe1c033 100644 --- a/typings/types.d.ts +++ b/typings/types.d.ts @@ -44,6 +44,7 @@ export declare type customEvent = { payload: T; }; }; +export declare type styleSheetEvent = {}; export declare enum IncrementalSource { Mutation = 0, MouseMove = 1, @@ -51,7 +52,9 @@ export declare enum IncrementalSource { Scroll = 3, ViewportResize = 4, Input = 5, - TouchMove = 6 + TouchMove = 6, + MediaInteraction = 7, + StyleSheetRule = 8 } export declare type mutationData = { source: IncrementalSource.Mutation; @@ -73,7 +76,13 @@ export declare type inputData = { source: IncrementalSource.Input; id: number; } & inputValue; -export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData; +export declare type mediaInteractionData = { + source: IncrementalSource.MediaInteraction; +} & mediaInteractionParam; +export declare type styleSheetRuleData = { + source: IncrementalSource.StyleSheetRule; +} & styleSheetRuleParam; +export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData; export declare type event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent; export declare type eventWithTime = event & { timestamp: number; @@ -98,10 +107,12 @@ export declare type observerParam = { scrollCb: scrollCallback; viewportResizeCb: viewportResizeCallback; inputCb: inputCallback; + mediaInteractionCb: mediaInteractionCallback; blockClass: blockClass; ignoreClass: string; maskAllInputs: boolean; inlineStylesheet: boolean; + styleSheetRuleCb: styleSheetRuleCallback; mousemoveWait: number; }; export declare type hooksParam = { @@ -111,6 +122,8 @@ export declare type hooksParam = { scroll?: scrollCallback; viewportResize?: viewportResizeCallback; input?: inputCallback; + mediaInteaction?: mediaInteractionCallback; + styleSheetRule?: styleSheetRuleCallback; }; export declare type textCursor = { node: Node; @@ -181,6 +194,19 @@ export declare type scrollPosition = { y: number; }; export declare type scrollCallback = (p: scrollPosition) => void; +export declare type styleSheetAddRule = { + rule: string; + index?: number; +}; +export declare type styleSheetDeleteRule = { + index: number; +}; +export declare type styleSheetRuleParam = { + id: number; + removes?: styleSheetDeleteRule[]; + adds?: styleSheetAddRule[]; +}; +export declare type styleSheetRuleCallback = (s: styleSheetRuleParam) => void; export declare type viewportResizeDimention = { width: number; height: number; @@ -193,6 +219,15 @@ export declare type inputValue = { export declare type inputCallback = (v: inputValue & { id: number; }) => void; +export declare const enum MediaInteractions { + Play = 0, + Pause = 1 +} +export declare type mediaInteractionParam = { + type: MediaInteractions; + id: number; +}; +export declare type mediaInteractionCallback = (p: mediaInteractionParam) => void; export declare type Mirror = { map: idNodeMap; getId: (n: INode) => number; @@ -248,6 +283,7 @@ export declare enum ReplayerEvents { LoadStylesheetEnd = "load-stylesheet-end", SkipStart = "skip-start", SkipEnd = "skip-end", - MouseInteraction = "mouse-interaction" + MouseInteraction = "mouse-interaction", + EventCast = "event-cast" } export {};