From dbcf03e41549b6a4b7eea04cbfad64b50233f1d1 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Sat, 10 Aug 2019 17:32:24 +0800 Subject: [PATCH] Release 0.7.20 --- package.json | 2 +- typings/replay/index.d.ts | 1 + typings/types.d.ts | 7 ++++--- typings/utils.d.ts | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2bafadcb..8c07f542 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrweb", - "version": "0.7.19", + "version": "0.7.20", "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/replay/index.d.ts b/typings/replay/index.d.ts index f509f584..68f512ca 100644 --- a/typings/replay/index.d.ts +++ b/typings/replay/index.d.ts @@ -18,6 +18,7 @@ export declare class Replayer { on(event: string, handler: Handler): void; setConfig(config: Partial): void; getMetaData(): playerMetaData; + getCurrentTime(): number; getTimeOffset(): number; play(timeOffset?: number): void; pause(): void; diff --git a/typings/types.d.ts b/typings/types.d.ts index 18600e9f..13ab3d9c 100644 --- a/typings/types.d.ts +++ b/typings/types.d.ts @@ -50,13 +50,14 @@ export declare enum IncrementalSource { MouseInteraction = 2, Scroll = 3, ViewportResize = 4, - Input = 5 + Input = 5, + TouchMove = 6 } export declare type mutationData = { source: IncrementalSource.Mutation; } & mutationCallbackParam; export declare type mousemoveData = { - source: IncrementalSource.MouseMove; + source: IncrementalSource.MouseMove | IncrementalSource.TouchMove; positions: mousePosition[]; }; export declare type mouseInteractionData = { @@ -137,7 +138,7 @@ declare type mutationCallbackParam = { adds: addedNodeMutation[]; }; export declare type mutationCallBack = (m: mutationCallbackParam) => void; -export declare type mousemoveCallBack = (p: mousePosition[]) => void; +export declare type mousemoveCallBack = (p: mousePosition[], source: IncrementalSource.MouseMove | IncrementalSource.TouchMove) => void; export declare type mousePosition = { x: number; y: number; diff --git a/typings/utils.d.ts b/typings/utils.d.ts index 1df115e9..4d176dc2 100644 --- a/typings/utils.d.ts +++ b/typings/utils.d.ts @@ -2,10 +2,11 @@ import { Mirror, throttleOptions, listenerHandler, hookResetter, blockClass } fr import { INode } from 'rrweb-snapshot'; export declare function on(type: string, fn: EventListenerOrEventListenerObject, target?: Document | Window): listenerHandler; export declare const mirror: Mirror; -export declare function throttle(func: (arg: T) => void, wait: number, options?: throttleOptions): () => void; +export declare function throttle(func: (arg: T) => void, wait: number, options?: throttleOptions): (args: T) => void; export declare function hookSetter(target: T, key: string | number | symbol, d: PropertyDescriptor, isRevoked?: boolean): hookResetter; export declare function getWindowHeight(): number; export declare function getWindowWidth(): number; export declare function isBlocked(node: Node | null, blockClass: blockClass): boolean; export declare function isAncestorRemoved(target: INode): boolean; export declare function isTouchEvent(event: MouseEvent | TouchEvent): event is TouchEvent; +export declare function polyfill(): void;