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

Copy Markdown View Source

Internal GUID representation for Elixir graph resolution.

Public scene APIs expose GUIDs as strings like "1:23". The graph resolver keeps real Figma GUIDs as {session_id, local_id} tuples and synthetic clone IDs as {:clone, root_instance_guid, source_path} tagged tuples.

Summary

Functions

Appends a source GUID or source clone path to a clone path.

Builds a synthetic clone graph GUID under a root instance.

Formats an internal graph GUID for public scene APIs.

Converts a generated schema GUID struct to an internal tuple.

Parses a public GUID string or returns an already parsed graph GUID.

Parses a public GUID string, raising when it is invalid.

Returns the root instance GUID for graph GUIDs.

Types

clone_path()

@type clone_path() :: [figma_guid()] | {clone_path(), figma_guid()}

figma_guid()

@type figma_guid() :: {non_neg_integer(), non_neg_integer()}

graph_guid()

@type graph_guid() :: figma_guid() | {:clone, figma_guid(), clone_path()}

Functions

append(parent_guid, source_guid)

@spec append(graph_guid(), graph_guid()) :: graph_guid()

Appends a source GUID or source clone path to a clone path.

clone(root_guid, source_guid)

@spec clone(figma_guid(), figma_guid()) :: graph_guid()

Builds a synthetic clone graph GUID under a root instance.

format(arg1)

@spec format(graph_guid() | nil) :: String.t() | nil

Formats an internal graph GUID for public scene APIs.

from_schema(arg1)

@spec from_schema(Figler.Schema.GUID.t() | nil) :: figma_guid() | nil

Converts a generated schema GUID struct to an internal tuple.

parse(guid)

@spec parse(String.t() | graph_guid() | nil) :: graph_guid() | nil

Parses a public GUID string or returns an already parsed graph GUID.

parse!(guid)

@spec parse!(String.t() | graph_guid()) :: graph_guid()

Parses a public GUID string, raising when it is invalid.

root(guid)

@spec root(graph_guid()) :: figma_guid()

Returns the root instance GUID for graph GUIDs.