Figler.Scene.Graph.Symbol.Target (figler v0.1.0-beta.1)

Copy Markdown View Source

Symbol override target resolution.

Figma override paths point at source component nodes. For populated instances the resolver should patch the corresponding cloned node, not the source node. This module validates source paths when possible and resolves them through the graph clone index.

Summary

Functions

Resolves an override guid_path for an instance/source node.

Returns :ok when guid_path is a valid parent/child path in the source graph.

Types

resolution()

@type resolution() :: {:ok, Figler.Scene.Graph.GUID.graph_guid()} | {:error, atom()}

Functions

resolve(graph, instance_guid, guid_path)

Resolves an override guid_path for an instance/source node.

validate_source_path(graph, list)

@spec validate_source_path(Figler.Scene.Graph.t(), [
  Figler.Scene.Graph.GUID.figma_guid()
]) ::
  :ok | {:error, atom()}

Returns :ok when guid_path is a valid parent/child path in the source graph.

Single-segment paths are accepted if the source node exists; multi-segment paths must follow graph.children exactly.