rename visit to visitSnapshot

This commit is contained in:
Yanzhen Yu
2020-08-22 15:42:55 +08:00
parent 9bf1ced656
commit 3c406bd49f
5 changed files with 7 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
import snapshot, {
serializeNodeWithId,
transformAttribute,
visit,
visitSnapshot,
} from './snapshot';
import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild';
export * from './types';
@@ -13,5 +13,5 @@ export {
buildNodeWithSN,
addHoverClass,
transformAttribute,
visit,
visitSnapshot,
};

View File

@@ -425,7 +425,7 @@ function snapshot(
];
}
export function visit(
export function visitSnapshot(
node: serializedNodeWithId,
onVisit: (node: serializedNodeWithId) => unknown,
) {

4
typings/index.d.ts vendored
View File

@@ -1,4 +1,4 @@
import snapshot, { serializeNodeWithId, transformAttribute } from './snapshot';
import snapshot, { serializeNodeWithId, transformAttribute, visitSnapshot } from './snapshot';
import rebuild, { buildNodeWithSN, addHoverClass } from './rebuild';
export * from './types';
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, };
export { snapshot, serializeNodeWithId, rebuild, buildNodeWithSN, addHoverClass, transformAttribute, visitSnapshot, };

View File

@@ -1,5 +1,5 @@
import { serializedNodeWithId, idNodeMap, INode } from './types';
export declare function addHoverClass(cssText: string): string;
export declare function buildNodeWithSN(n: serializedNodeWithId, doc: Document, map: idNodeMap, skipChild?: boolean, HACK_CSS?: boolean): INode | null;
declare function rebuild(n: serializedNodeWithId, doc: Document, HACK_CSS?: boolean): [Node | null, idNodeMap];
declare function rebuild(n: serializedNodeWithId, doc: Document, onVisit?: (node: INode) => unknown, HACK_CSS?: boolean): [Node | null, idNodeMap];
export default rebuild;

View File

@@ -4,4 +4,5 @@ export declare function absoluteToDoc(doc: Document, attributeValue: string): st
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, maskInputOptions?: MaskInputOptions): serializedNodeWithId | null;
declare function snapshot(n: Document, blockClass: string | RegExp | undefined, inlineStylesheet: boolean | undefined, maskAllInputsOrOptions: boolean | MaskInputOptions): [serializedNodeWithId | null, idNodeMap];
export declare function visitSnapshot(node: serializedNodeWithId, onVisit: (node: serializedNodeWithId) => unknown): void;
export default snapshot;