Skip to content

AI-native design editor. Open-source Figma alternative.

403 B
Raw Blame
import type { SceneGraph } from '@open-pencil/scene-graph'

export function createGraphReadActions(getGraph: () => SceneGraph) {
  return {
    getNode: (id: string) => getGraph().getNode(id),
    getImage: (hash: string) => getGraph().images.get(hash),
    getChildren: (id: string) => getGraph().getChildren(id),
    getPages: (includeInternal?: boolean) => getGraph().getPages(includeInternal)
  }
}