Release 0.7.28

This commit is contained in:
Yanzhen Yu
2020-02-26 09:58:36 +08:00
parent 91cc57d032
commit fa4b4299e7
2 changed files with 40 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "rrweb", "name": "rrweb",
"version": "0.7.27", "version": "0.7.28",
"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",

42
typings/types.d.ts vendored
View File

@@ -44,6 +44,7 @@ export declare type customEvent<T = unknown> = {
payload: T; payload: T;
}; };
}; };
export declare type styleSheetEvent = {};
export declare enum IncrementalSource { export declare enum IncrementalSource {
Mutation = 0, Mutation = 0,
MouseMove = 1, MouseMove = 1,
@@ -51,7 +52,9 @@ export declare enum IncrementalSource {
Scroll = 3, Scroll = 3,
ViewportResize = 4, ViewportResize = 4,
Input = 5, Input = 5,
TouchMove = 6 TouchMove = 6,
MediaInteraction = 7,
StyleSheetRule = 8
} }
export declare type mutationData = { export declare type mutationData = {
source: IncrementalSource.Mutation; source: IncrementalSource.Mutation;
@@ -73,7 +76,13 @@ export declare type inputData = {
source: IncrementalSource.Input; source: IncrementalSource.Input;
id: number; id: number;
} & inputValue; } & 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 event = domContentLoadedEvent | loadedEvent | fullSnapshotEvent | incrementalSnapshotEvent | metaEvent | customEvent;
export declare type eventWithTime = event & { export declare type eventWithTime = event & {
timestamp: number; timestamp: number;
@@ -98,10 +107,12 @@ export declare type observerParam = {
scrollCb: scrollCallback; scrollCb: scrollCallback;
viewportResizeCb: viewportResizeCallback; viewportResizeCb: viewportResizeCallback;
inputCb: inputCallback; inputCb: inputCallback;
mediaInteractionCb: mediaInteractionCallback;
blockClass: blockClass; blockClass: blockClass;
ignoreClass: string; ignoreClass: string;
maskAllInputs: boolean; maskAllInputs: boolean;
inlineStylesheet: boolean; inlineStylesheet: boolean;
styleSheetRuleCb: styleSheetRuleCallback;
mousemoveWait: number; mousemoveWait: number;
}; };
export declare type hooksParam = { export declare type hooksParam = {
@@ -111,6 +122,8 @@ export declare type hooksParam = {
scroll?: scrollCallback; scroll?: scrollCallback;
viewportResize?: viewportResizeCallback; viewportResize?: viewportResizeCallback;
input?: inputCallback; input?: inputCallback;
mediaInteaction?: mediaInteractionCallback;
styleSheetRule?: styleSheetRuleCallback;
}; };
export declare type textCursor = { export declare type textCursor = {
node: Node; node: Node;
@@ -181,6 +194,19 @@ export declare type scrollPosition = {
y: number; y: number;
}; };
export declare type scrollCallback = (p: scrollPosition) => void; 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 = { export declare type viewportResizeDimention = {
width: number; width: number;
height: number; height: number;
@@ -193,6 +219,15 @@ export declare type inputValue = {
export declare type inputCallback = (v: inputValue & { export declare type inputCallback = (v: inputValue & {
id: number; id: number;
}) => void; }) => 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 = { export declare type Mirror = {
map: idNodeMap; map: idNodeMap;
getId: (n: INode) => number; getId: (n: INode) => number;
@@ -248,6 +283,7 @@ export declare enum ReplayerEvents {
LoadStylesheetEnd = "load-stylesheet-end", LoadStylesheetEnd = "load-stylesheet-end",
SkipStart = "skip-start", SkipStart = "skip-start",
SkipEnd = "skip-end", SkipEnd = "skip-end",
MouseInteraction = "mouse-interaction" MouseInteraction = "mouse-interaction",
EventCast = "event-cast"
} }
export {}; export {};