Release 0.9.5

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 0ca0554613
commit 87e467af79
2 changed files with 19 additions and 3 deletions

View File

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

20
typings/types.d.ts vendored
View File

@@ -1,5 +1,6 @@
import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions } from 'rrweb-snapshot'; import { serializedNodeWithId, idNodeMap, INode, MaskInputOptions } from 'rrweb-snapshot';
import { PackFn, UnpackFn } from './packer/base'; import { PackFn, UnpackFn } from './packer/base';
import { FontFaceDescriptors } from 'css-font-loading-module';
export declare enum EventType { export declare enum EventType {
DomContentLoaded = 0, DomContentLoaded = 0,
Load = 1, Load = 1,
@@ -56,7 +57,8 @@ export declare enum IncrementalSource {
TouchMove = 6, TouchMove = 6,
MediaInteraction = 7, MediaInteraction = 7,
StyleSheetRule = 8, StyleSheetRule = 8,
CanvasMutation = 9 CanvasMutation = 9,
Font = 10
} }
export declare type mutationData = { export declare type mutationData = {
source: IncrementalSource.Mutation; source: IncrementalSource.Mutation;
@@ -87,7 +89,10 @@ export declare type styleSheetRuleData = {
export declare type canvasMutationData = { export declare type canvasMutationData = {
source: IncrementalSource.CanvasMutation; source: IncrementalSource.CanvasMutation;
} & canvasMutationParam; } & canvasMutationParam;
export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData; export declare type fontData = {
source: IncrementalSource.Font;
} & fontParam;
export declare type incrementalData = mutationData | mousemoveData | mouseInteractionData | scrollData | viewportResizeData | inputData | mediaInteractionData | styleSheetRuleData | canvasMutationData | fontData;
export declare type event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent; export declare type event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent;
export declare type eventWithTime = event & { export declare type eventWithTime = event & {
timestamp: number; timestamp: number;
@@ -113,6 +118,7 @@ export declare type recordOptions<T> = {
packFn?: PackFn; packFn?: PackFn;
sampling?: SamplingStrategy; sampling?: SamplingStrategy;
recordCanvas?: boolean; recordCanvas?: boolean;
collectFonts?: boolean;
mousemoveWait?: number; mousemoveWait?: number;
}; };
export declare type observerParam = { export declare type observerParam = {
@@ -129,8 +135,10 @@ export declare type observerParam = {
inlineStylesheet: boolean; inlineStylesheet: boolean;
styleSheetRuleCb: styleSheetRuleCallback; styleSheetRuleCb: styleSheetRuleCallback;
canvasMutationCb: canvasMutationCallback; canvasMutationCb: canvasMutationCallback;
fontCb: fontCallback;
sampling: SamplingStrategy; sampling: SamplingStrategy;
recordCanvas: boolean; recordCanvas: boolean;
collectFonts: boolean;
}; };
export declare type hooksParam = { export declare type hooksParam = {
mutation?: mutationCallBack; mutation?: mutationCallBack;
@@ -142,6 +150,7 @@ export declare type hooksParam = {
mediaInteaction?: mediaInteractionCallback; mediaInteaction?: mediaInteractionCallback;
styleSheetRule?: styleSheetRuleCallback; styleSheetRule?: styleSheetRuleCallback;
canvasMutation?: canvasMutationCallback; canvasMutation?: canvasMutationCallback;
font?: fontCallback;
}; };
export declare type mutationRecord = { export declare type mutationRecord = {
type: string; type: string;
@@ -240,6 +249,13 @@ export declare type canvasMutationParam = {
args: Array<unknown>; args: Array<unknown>;
setter?: true; setter?: true;
}; };
export declare type fontParam = {
family: string;
fontSource: string;
buffer: boolean;
descriptors?: FontFaceDescriptors;
};
export declare type fontCallback = (p: fontParam) => void;
export declare type viewportResizeDimention = { export declare type viewportResizeDimention = {
width: number; width: number;
height: number; height: number;