mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
feat(vom): function refactor
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import type { Viewport, VomScene } from "@browser-skill/vom";
|
||||
import type { FrameDocument } from "../frame-document";
|
||||
import { buildSemanticGraph } from "./build";
|
||||
import { projectSemanticGraph } from "./project";
|
||||
import { resolveSemanticGraph } from "./resolve";
|
||||
import type { SemanticAxNode } from "./types";
|
||||
|
||||
export type { SemanticAxNode } from "./types";
|
||||
|
||||
export function buildSemanticVomScene(input: {
|
||||
documents: FrameDocument<SemanticAxNode>[];
|
||||
viewport: Viewport;
|
||||
rootFrameId?: string;
|
||||
excludedBackendNodeIds?: ReadonlySet<number>;
|
||||
}): VomScene {
|
||||
return projectSemanticGraph(
|
||||
resolveSemanticGraph(
|
||||
buildSemanticGraph({
|
||||
documents: input.documents,
|
||||
viewport: input.viewport,
|
||||
rootFrameId: input.rootFrameId,
|
||||
excludedBackendNodeIds: input.excludedBackendNodeIds,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user