Skip to content

Commit 3c406bd

Browse files
committed
rename visit to visitSnapshot
1 parent 9bf1ced commit 3c406bd

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import snapshot, {
22
serializeNodeWithId,
33
transformAttribute,
4-
visit,
4+
visitSnapshot,
55
} from './snapshot';
66
import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild';
77
export * from './types';
@@ -13,5 +13,5 @@ export {
1313
buildNodeWithSN,
1414
addHoverClass,
1515
transformAttribute,
16-
visit,
16+
visitSnapshot,
1717
};

src/snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ function snapshot(
425425
];
426426
}
427427

428-
export function visit(
428+
export function visitSnapshot(
429429
node: serializedNodeWithId,
430430
onVisit: (node: serializedNodeWithId) => unknown,
431431
) {

typings/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import snapshot, { serializeNodeWithId, transformAttribute } from './snapshot';
1+
import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot } from './snapshot';
22
import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild';
33
export * from './types';
4-
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, };
4+
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, visitSnapshot, };

typings/rebuild.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { serializedNodeWithId, idNodeMap, INode } from './types';
22
export declare function addHoverClass(cssText: string): string;
33
export declare function buildNodeWithSN(n: serializedNodeWithId, doc: Document, map: idNodeMap, skipChild?: boolean, HACK_CSS?: boolean): INode | null;
4-
declare function rebuild(n: serializedNodeWithId, doc: Document, HACK_CSS?: boolean): [Node | null, idNodeMap];
4+
declare function rebuild(n: serializedNodeWithId, doc: Document, onVisit?: (node: INode) => unknown, HACK_CSS?: boolean): [Node | null, idNodeMap];
55
export default rebuild;

typings/snapshot.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export declare function absoluteToDoc(doc: Document, attributeValue: string): st
44
export declare function transformAttribute(doc: Document, name: string, value: string): string;
55
export declare function serializeNodeWithId(n: Node | INode, doc: Document, map: idNodeMap, blockClass: string | RegExp, skipChild?: boolean, inlineStylesheet?: boolean, maskInputOptions?: MaskInputOptions): serializedNodeWithId | null;
66
declare function snapshot(n: Document, blockClass: string | RegExp | undefined, inlineStylesheet: boolean | undefined, maskAllInputsOrOptions: boolean | MaskInputOptions): [serializedNodeWithId | null, idNodeMap];
7+
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
78
export default snapshot;

0 commit comments

Comments
 (0)