Files
rrweb/packages/rrweb-snapshot/typings/rebuild.d.ts
Justin Halsall d4f5d8dc48 Remove INode (node.__sn) and use Mirror as source of truth (#868)
* Move ids to weakmap

* Fix typo

* Move from INode to storing serialized data in mirror

* Update packages/rrweb-snapshot/src/rebuild.ts

Co-authored-by: Yun Feng <yun.feng@anu.edu.au>

* Remove unnessisary `as Node` typecastings

Fixes: https://github.com/rrweb-io/rrweb/pull/868#discussion_r842240758

* Remove unnessisary `as unknown as ...`

* Remove unnessisary `as unknown as ...`

* Reset mirror when recording starts

Solves: https://github.com/rrweb-io/rrweb/pull/868#discussion_r842249599

* API has changed for snapshot, change test to reflect that

* Allow for es5 compatibility

* Remove unnessisary as unknown as ... and change test to reflect the API change

* Refactor mirror to remove `nodeIdMap`

Fixes: https://github.com/rrweb-io/rrweb/pull/868#discussion_r842732696

Co-authored-by: Yun Feng <yun.feng@anu.edu.au>
2026-04-01 12:00:00 +08:00

22 lines
736 B
TypeScript

import { serializedNodeWithId, BuildCache } from './types';
import { Mirror } from './utils';
export declare function addHoverClass(cssText: string, cache: BuildCache): string;
export declare function createCache(): BuildCache;
export declare function buildNodeWithSN(n: serializedNodeWithId, options: {
doc: Document;
mirror: Mirror;
skipChild?: boolean;
hackCss: boolean;
afterAppend?: (n: Node) => unknown;
cache: BuildCache;
}): Node | null;
declare function rebuild(n: serializedNodeWithId, options: {
doc: Document;
onVisit?: (node: Node) => unknown;
hackCss?: boolean;
afterAppend?: (n: Node) => unknown;
cache: BuildCache;
mirror: Mirror;
}): Node | null;
export default rebuild;