diff --git a/package.json b/package.json index 32b8da8a..cfb61ead 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rrweb-snapshot", - "version": "0.7.20", + "version": "0.7.21", "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/index.d.ts b/typings/index.d.ts index 420b997e..81e7b277 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1,4 +1,4 @@ -import snapshot, { serializeNodeWithId } from './snapshot'; +import snapshot, { serializeNodeWithId, transformAttribute } from './snapshot'; import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild'; export * from './types'; -export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, }; +export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, }; diff --git a/typings/snapshot.d.ts b/typings/snapshot.d.ts index 594b8ccd..fca31217 100644 --- a/typings/snapshot.d.ts +++ b/typings/snapshot.d.ts @@ -1,5 +1,7 @@ import { serializedNodeWithId, INode, idNodeMap } from './types'; export declare function absoluteToStylesheet(cssText: string, 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 default snapshot;