From c206e100f1845b73d3fc389c95c212059ac008b9 Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Sat, 18 Jul 2020 13:32:36 +0800 Subject: [PATCH] Release 0.7.28 --- package.json | 2 +- typings/snapshot.d.ts | 6 +++--- typings/types.d.ts | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7d9c9a97..320d77a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrweb-snapshot", - "version": "0.7.27", + "version": "0.7.28", "description": "rrweb's component to take a snapshot of DOM, aka DOM serializer", "scripts": { "test": "cross-env TS_NODE_CACHE=false TS_NODE_FILES=true mocha -r ts-node/register test/**/*.ts", diff --git a/typings/snapshot.d.ts b/typings/snapshot.d.ts index e630a036..3b6ed5d7 100644 --- a/typings/snapshot.d.ts +++ b/typings/snapshot.d.ts @@ -1,7 +1,7 @@ -import { serializedNodeWithId, INode, idNodeMap } from './types'; +import { serializedNodeWithId, INode, idNodeMap, MaskInputOptions } from './types'; export declare function absoluteToStylesheet(cssText: string | null, href: string): string; export declare function absoluteToDoc(doc: Document, attributeValue: string): string; export declare function transformAttribute(doc: Document, name: string, value: string): string; -export declare function serializeNodeWithId(n: Node | INode, doc: Document, map: idNodeMap, blockClass: string | RegExp, skipChild?: boolean, inlineStylesheet?: boolean, maskAllInputs?: boolean): serializedNodeWithId | null; -declare function snapshot(n: Document, blockClass?: string | RegExp, inlineStylesheet?: boolean, maskAllInputs?: boolean): [serializedNodeWithId | null, idNodeMap]; +export declare function serializeNodeWithId(n: Node | INode, doc: Document, map: idNodeMap, blockClass: string | RegExp, skipChild?: boolean, inlineStylesheet?: boolean, maskInputOptions?: MaskInputOptions): serializedNodeWithId | null; +declare function snapshot(n: Document, blockClass: string | RegExp | undefined, inlineStylesheet: boolean | undefined, maskAllInputsOrOptions: boolean | MaskInputOptions): [serializedNodeWithId | null, idNodeMap]; export default snapshot; diff --git a/typings/types.d.ts b/typings/types.d.ts index 556e0bdf..5c385e48 100644 --- a/typings/types.d.ts +++ b/typings/types.d.ts @@ -53,3 +53,18 @@ export interface INode extends Node { export declare type idNodeMap = { [key: number]: INode; }; +export declare type MaskInputOptions = Partial<{ + color: boolean; + date: boolean; + 'datetime-local': boolean; + email: boolean; + month: boolean; + number: boolean; + range: boolean; + search: boolean; + tel: boolean; + text: boolean; + time: boolean; + url: boolean; + week: boolean; +}>;