refactor rebuild implementation which mount DOM onto the target document object

This commit is contained in:
Yanzhen Yu
2018-10-22 10:34:23 +08:00
parent 202a674636
commit 508bbdfc26
7 changed files with 230 additions and 117 deletions

12
index.d.ts vendored
View File

@@ -1,11 +1,19 @@
import { serializedNodeWithId, idNodeMap } from './src/types';
import { serializedNodeWithId, idNodeMap, INode } from './src/types';
export * from './src/types';
export function snapshot(n: Document): [serializedNodeWithId | null, idNodeMap];
export function rebuild(n: serializedNodeWithId, doc: Document): Node | null;
export function rebuild(
n: serializedNodeWithId,
doc: Document,
): [Node | null, idNodeMap];
export function serializeNodeWithId(
n: Node,
doc: Document,
map: idNodeMap,
): serializedNodeWithId | null;
export function resetId(): void;
export function buildNodeWithSN(
n: serializedNodeWithId,
doc: Document,
map: idNodeMap,
): INode | null;